| 1 | <h2>Comments</h2> |
| 2 | <pre><code>## Single line comment |
| 3 | #* Multi-line |
| 4 | comment *#</code></pre> |
| 5 | |
| 6 | <h2>Unparsed sections</h2> |
| 7 | <pre><code>## Section below is not parsed |
| 8 | #[[ |
| 9 | ## This is not a comment |
| 10 | ]]#</code></pre> |
| 11 | |
| 12 | <h2>Variables</h2> |
| 13 | <pre><code>$mud |
| 14 | $customer.Name |
| 15 | $flogger.getPromo( $mud ) |
| 16 | $!{mudSlinger_9} |
| 17 | $foo[0] |
| 18 | $foo[$i] |
| 19 | $foo["bar"] |
| 20 | $foo.bar[1].junk |
| 21 | $foo.callMethod()[1]</code></pre> |
| 22 | |
| 23 | <h2>Directives</h2> |
| 24 | <pre><code>#set($foo.bar[1] = 3) |
| 25 | #if($a==1)true enough#{else}no way!#end |
| 26 | #macro( d ) |
| 27 | <tr><td>$!bodyContent</td></tr> |
| 28 | #end |
| 29 | #@d()Hello!#end</code></pre> |
| 30 | |
| 31 | <h2>Integration with HTML</h2> |
| 32 | <pre><code><html> |
| 33 | <body> |
| 34 | Hello $customer.Name! |
| 35 | <table> |
| 36 | #foreach( $mud in $mudsOnSpecial ) |
| 37 | #if ( $customer.hasPurchased($mud) ) |
| 38 | <tr> |
| 39 | <td> |
| 40 | $flogger.getPromo( $mud ) |
| 41 | </td> |
| 42 | </tr> |
| 43 | #end |
| 44 | #end |
| 45 | </table> |
| 46 | </body> |
| 47 | </html></code></pre> |