From: Andrey Kutejko Date: Sun, 16 Jun 2013 18:58:20 +0000 (+0300) Subject: style doc X-Git-Tag: 0.5~234 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=d52dfb88618aca8321460a76fdc837d5c9886a6a;p=ipf.git style doc --- diff --git a/doc/template.org b/doc/template.org index 3171e2f..796ba82 100644 --- a/doc/template.org +++ b/doc/template.org @@ -6,24 +6,24 @@ Outputs expression. *** {if } | {elseif } | {else} | {/if} - + *** {while } | {/while} *** {foreach as [ =>] } | {/foreach} Iterate over collection. Following variables are defined inside a loop: - foreach_counter0 -- zero based iteration counter - foreach_counter1 -- unit based iteration counter - foreach_first -- is true on first iteration and false on the rest ones. + + =foreach_counter0= -- zero based iteration counter + + =foreach_counter1= -- unit based iteration counter + + =foreach_first= -- is true on first iteration and false on the rest ones. *** {assign } - Example: {assing $v += 1} + Example: ={assing $v += 1}= *** {literal} | {/literal} Literally output enclosed text. Mostly used to wrap inlined JavaScript. *** {include ""} - Include another template. Example: {include "pagination.html"} + Include another template. Example: ={include "pagination.html"}= *** {block } | {superblock} | {/block} @@ -47,47 +47,43 @@ Modifier is a transformation applied to a printed value. Some modifiers have one or more parameters. - { [|[:]]*} + ={ [|[:]]*}= - Where is a comma-separated list of parameters. + Where == is a comma-separated list of parameters. - Examples: {$content|safe}, {$content|strip_tags|limit_words:10} + Examples: ={$content|safe}=, ={$content|strip_tags|limit_words:10}= *** Predefined modifiers - upper - lower - capitalize - trim + + =upper= + + =lower= + + =capitalize= + + =trim= - limit_words:, -- Limits text to specified number of words (default is 100). Text is terminted by string (default is ellipsis character). + + =limit_words:,= -- Limits text to specified number of words (default is 100). Text is terminted by string (default is ellipsis character). - date: -- format date. Default format is '%b %e, %Y' - time: -- format date and time. Default format is 'Y-m-d H:i:s' + + =date:= -- format date. Default format is '%b %e, %Y' + + =time:= -- format date and time. Default format is 'Y-m-d H:i:s' - floatformat:, -- format float value. Default parameters are 2, '.', ','. + + =floatformat:,= -- format float value. Default parameters are 2, '.', ','. - count -- number of elements in collection + + =count= -- number of elements in collection - escxml -- escape XM - escape -- escape HTML - escurl -- escape URL - strip_tags -- remove all tags - nl2br -- replaces all new line characters with '
' tags - unsafe, safe -- outputs text unescaped + + =escxml= -- escape XM + + =escape= -- escape HTML + + =escurl= -- escape URL + + =strip_tags= -- remove all tags + + =nl2br= -- replaces all new line characters with '
' tags + + =unsafe=, =safe= -- outputs text unescaped - debug -- print_r - fulldebug -- var_export + + =debug= -- print_r + + =fulldebug= -- var_export ** Configuration - template_tags -- additional template tags - - template_modifiers -- additional template modifiers - - template_context_processors -- list of context processors - - template_dirs -- list of directories to look for template files. By default it contains 'templates' folder in project directory and 'templates' folder in IPF_Admin application (when it is enabled). - - debug -- forces to recompile template before each rendering + + =template_tags= -- additional template tags + + =template_modifiers= -- additional template modifiers + + =template_context_processors= -- list of context processors + + =template_dirs= -- list of directories to look for template files. By default it contains 'templates' folder in project directory and 'templates' folder in IPF_Admin application (when it is enabled). + + =debug= -- forces to recompile template before each rendering