cvs: smarty /docs/en/designers/language-custom-functions language-function-assign.xml language-function-counter.xml language-function-fetch.xml language-function-html-select-time.xml language-function-math.xml language-function-popup.xml language-function-textformat.xml
"Yannick Torres" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsyannick1115759677@cvsserver> |
yannick Tue May 10 17:14:37 2005 EDT
Modified files:
/smarty/docs/en/designers/language-custom-functions
language-function-assign.xml
language-function-counter.xml
language-function-fetch.xml
language-function-html-select-time.xml
language-function-math.xml
language-function-popup.xml
language-function-textformat.xml
Log:
* some wz
* no tab
* add Cdata section
# make test before commit ;)
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
yannick-20050510171437.txt
(text/plain, 31.3 KB)
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-assign.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-assign.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-assign.xml:1.1 smarty/docs/en/designers/language-custom-functions/language-function-assign.xml:1.2
--- smarty/docs/en/designers/language-custom-functions/language-function-assign.xml:1.1 Tue Apr 13 04:40:22 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-assign.xml Tue May 10 17:14:36 2005
@@ -1,56 +1,63 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="language.function.assign">
- <title>assign</title>
- <informaltable frame="all">
- <tgroup cols="5">
- <colspec colname="param" align="center" />
- <colspec colname="type" align="center" />
- <colspec colname="required" align="center" />
- <colspec colname="default" align="center" />
- <colspec colname="desc" />
- <thead>
- <row>
- <entry>Attribute Name</entry>
- <entry>Type</entry>
- <entry>Required</entry>
- <entry>Default</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>var</entry>
- <entry>string</entry>
- <entry>Yes</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>The name of the variable being assigned</entry>
- </row>
- <row>
- <entry>value</entry>
- <entry>string</entry>
- <entry>Yes</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>The value being assigned</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <para>
- assign is used for assigning template variables during the execution
- of the template.
- </para>
-<example>
-<title>assign</title>
-<programlisting>
+<!-- $Revision: 1.2 $ -->
+<sect1 id="language.function.assign">
+ <title>assign</title>
+ <informaltable frame="all">
+ <tgroup cols="5">
+ <colspec colname="param" align="center" />
+ <colspec colname="type" align="center" />
+ <colspec colname="required" align="center" />
+ <colspec colname="default" align="center" />
+ <colspec colname="desc" />
+ <thead>
+ <row>
+ <entry>Attribute Name</entry>
+ <entry>Type</entry>
+ <entry>Required</entry>
+ <entry>Default</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>var</entry>
+ <entry>string</entry>
+ <entry>Yes</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>The name of the variable being assigned</entry>
+ </row>
+ <row>
+ <entry>value</entry>
+ <entry>string</entry>
+ <entry>Yes</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>The value being assigned</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>
+ assign is used for assigning template variables during the execution
+ of the template.
+ </para>
+ <example>
+ <title>assign</title>
+ <programlisting>
+<![CDATA[
{assign var="name" value="Bob"}
The value of $name is {$name}.
-
-OUTPUT:
-
-The value of $name is Bob.</programlisting>
-</example>
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+The value of $name is Bob.
+]]>
+ </screen>
+ </example>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-counter.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-counter.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-counter.xml:1.2 smarty/docs/en/designers/language-custom-functions/language-function-counter.xml:1.3
--- smarty/docs/en/designers/language-custom-functions/language-function-counter.xml:1.2 Sat May 29 17:56:21 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-counter.xml Tue May 10 17:14:36 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 id="language.function.counter">
<title>counter</title>
<informaltable frame="all">
@@ -59,8 +59,7 @@
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
- <entry>the template variable the output will be assigned
- to</entry>
+ <entry>the template variable the output will be assigned to</entry>
</row>
</tbody>
</tgroup>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.4 smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.5
--- smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.4 Sat Nov 20 21:04:01 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml Tue May 10 17:14:36 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<sect1 id="language.function.fetch">
<title>fetch</title>
<informaltable frame="all">
@@ -82,7 +82,7 @@
{* assign the fetched contents to a template variable *}
{fetch file="http://www.myweather.com/68502/" assign="weather"}
{if $weather ne ""}
- <b>{$weather}</b>
+ <b>{$weather}</b>
{/if}
]]>
</programlisting>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml:1.3 smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml:1.4
--- smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml:1.3 Mon Nov 1 05:28:59 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml Tue May 10 17:14:36 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="language.function.html.select.time">
<title>html_select_time</title>
<informaltable frame="all">
@@ -95,7 +95,7 @@
<entry>No</entry>
<entry>null</entry>
<entry>adds extra attributes to select/input tags if
- given</entry>
+ given</entry>
</row>
<row>
<entry>hour_extra</entry>
@@ -103,7 +103,7 @@
<entry>No</entry>
<entry>null</entry>
<entry>adds extra attributes to select/input tags if
- given</entry>
+ given</entry>
</row>
<row>
<entry>minute_extra</entry>
@@ -111,7 +111,7 @@
<entry>No</entry>
<entry>null</entry>
<entry>adds extra attributes to select/input tags if
- given</entry>
+ given</entry>
</row>
<row>
<entry>second_extra</entry>
@@ -119,7 +119,7 @@
<entry>No</entry>
<entry>null</entry>
<entry>adds extra attributes to select/input tags if
- given</entry>
+ given</entry>
</row>
<row>
<entry>meridian_extra</entry>
@@ -127,7 +127,7 @@
<entry>No</entry>
<entry>null</entry>
<entry>adds extra attributes to select/input tags if
- given</entry>
+ given</entry>
</row>
</tbody>
</tgroup>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-math.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-math.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-math.xml:1.1 smarty/docs/en/designers/language-custom-functions/language-function-math.xml:1.2
--- smarty/docs/en/designers/language-custom-functions/language-function-math.xml:1.1 Tue Apr 13 04:40:22 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-math.xml Tue May 10 17:14:36 2005
@@ -1,128 +1,153 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="language.function.math">
- <title>math</title>
- <informaltable frame="all">
- <tgroup cols="5">
- <colspec colname="param" align="center" />
- <colspec colname="type" align="center" />
- <colspec colname="required" align="center" />
- <colspec colname="default" align="center" />
- <colspec colname="desc" />
- <thead>
- <row>
- <entry>Attribute Name</entry>
- <entry>Type</entry>
- <entry>Required</entry>
- <entry>Default</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>equation</entry>
- <entry>string</entry>
- <entry>Yes</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>the equation to execute</entry>
- </row>
- <row>
- <entry>format</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>the format of the result (sprintf)</entry>
- </row>
- <row>
- <entry>var</entry>
- <entry>numeric</entry>
- <entry>Yes</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>equation variable value</entry>
- </row>
- <row>
- <entry>assign</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>template variable the output will be assigned to</entry>
- </row>
- <row>
- <entry>[var ...]</entry>
- <entry>numeric</entry>
- <entry>Yes</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>equation variable value</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <para>
- math allows the template designer to do math equations in the
- template. Any numeric template variables may be used in the
- equations, and the result is printed in place of the tag. The
- variables used in the equation are passed as parameters, which can
- be template variables or static values. +, -, /, *, abs, ceil, cos,
- exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt,
- srans and tan are all valid operators. Check the PHP documentation
- for further information on these math functions.
- </para>
- <para>
- If you supply the special "assign" attribute, the output of the
- math function will be assigned to this template variable instead of
- being output to the template.
- </para>
- <note>
- <title>Technical Note</title>
- <para>
- math is an expensive function in performance due to its use of
- the php eval() function. Doing the math in PHP is much more
- efficient, so whenever possible do the math calculations in PHP
- and assign the results to the template. Definately avoid
- repetitive math function calls, like within section loops.
- </para>
- </note>
-<example>
-<title>math</title>
-<programlisting>
-{* $height=4, $width=5 *}
-
-{math equation="x + y" x=$height y=$width}
-
-OUTPUT:
-
-9
-
-
-{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
-
-{math equation="height * width / division"
- height=$row_height
- width=$row_width
- division=#col_div#}
-
-OUTPUT:
-
-100
-
-
-{* you can use parenthesis *}
-
-{math equation="(( x + y ) / z )" x=2 y=10 z=2}
-
-OUTPUT:
-
-6
-
-
-{* you can supply a format parameter in sprintf format *}
-
-{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
-
-OUTPUT:
-
-9.44</programlisting>
-</example>
+<!-- $Revision: 1.2 $ -->
+<sect1 id="language.function.math">
+ <title>math</title>
+ <informaltable frame="all">
+ <tgroup cols="5">
+ <colspec colname="param" align="center" />
+ <colspec colname="type" align="center" />
+ <colspec colname="required" align="center" />
+ <colspec colname="default" align="center" />
+ <colspec colname="desc" />
+ <thead>
+ <row>
+ <entry>Attribute Name</entry>
+ <entry>Type</entry>
+ <entry>Required</entry>
+ <entry>Default</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>equation</entry>
+ <entry>string</entry>
+ <entry>Yes</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>the equation to execute</entry>
+ </row>
+ <row>
+ <entry>format</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>the format of the result (sprintf)</entry>
+ </row>
+ <row>
+ <entry>var</entry>
+ <entry>numeric</entry>
+ <entry>Yes</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>equation variable value</entry>
+ </row>
+ <row>
+ <entry>assign</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>template variable the output will be assigned to</entry>
+ </row>
+ <row>
+ <entry>[var ...]</entry>
+ <entry>numeric</entry>
+ <entry>Yes</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>equation variable value</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>
+ math allows the template designer to do math equations in the
+ template. Any numeric template variables may be used in the
+ equations, and the result is printed in place of the tag. The
+ variables used in the equation are passed as parameters, which can
+ be template variables or static values. +, -, /, *, abs, ceil, cos,
+ exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt,
+ srans and tan are all valid operators. Check the PHP documentation
+ for further information on these math functions.
+ </para>
+ <para>
+ If you supply the special "assign" attribute, the output of the
+ math function will be assigned to this template variable instead of
+ being output to the template.
+ </para>
+ <note>
+ <title>Technical Note</title>
+ <para>
+ math is an expensive function in performance due to its use of
+ the php eval() function. Doing the math in PHP is much more
+ efficient, so whenever possible do the math calculations in PHP
+ and assign the results to the template. Definately avoid
+ repetitive math function calls, like within section loops.
+ </para>
+ </note>
+ <example>
+ <title>math</title>
+ <programlisting>
+<![CDATA[
+ {* $height=4, $width=5 *}
+
+ {math equation="x + y" x=$height y=$width}
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+ 9
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
+
+ {math equation="height * width / division"
+ height=$row_height
+ width=$row_width
+ division=#col_div#}
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+ 100
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {* you can use parenthesis *}
+
+ {math equation="(( x + y ) / z )" x=2 y=10 z=2}
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+ 6
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {* you can supply a format parameter in sprintf format *}
+
+ {math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
+ ]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+ 9.44
+]]>
+ </screen>
+ </example>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-popup.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-popup.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-popup.xml:1.3 smarty/docs/en/designers/language-custom-functions/language-function-popup.xml:1.4
--- smarty/docs/en/designers/language-custom-functions/language-function-popup.xml:1.3 Sat Nov 20 21:04:01 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-popup.xml Tue May 10 17:14:36 2005
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="language.function.popup">
- <title>popup</title>
+ <title>popup</title>
<informaltable frame="all">
<tgroup cols="5">
<colspec colname="param" align="center" />
@@ -390,9 +390,9 @@
</tbody>
</tgroup>
</informaltable>
- <para>
- popup is used to create javascript popup windows.
- </para>
+ <para>
+ popup is used to create javascript popup windows.
+ </para>
<example>
<title>popup</title>
<programlisting>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml:1.1 smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml:1.2
--- smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml:1.1 Tue Apr 13 04:40:22 2004
+++ smarty/docs/en/designers/language-custom-functions/language-function-textformat.xml Tue May 10 17:14:36 2005
@@ -1,236 +1,269 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="language.function.textformat">
- <title>textformat</title>
- <informaltable frame="all">
- <tgroup cols="5">
- <colspec colname="param" align="center" />
- <colspec colname="type" align="center" />
- <colspec colname="required" align="center" />
- <colspec colname="default" align="center" />
- <colspec colname="desc" />
- <thead>
- <row>
- <entry>Attribute Name</entry>
- <entry>Type</entry>
- <entry>Required</entry>
- <entry>Default</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>style</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>preset style</entry>
- </row>
- <row>
- <entry>indent</entry>
- <entry>number</entry>
- <entry>No</entry>
- <entry><emphasis>0</emphasis></entry>
- <entry>The number of chars to indent every line</entry>
- </row>
- <row>
- <entry>indent_first</entry>
- <entry>number</entry>
- <entry>No</entry>
- <entry><emphasis>0</emphasis></entry>
- <entry>The number of chars to indent the first line</entry>
- </row>
- <row>
- <entry>indent_char</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>(single space)</emphasis></entry>
- <entry>The character (or string of chars) to indent with</entry>
- </row>
- <row>
- <entry>wrap</entry>
- <entry>number</entry>
- <entry>No</entry>
- <entry><emphasis>80</emphasis></entry>
- <entry>How many characters to wrap each line to</entry>
- </row>
- <row>
- <entry>wrap_char</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>\n</emphasis></entry>
- <entry>The character (or string of chars) to break each
- line with</entry>
- </row>
- <row>
- <entry>wrap_cut</entry>
- <entry>boolean</entry>
- <entry>No</entry>
- <entry><emphasis>false</emphasis></entry>
- <entry>If true, wrap will break the line at the exact
- character instead of at a word boundary</entry>
- </row>
- <row>
- <entry>assign</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry><emphasis>n/a</emphasis></entry>
- <entry>the template variable the output will be assigned
- to</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <para>
- textformat is a block function used to format text. It basically
- cleans up spaces and special characters, and formats paragraphs by
- wrapping at a boundary and indenting lines.
- </para>
- <para>
- You can set the parameters explicitly, or use a preset style.
- Currently "email" is the only available style.
- </para>
-<example>
-<title>textformat</title>
-<programlisting>
-{textformat wrap=40}
-
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-
-This is bar.
-
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-
-{/textformat}
-
-OUTPUT:
-
-This is foo. This is foo. This is foo.
-This is foo. This is foo. This is foo.
-
-This is bar.
-
-bar foo bar foo foo. bar foo bar foo
-foo. bar foo bar foo foo. bar foo bar
-foo foo. bar foo bar foo foo. bar foo
-bar foo foo. bar foo bar foo foo.
-
-
-{textformat wrap=40 indent=4}
-
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-
-This is bar.
-
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-
-{/textformat}
-
-OUTPUT:
-
- This is foo. This is foo. This is
- foo. This is foo. This is foo. This
- is foo.
-
- This is bar.
-
- bar foo bar foo foo. bar foo bar foo
- foo. bar foo bar foo foo. bar foo
- bar foo foo. bar foo bar foo foo.
- bar foo bar foo foo. bar foo bar
- foo foo.
-
-{textformat wrap=40 indent=4 indent_first=4}
-
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-
-This is bar.
-
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-
-{/textformat}
-
-OUTPUT:
-
- This is foo. This is foo. This
- is foo. This is foo. This is foo.
- This is foo.
-
- This is bar.
-
- bar foo bar foo foo. bar foo bar
- foo foo. bar foo bar foo foo. bar
- foo bar foo foo. bar foo bar foo
- foo. bar foo bar foo foo. bar foo
- bar foo foo.
-
-{textformat style="email"}
-
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-This is foo.
-
-This is bar.
-
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-bar foo bar foo foo.
-
-{/textformat}
-
-OUTPUT:
-
-This is foo. This is foo. This is foo. This is foo. This is foo. This is
-foo.
-
-This is bar.
-
-bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
-bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
-foo.
-
-</programlisting>
-</example>
+<!-- $Revision: 1.2 $ -->
+<sect1 id="language.function.textformat">
+ <title>textformat</title>
+ <informaltable frame="all">
+ <tgroup cols="5">
+ <colspec colname="param" align="center" />
+ <colspec colname="type" align="center" />
+ <colspec colname="required" align="center" />
+ <colspec colname="default" align="center" />
+ <colspec colname="desc" />
+ <thead>
+ <row>
+ <entry>Attribute Name</entry>
+ <entry>Type</entry>
+ <entry>Required</entry>
+ <entry>Default</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>style</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>preset style</entry>
+ </row>
+ <row>
+ <entry>indent</entry>
+ <entry>number</entry>
+ <entry>No</entry>
+ <entry><emphasis>0</emphasis></entry>
+ <entry>The number of chars to indent every line</entry>
+ </row>
+ <row>
+ <entry>indent_first</entry>
+ <entry>number</entry>
+ <entry>No</entry>
+ <entry><emphasis>0</emphasis></entry>
+ <entry>The number of chars to indent the first line</entry>
+ </row>
+ <row>
+ <entry>indent_char</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>(single space)</emphasis></entry>
+ <entry>The character (or string of chars) to indent with</entry>
+ </row>
+ <row>
+ <entry>wrap</entry>
+ <entry>number</entry>
+ <entry>No</entry>
+ <entry><emphasis>80</emphasis></entry>
+ <entry>How many characters to wrap each line to</entry>
+ </row>
+ <row>
+ <entry>wrap_char</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>\n</emphasis></entry>
+ <entry>The character (or string of chars) to break each
+ line with</entry>
+ </row>
+ <row>
+ <entry>wrap_cut</entry>
+ <entry>boolean</entry>
+ <entry>No</entry>
+ <entry><emphasis>false</emphasis></entry>
+ <entry>If true, wrap will break the line at the exact
+ character instead of at a word boundary</entry>
+ </row>
+ <row>
+ <entry>assign</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry><emphasis>n/a</emphasis></entry>
+ <entry>the template variable the output will be assigned
+ to</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>
+ textformat is a block function used to format text. It basically
+ cleans up spaces and special characters, and formats paragraphs by
+ wrapping at a boundary and indenting lines.
+ </para>
+ <para>
+ You can set the parameters explicitly, or use a preset style.
+ Currently "email" is the only available style.
+ </para>
+ <example>
+ <title>textformat</title>
+ <programlisting>
+<![CDATA[
+ {textformat wrap=40}
+
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+
+ {/textformat}
+
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+ This is foo. This is foo. This is foo.
+ This is foo. This is foo. This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo. bar foo bar foo
+ foo. bar foo bar foo foo. bar foo bar
+ foo foo. bar foo bar foo foo. bar foo
+ bar foo foo. bar foo bar foo foo.
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {textformat wrap=40 indent=4}
+
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+
+ {/textformat}
+
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+ This is foo. This is foo. This is
+ foo. This is foo. This is foo. This
+ is foo.
+
+ This is bar.
+
+ bar foo bar foo foo. bar foo bar foo
+ foo. bar foo bar foo foo. bar foo
+ bar foo foo. bar foo bar foo foo.
+ bar foo bar foo foo. bar foo bar
+ foo foo.
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {textformat wrap=40 indent=4 indent_first=4}
+
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+
+ {/textformat}
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+ This is foo. This is foo. This
+ is foo. This is foo. This is foo.
+ This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo. bar foo bar
+ foo foo. bar foo bar foo foo. bar
+ foo bar foo foo. bar foo bar foo
+ foo. bar foo bar foo foo. bar foo
+ bar foo foo.
+]]>
+ </screen>
+ <programlisting>
+<![CDATA[
+ {textformat style="email"}
+
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+ This is foo.
+
+ This is bar.
+
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+ bar foo bar foo foo.
+
+ {/textformat}
+
+]]>
+ </programlisting>
+ <para>
+ The above example will output:
+ </para>
+ <screen>
+<![CDATA[
+
+ This is foo. This is foo. This is foo. This is foo. This is foo. This is
+ foo.
+
+ This is bar.
+
+ bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
+ bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
+ foo.
+
+]]>
+ </screen>
+ </example>
</sect1>
<!-- Keep this comment at the end of the file
Local variables: