From b3eefa0f77ae0fc2811afc104f13aef9a10a5b76 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 16 Jun 2013 22:44:04 +0300 Subject: [PATCH] experiments with document styles --- doc/template.org | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/doc/template.org b/doc/template.org index a2bf193..5463a93 100644 --- a/doc/template.org +++ b/doc/template.org @@ -1,48 +1,51 @@ -#+TITLE: Template +* Template -* Tags +** Tags -** {[modifiers]} +*** Print + Syntax: ={[modifiers]}= Outputs expression. -** {if } | {elseif } | {else} | {/if} - -** {while } | {/while} +*** if/elseif/else + Syntax: ={if }= [ ={elseif }= ]* [ ={else}= ] ={/if}= -** {foreach as [ =>] } | {/foreach} +*** while + Syntax: ={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. -** {assign } +*** {assign } Example: ~{assing $v += 1}~ -** {literal} | {/literal} +*** {literal} | {/literal} Literally output enclosed text. Mostly used to wrap inlined JavaScript. -** {include ""} +*** {include ""} Include another template. Example: ={include "pagination.html"}= -** {block } | {superblock} | {/block} +*** {block } | {superblock} | {/block} -** {ldelim} | {rdelim} +*** {ldelim} | {rdelim} Output '{' and '}'. -* Unknown Tags +** Unknown Tags -** {trans} | {plural} | {blocktrans} | {/blocktrans} +*** {trans} | {plural} | {blocktrans} | {/blocktrans} -* Predefined custom tags +** Predefined custom tags -** {url ''[, array(, ...)]} +*** {url ''[, array(, ...)]} Reverse url -** {sql} +*** {sql} Prints SQL statistics. -* Modifiers +** Modifiers Modifier is a transformation applied to a printed value. Some modifiers have one or more parameters. @@ -53,7 +56,7 @@ Examples: ={$content|safe}=, ={$content|strip_tags|limit_words:10}= -** Predefined modifiers +*** Predefined modifiers + =upper= + =lower= @@ -79,7 +82,7 @@ + =debug= -- print_r + =fulldebug= -- var_export -* Configuration +** Configuration + =template_tags= -- additional template tags + =template_modifiers= -- additional template modifiers -- 2.49.0