From b2f2e61be4f2ede4ddaa273b318d9793446b490c Mon Sep 17 00:00:00 2001 From: bzick Date: Thu, 21 Feb 2013 22:47:24 +0400 Subject: [PATCH] Update doc --- docs/main.md | 2 +- docs/operators.md | 26 ++++++++++++++++++++++++++ docs/syntax.md | 6 +++--- docs/tags/extends.md | 6 ------ docs/tags/import.md | 9 ++++++++- docs/tags/macro.md | 20 ++++++++++++++++++++ docs/tags/macros.md | 15 --------------- 7 files changed, 58 insertions(+), 26 deletions(-) create mode 100644 docs/operators.md create mode 100644 docs/tags/macro.md delete mode 100644 docs/tags/macros.md diff --git a/docs/main.md b/docs/main.md index 4239589..6f10f06 100644 --- a/docs/main.md +++ b/docs/main.md @@ -41,7 +41,7 @@ Conversation about [tags](./syntax.md#tags) * [capture](./tags/capture.md) * [filter](./tags/filter.md) * [ignore](./tags/ignore.md) -* [macros](./tags/macros.md) +* [macro](./tags/macro.md) * [import](./tags/import.md) **Extends** diff --git a/docs/operators.md b/docs/operators.md new file mode 100644 index 0000000..3938176 --- /dev/null +++ b/docs/operators.md @@ -0,0 +1,26 @@ +Operators +========= + +Math + +`+ - / *` + +Bitwize + +`| & <<` + +Unary + +`^ ~ - !` + +Boolean + +`|| && and or < > <= >= == === !== != ≥ ≤ ≠` + +Ternar + +`? :` + +Test + +`is in like` \ No newline at end of file diff --git a/docs/syntax.md b/docs/syntax.md index 59ea4e8..dc45be3 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -234,9 +234,9 @@ ```smarty {include 'control.tpl' - options=$list - name=$cp.name - type='select' + options = $list + name = $cp.name + type = 'select' } {foreach [ diff --git a/docs/tags/extends.md b/docs/tags/extends.md index 316dc52..11d4397 100644 --- a/docs/tags/extends.md +++ b/docs/tags/extends.md @@ -13,12 +13,6 @@ Tag {extends} {extends $parent_tpl} ``` -```smarty -{if $theme?} - {extends $theme.template} -{/if} -``` - ### {block} ```smarty diff --git a/docs/tags/import.md b/docs/tags/import.md index 4104a35..8d9488f 100644 --- a/docs/tags/import.md +++ b/docs/tags/import.md @@ -3,4 +3,11 @@ Tag {import} ```smarty {import 'page.macros.tpl'} -``` \ No newline at end of file +``` + +```smarty +{import 'listing.tpl' as listing} +... +{listing.paginator current=5 count=100} +``` + diff --git a/docs/tags/macro.md b/docs/tags/macro.md new file mode 100644 index 0000000..97320f8 --- /dev/null +++ b/docs/tags/macro.md @@ -0,0 +1,20 @@ +Tag {macro} +============ + +Declare + +```smarty +declare macros + +{macro paginator(current, total, skip=true)} + ... paginator code ... +{/macro} +``` + +Invoke + +```smarty +{paginator current=$page total=100} +``` + +Use tag [{import}](./import.md) for extending macros for another templates. \ No newline at end of file diff --git a/docs/tags/macros.md b/docs/tags/macros.md deleted file mode 100644 index 8a4fc3a..0000000 --- a/docs/tags/macros.md +++ /dev/null @@ -1,15 +0,0 @@ -Tag {macros} -============ - - -```smarty -declare macros - -{macros.paginator(current, total, skip=true)} - ... paginator code ... -{/macros} -... -invoke macros - -{macros.paginator current=$page total=100} -``` \ No newline at end of file