| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:37:06 2008 ] | [ TextilePHP 2.0.8 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3 <title>TextilePHP: Main Page</title> 4 <link href="doxygen.css" rel="stylesheet" type="text/css"> 5 </head><body> 6 <!-- Generated by Doxygen 1.3.7 --> 7 <div class="qindex"><a class="qindexHL" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a></div> 8 <h1>TextilePHP Documentation</h1> 9 <p> 10 <h3 align="center">$Id: index.html,v 1.12 2005/03/21 14:38:53 jhriggs Exp $ </h3><a class="el" href="classTextile.html">Textile</a> - A Humane Web Text Generator.<h2><a class="anchor" name="synopsis"> 11 SYNOPSIS</a></h2> 12 <pre><code> 13 include_once("Textile.php"); 14 $text = <<<EOT 15 h1. Heading</code></pre><p> 16 <pre><code> A _simple_ demonstration of <a class="el" href="classTextile.html">Textile</a> markup.</code></pre><p> 17 <pre><code> * One 18 * Two 19 * Three</code></pre><p> 20 <pre><code> "More information":<a href="http://www.textism.com/tools/textile">http://www.textism.com/tools/textile</a> is available. 21 EOT;</code></pre><p> 22 <pre><code> $textile = new <a class="el" href="classTextile.html">Textile</a>; 23 $html = $textile->process($text); 24 print $html; 25 </code></pre><h2><a class="anchor" name="abstract"> 26 ABSTRACT</a></h2> 27 <a class="el" href="Textile_8php.html">Textile.php</a> is a PHP-based implementation of Dean Allen's <a class="el" href="classTextile.html">Textile</a> syntax. <a class="el" href="classTextile.html">Textile</a> is shorthand for doing common formatting tasks.<h2><a class="anchor" name="syntax"> 28 SYNTAX</a></h2> 29 <a class="el" href="classTextile.html">Textile</a> processes text in units of blocks and lines. A block might also be considered a paragraph, since blocks are separated from one another by a blank line. Blocks can begin with a signature that helps identify the rest of the block content. Block signatures include:<p> 30 <ul> 31 <li> 32 <b>p</b><p> 33 A paragraph block. This is the default signature if no signature is explicitly given. Paragraphs are formatted with all the inline rules (see inline formatting) and each line receives the appropriate markup rules for the flavor of HTML in use. For example, newlines for XHTML content receive a <br /> tag at the end of the line (with the exception of the last line in the paragraph). Paragraph blocks are enclosed in a <p> tag.<p> 34 </li> 35 <li> 36 <b>pre</b><p> 37 A pre-formatted block of text. <a class="el" href="classTextile.html">Textile</a> will not add any HTML tags for individual lines. Whitespace is also preserved.<p> 38 Note that within a "pre" block, < and > are translated into HTML entities automatically.<p> 39 </li> 40 <li> 41 <b>bc</b><p> 42 A "bc" signature is short for "block code", which implies a preformatted section like the 'pre' block, but it also gets a <code> tag (or for XHTML 2, a <blockcode> tag is used instead).<p> 43 Note that within a "bc" block, < and > are translated into HTML entities automatically.<p> 44 </li> 45 <li> 46 <b>table</b><p> 47 For composing HTML tables. See the "TABLES" section for more information.<p> 48 </li> 49 <li> 50 <b>bq</b><p> 51 A "bq" signature is short for "block quote". Paragraph text formatting is applied to these blocks and they are enclosed in a <blockquote> tag as well as <p> tags within.<p> 52 </li> 53 <li> 54 <b>h1, h2, h3, h4, h5, h6</b><p> 55 Headline signatures that produce <h1>, etc. tags. You can adjust the relative output of these using the head_offset attribute.<p> 56 </li> 57 <li> 58 <b>clear</b><p> 59 A 'clear' signature is simply used to indicate that the next block should emit a CSS style attribute that clears any floating elements. The default behavior is to clear "both", but you can use the left (< or right >) alignment characters to indicate which side to clear.<p> 60 </li> 61 <li> 62 <b>dl</b><p> 63 A "dl" signature is short for "definition list". See the "LISTS" section for more information.<p> 64 </li> 65 <li> 66 <b>fn</b><p> 67 A "fn" signature is short for "footnote". You add a number following the "fn" keyword to number the footnote. Footnotes are output as paragraph tags but are given a special CSS class name which can be used to style them as you see fit.<p> 68 </li> 69 </ul> 70 <p> 71 All signatures should end with a period and be followed with a space. Inbetween the signature and the period, you may use several parameters to further customize the block. These include:<p> 72 <ul> 73 <li> 74 <b><code>{style rule}</code></b><p> 75 A CSS style rule. Style rules can span multiple lines.<p> 76 </li> 77 <li> 78 <b><code>[ll]</code></b><p> 79 A language identifier (for a "lang" attribute).<p> 80 </li> 81 <li> 82 <b><code>(class)</code> or <code>(#id)</code> or <code>(class#id)</code></b><p> 83 For CSS class and id attributes.<p> 84 </li> 85 <li> 86 <b><code>></code>, <code><</code>, <code>=</code>, <code><></code></b><p> 87 Modifier characters for alignment. Right-justification, left-justification, centered, and full-justification.<p> 88 </li> 89 <li> 90 <b><code>(</code> (one or more)</b><p> 91 Adds padding on the left. 1em per "(" character is applied. When combined with the align-left or align-right modifier, it makes the block float.<p> 92 </li> 93 <li> 94 <b><code>)</code> (one or more)</b><p> 95 Adds padding on the right. 1em per ")" character is applied. When combined with the align-left or align-right modifier, it makes the block float.<p> 96 </li> 97 <li> 98 <b><code>|filter|</code> or <code>|filter|filter|filter|</code></b><p> 99 A filter may be invoked to further format the text for this signature. If one or more filters are identified, the text will be processed first using the filters and then by Textile's own block formatting rules.<p> 100 </li> 101 </ul> 102 <h3><a class="anchor" name="extendedblocks"> 103 Extended Blocks</a></h3> 104 Normally, a block ends with the first blank line encountered. However, there are situations where you may want a block to continue for multiple paragraphs of text. To cause a given block signature to stay active, use two periods in your signature instead of one. This will tell <a class="el" href="classTextile.html">Textile</a> to keep processing using that signature until it hits the next signature is found.<p> 105 For example: <pre> 106 bq.. This is paragraph one of a block quote.</pre><p> 107 <pre> This is paragraph two of a block quote.</pre><p> 108 <pre> p. Now we're back to a regular paragraph. 109 </pre> You can apply this technique to any signature (although for some it doesn't make sense, like "h1" for example). This is especially useful for "bc" blocks where your code may have many blank lines scattered through it.<h3><a class="anchor" name="escaping"> 110 Escaping</a></h3> 111 Sometimes you want <a class="el" href="classTextile.html">Textile</a> to just get out of the way and let you put some regular HTML markup in your document. You can disable <a class="el" href="classTextile.html">Textile</a> formatting for a given block using the '==' escape mechanism: <pre> 112 p. Regular paragraph</pre><p> 113 <pre> == 114 Escaped portion -- will not be formatted 115 by <a class="el" href="classTextile.html">Textile</a> at all 116 ==</pre><p> 117 <pre> p. Back to normal. 118 </pre> You can also use this technique within a <a class="el" href="classTextile.html">Textile</a> block, temporarily disabling the inline formatting functions: <pre> 119 p. This is ==*a test*== of escaping. 120 </pre> <h3><a class="anchor" name="inlineformatting"> 121 Inline Formatting</a></h3> 122 Formatting within a block of text is covered by the "inline" formatting rules. These operators must be placed up against text/punctuation to be recognized. These include:<p> 123 <ul> 124 <li> 125 <b><code>*strong*</code></b><p> 126 Translates into <strong>strong</strong>.<p> 127 </li> 128 <li> 129 <b>_emphasis_</b><p> 130 Translates into <em>emphasis</em>.<p> 131 </li> 132 <li> 133 <b><code>**bold**</code></b><p> 134 Translates into <b>bold</b>.<p> 135 </li> 136 <li> 137 <b><code>__italics__</code></b><p> 138 Translates into <i>italics</i>.<p> 139 </li> 140 <li> 141 <b><code>++bigger++</code></b><p> 142 Translates into <big>bigger</big>.<p> 143 </li> 144 <li> 145 <b><code>--smaller--</code></b><p> 146 Translates into: <small>smaller</small>.<p> 147 </li> 148 <li> 149 <b><code>-deleted text-</code></b><p> 150 Translates into <del>deleted text</del>.<p> 151 </li> 152 <li> 153 <b><code>+inserted text+</code></b><p> 154 Translates into <ins>inserted text</ins>.<p> 155 </li> 156 <li> 157 <b><code>^superscript^</code></b><p> 158 Translates into <sup>superscript</sup>.<p> 159 </li> 160 <li> 161 <b><code>~subscript~</code></b><p> 162 Translates into <sub>subscript</sub>.<p> 163 </li> 164 <li> 165 <b><code>%span%</code></b><p> 166 Translates into <span>span</span>.<p> 167 </li> 168 <li> 169 <b><code>@code@</code></b><p> 170 Translates into <code>code</code>. Note that within a '@...@' section, < and > are translated into HTML entities automatically.<p> 171 </li> 172 </ul> 173 <p> 174 Inline formatting operators accept the following modifiers:<p> 175 <ul> 176 <li> 177 <b><code>{style rule}</code></b><p> 178 A CSS style rule.<p> 179 </li> 180 <li> 181 <b><code>[ll]</code></b><p> 182 A language identifier (for a "lang" attribute).<p> 183 </li> 184 <li> 185 <b><code>(class)</code> or <code>(#id)</code> or <code>(class#id)</code></b><p> 186 For CSS class and id attributes.<p> 187 </li> 188 </ul> 189 <h4><a class="anchor" name="examples"> 190 Examples</a></h4> 191 <pre> 192 <a class="el" href="classTextile.html">Textile</a> is *way* cool.</pre><p> 193 <pre> <a class="el" href="classTextile.html">Textile</a> is *_way_* cool. 194 </pre> Now this won't work, because the formatting characters need whitespace before and after to be properly recognized. <pre> 195 <a class="el" href="classTextile.html">Textile</a> is way c*oo*l. 196 </pre> However, you can supply braces or brackets to further clarify that you want to format, so this would work: <pre> 197 <a class="el" href="classTextile.html">Textile</a> is way c[*oo*]l. 198 </pre> <h3><a class="anchor" name="footnotes"> 199 Footnotes</a></h3> 200 You can create footnotes like this: <pre> 201 And then he went on a long trip[1]. 202 </pre> By specifying the brackets with a number inside, <a class="el" href="classTextile.html">Textile</a> will recognize that as a footnote marker. It will replace that with a construct like this: <pre> 203 And then he went on a long 204 trip<sup class="footnote"><a href="#fn1">1</a></sup> 205 </pre> To supply the content of the footnote, place it at the end of your document using a "fn" block signature: <pre> 206 fn1. And there was much rejoicing. 207 </pre> Which creates a paragraph that looks like this: <pre> 208 </pre><p> 209 <pre><sup>1</sup> And there was 210 much rejoicing. 211 </pre> <h3><a class="anchor" name="links"> 212 Links</a></h3> 213 <a class="el" href="classTextile.html">Textile</a> defines a shorthand for formatting hyperlinks. The format looks like this: <pre> 214 "Text to display":<a href="http://example.com">http://example.com</a> 215 </pre> In addition to this, you can add 'title' text to your link: <pre> 216 "Text to display (Title text)":<a href="http://example.com">http://example.com</a> 217 </pre> The URL portion of the link supports relative paths as well as other protocols like ftp, mailto, news, telnet, etc. <pre> 218 "E-mail me please":mailto:someone@example.com 219 </pre> You can also use single quotes instead of double-quotes if you prefer. As with the inline formatting rules, a hyperlink must be surrounded by whitespace to be recognized (an exception to this is common punctuation which can reside at the end of the URL). If you have to place a URL next to some other text, use the bracket or brace trick to do that: <pre> 220 You["gotta":<a href="http://example.com">http://example.com</a>]seethis! 221 </pre> <a class="el" href="classTextile.html">Textile</a> supports an alternate way to compose links. You can optionally create a lookup list of links and refer to them separately. To do this, place one or more links in a block of it's own (it can be anywhere within your document): <pre> 222 [excom]<a href="http://example.com">http://example.com</a> 223 [exorg]<a href="http://example.org">http://example.org</a> 224 </pre> For a list like this, the text in the square brackets is used to uniquely identify the link given. To refer to that link, you would specify it like this: <pre> 225 "Text to display":excom 226 </pre> Once you've defined your link lookup table, you can use the identifiers any number of times.<h3><a class="anchor" name="images"> 227 Images</a></h3> 228 Images are identified by the following pattern: <pre> 229 !/path/to/image! 230 </pre> Image attributes may also be specified: <pre> 231 !/path/to/image 10x20! 232 </pre> Which will render an image 10 pixels wide and 20 pixels high. Another way to indicate width and height: <pre> 233 !/path/to/image 10w 20h! 234 </pre> You may also redimension the image using a percentage. <pre> 235 !/path/to/image 20%x40%! 236 </pre> Which will render the image at 20% of it's regular width and 40% of it's regular height.<p> 237 Or specify one percentage to resize proprotionately: <pre> 238 !/path/to/image 20%! 239 </pre> Alt text can be given as well: <pre> 240 !/path/to/image (Alt text)! 241 </pre> The path of the image may refer to a locally hosted image or can be a full URL.<p> 242 You can also use the following modifiers after the opening '!' character:<p> 243 <ul> 244 <li> 245 <b><code><</code></b><p> 246 Align the image to the left (causes the image to float if CSS options are enabled).<p> 247 </li> 248 <li> 249 <b><code>></code></b><p> 250 Align the image to the right (causes the image to float if CSS options are enabled).<p> 251 </li> 252 <li> 253 <b><code>-</code> (dash)</b><p> 254 Aligns the image to the middle.<p> 255 </li> 256 <li> 257 <b><code>^</code></b><p> 258 Aligns the image to the top.<p> 259 </li> 260 <li> 261 <b><code>~</code> (tilde)</b><p> 262 Aligns the image to the bottom.<p> 263 </li> 264 <li> 265 <b><code>{style rule}</code></b><p> 266 Applies a CSS style rule to the image.<p> 267 </li> 268 <li> 269 <b><code>(class)</code> or <code>(#id)</code> or <code>(class#id)</code></b><p> 270 Applies a CSS class and/or id to the image.<p> 271 </li> 272 <li> 273 <b><code>(</code> (one or more)</b><p> 274 Pads 1em on the left for each '(' character.<p> 275 </li> 276 <li> 277 <b><code>)</code> (one or more)</b><p> 278 Pads 1em on the right for each ')' character.<p> 279 </li> 280 </ul> 281 <h3><a class="anchor" name="characterreplacements"> 282 Character Replacements</a></h3> 283 A few simple, common symbols are automatically replaced: <pre> 284 (c) 285 (r) 286 (tm) 287 </pre> In addition to these, there are a whole set of character macros that are defined by default. All macros are enclosed in curly braces. These include: <pre> 288 {c|} or {|c} cent sign 289 {L-} or {-L} pound sign 290 {Y=} or {=Y} yen sign 291 </pre> Many of these macros can be guessed. For example: <pre> 292 {A'} or {'A} 293 {a"} or {"a} 294 {1/4} 295 {*} 296 {:)} 297 {:(} 298 </pre> <h3><a class="anchor" name="lists"> 299 Lists</a></h3> 300 <a class="el" href="classTextile.html">Textile</a> also supports ordered and unordered lists. You simply place an asterisk or pound sign, followed with a space at the start of your lines.<p> 301 Simple lists: <pre> 302 * one 303 * two 304 * three 305 </pre> Multi-level lists: <pre> 306 * one 307 ** one A 308 ** one B 309 *** one B1 310 * two 311 ** two A 312 ** two B 313 * three 314 </pre> Ordered lists: <pre> 315 # one 316 # two 317 # three 318 </pre> Styling lists: <pre> 319 (class#id)* one 320 * two 321 * three 322 </pre> The above sets the class and id attributes for the <ul> tag. <pre> 323 *(class#id) one 324 * two 325 * three 326 </pre> The above sets the class and id attributes for the first <li> tag.<p> 327 Definition lists: <pre> 328 dl. textile:a cloth, especially one manufactured by weaving 329 or knitting; a fabric 330 format:the arrangement of data for storage or display. 331 </pre> Note that there is no space between the term and definition. The term must be at the start of the line (or following the "dl" signature as shown above).<h3><a class="anchor" name="tables"> 332 Tables</a></h3> 333 <a class="el" href="classTextile.html">Textile</a> supports tables. Tables must be in their own block and must have pipe characters delimiting the columns. An optional block signature of "table" may be used, usually for applying style, class, id or other options to the table element itself.<p> 334 From the simple: <pre> 335 |a|b|c| 336 |1|2|3| 337 </pre> To the complex: <pre> 338 table(fig). {color:red}_|Top|Row| 339 {color:blue}|/2. Second|Row| 340 |_{color:green}. Last| 341 </pre> Modifiers can be specified for the table signature itself, for a table row (prior to the first '|' character) and for any cell (following the '|' for that cell). Note that for cells, a period followed with a space must be placed after any modifiers to distinguish the modifier from the cell content.<p> 342 Modifiers allowed are:<p> 343 <ul> 344 <li> 345 <b><code>{style rule}</code></b><p> 346 A CSS style rule.<p> 347 </li> 348 <li> 349 <b><code>(class)</code> or <code>(#id)</code> or <code>(class#id)</code></b><p> 350 A CSS class and/or id attribute.<p> 351 </li> 352 <li> 353 <b><code>(</code> (one or more)</b><p> 354 Adds 1em of padding to the left for each '(' character.<p> 355 </li> 356 <li> 357 <b><code>)</code> (one or more)</b><p> 358 Adds 1em of padding to the right for each ')' character.<p> 359 </li> 360 <li> 361 <b><code><</code></b><p> 362 Aligns to the left (floats to left for tables if combined with the ')' modifier).<p> 363 </li> 364 <li> 365 <b><code>></code></b><p> 366 Aligns to the right (floats to right for tables if combined with the '(' modifier).<p> 367 </li> 368 <li> 369 <b><code>=</code></b><p> 370 Aligns to center (sets left, right margins to 'auto' for tables).<p> 371 </li> 372 <li> 373 <b><code><></code></b><p> 374 For cells only. Justifies text.<p> 375 </li> 376 <li> 377 <b><code>^</code></b><p> 378 For rows and cells only. Aligns to the top.<p> 379 </li> 380 <li> 381 <b><code>~</code> (tilde)</b><p> 382 For rows and cells only. Aligns to the bottom.<p> 383 </li> 384 <li> 385 <b><code>_</code> (underscore)</b><p> 386 Can be applied to a table row or cell to indicate a header row or cell.<p> 387 </li> 388 <li> 389 <b><code>\2</code> or <code>\3</code> or <code>\4</code>, etc.</b><p> 390 Used within cells to indicate a colspan of 2, 3, 4, etc. columns. When you see "\\", think "push forward".<p> 391 </li> 392 <li> 393 <b><code>/2</code> or <code>/3</code> or <code>/4</code>, etc.</b><p> 394 Used within cells to indicate a rowspan of 2, 3, 4, etc. rows. When you see "/", think "push downward".<p> 395 </li> 396 </ul> 397 <p> 398 When a cell is identified as a header cell and an alignment is specified, that becomes the default alignment for cells below it. You can always override this behavior by specifying an alignment for one of the lower cells.<h3><a class="anchor" name="cssnotes"> 399 CSS Notes</a></h3> 400 When CSS is enabled (and it is by default), CSS class names are automatically applied in certain situations.<p> 401 <ul> 402 <li> 403 Aligning a block or span or other element to left, right, etc.<p> 404 "left" for left justified, "right" for right justified, "center" for centered text, "justify" for full-justified text.<p> 405 </li> 406 <li> 407 Aligning an image to the top or bottom<p> 408 "top" for top alignment, "bottom" for bottom alignment, "middle" for middle alignment.<p> 409 </li> 410 <li> 411 Footnotes<p> 412 "footnote" is applied to the paragraph tag for the footnote text itself. An id of "fn" plus the footnote number is placed on the paragraph for the footnote as well. For the footnote superscript tag, a class of "footnote" is used.<p> 413 </li> 414 <li> 415 Capped text<p> 416 For a series of characters that are uppercased, a span is placed around them with a class of "caps".<p> 417 </li> 418 </ul> 419 <h3><a class="anchor" name="miscellaneous"> 420 Miscellaneous</a></h3> 421 <a class="el" href="classTextile.html">Textile</a> tries to do it's very best to ensure proper XHTML syntax. It will even attempt to fix errors you may introduce writing in HTML yourself. Unescaped '&' characters within URLs will be properly escaped. Singlet tags such as br, img and hr are checked for the '/' terminator (and it's added if necessary). The best way to make sure you produce valid XHTML with <a class="el" href="classTextile.html">Textile</a> is to not use any HTML markup at all-- use the <a class="el" href="classTextile.html">Textile</a> syntax and let it produce the markup for you.<h2><a class="anchor" name="license"> 422 LICENSE</a></h2> 423 Text::Textile is licensed under the same terms as Perl itself. <a class="el" href="Textile_8php.html">Textile.php</a> is licensed under the terms of the GNU General Public License.<h2><a class="anchor" name="authorandcopyright"> 424 AUTHOR & COPYRIGHT</a></h2> 425 Text::Textile was written by Brad Choate, <brad at bradchoate dot com>. It is an adaptation of <a class="el" href="classTextile.html">Textile</a>, developed by Dean Allen of Textism.com.<p> 426 <a class="el" href="Textile_8php.html">Textile.php</a> is a PHP port of Brad Choate's Text::Textile (Textile.pm) Perl module.<p> 427 <a class="el" href="Textile_8php.html">Textile.php</a> was ported by Jim Riggs <textile at jimandlissa dot com>. Great care has been taken to leave the Perl code in much the same form as Textile.pm. While changes were required due to syntactical differences between Perl and PHP, much of the code was left intact (even if alternative syntax or code optimizations could have been made in PHP), even to the point where one can compare functions/subroutines side by side between the two implementations. This has been done to ensure compatibility, reduce the possibility of introducing errors, and simplify maintainance as one version or the other is updated.<p> 428 <dl compact><dt><b>Author:</b></dt><dd>Jim Riggs <textile at jimandlissa dot com> <p> 429 Brad Choate <brad at bradchoate dot com> </dd></dl> 430 <dl compact><dt><b>Copyright:</b></dt><dd>Copyright © 2004 Jim Riggs and Brad Choate </dd></dl> 431 <dl compact><dt><b>Version:</b></dt><dd>@(#) <dl compact><dt><b>Id</b></dt><dd><a class="el" href="Textile_8php.html">Textile.php</a>,v 1.11 2004/09/23 15:01:28 jhriggs Exp </dd></dl> 432 </dd></dl> 433 <hr size="1"><address style="align: right;"><small>Generated on Mon Mar 21 08:37:26 2005 for TextilePHP by 434 <a href="http://www.doxygen.org/index.html"> 435 <img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address> 436 </body> 437 </html>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |