User Tools

Site Tools


developers:templates:reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:templates:reference [2014/10/18 12:50]
Jaco van Wyk [Final Details]
developers:templates:reference [2019/05/10 07:30]
Jaco van Wyk
Line 1: Line 1:
 ====== Template Reference ====== ====== Template Reference ======
  
-The syntax draws inspiration from Markdown, a little from the PHP programming language as well as a few ideas from the template system in my pre-Ubuntu favourite music player foobar2000. I’ve tried to keep it as easy to read as possible, but in quite a few places I have chosen to put power and flexibility first.+The syntax draws inspiration from [[http://​daringfireball.net/​projects/​markdown/​|Markdown]], a little from the [[http://​www.php.net/​|PHP]] programming language as well as a few ideas from the template system in my pre-Ubuntu favourite music player ​[[http://​www.foobar2000.org/​|foobar2000]]. I’ve tried to keep it as easy to read as possible, but in quite a few places I have chosen to put power and flexibility first.
  
 ===== The Basics ===== ===== The Basics =====
Line 27: Line 27:
 </​code>​ </​code>​
  
-===== Once step up with variables =====+===== One step up with variables =====
  
 In the example above we hard-coded the name ‘josh’ into the template where the username was meant to go. While this produced the results as expected, its not really useful to have a template with fixed values. In the example above we hard-coded the name ‘josh’ into the template where the username was meant to go. While this produced the results as expected, its not really useful to have a template with fixed values.
Line 74: Line 74:
 ===== Final Details ===== ===== Final Details =====
  
-There are a few more features that have not been covered yet. The first important one is including links in your template. This is achieved by wrapping an address in double square brackets such as “[[www.google.com]]”. We also allow link captions that are different from the address, by including a vertical bar: “[[www.google.com|Google Website]]”+There are a few more features that have not been covered yet. The first important one is including links in your template. This is achieved by wrapping an address in double square brackets such as “[[http://www.google.com]]”. We also allow link captions that are different from the address, by including a vertical bar: “[[http://www.google.com|Google Website]]”
  
 Variables can also be formatted according to a bunch of specific rules. In order to pass the variable to be formatted the code looks like $username(>​upper) which will pass the username to the ‘upper’ function (will look something like “JOSH”). The complete list of current functions available is: upper (upper-case),​ lower (lower-case),​ u2s (underscores to spaces), ucwords (upper-case first letter of each word), ucfirst (upper-case only first letter), and empty (coverts to nothing – which is sometimes useful when combined with the missing variable syntax). Variables can also be formatted according to a bunch of specific rules. In order to pass the variable to be formatted the code looks like $username(>​upper) which will pass the username to the ‘upper’ function (will look something like “JOSH”). The complete list of current functions available is: upper (upper-case),​ lower (lower-case),​ u2s (underscores to spaces), ucwords (upper-case first letter of each word), ucfirst (upper-case only first letter), and empty (coverts to nothing – which is sometimes useful when combined with the missing variable syntax).
developers/templates/reference.txt · Last modified: 2019/05/10 07:30 by Jaco van Wyk