The language for the generic syntax highlighting tags can be specified with one of the attribute(s): type, lang, language. The possible values are: "apache" (for Apache configuration), "applescript" (for AppleScript), "bash" (for Bash), "c" (for C), "c_mac" (for C (Mac)), "cpp" (for C++), "cpp-qt" (for C++ (QT)), "css" (for CSS), "drupal5" (for Drupal 5), "drupal6" (for Drupal 6), "html4strict" (for HTML), "ini" (for INI), "java" (for Java), "javascript" (for Javascript), "objc" (for Objective-C), "perl" (for Perl), "php" (for PHP), "php-brief" (for PHP (brief)), "povray" (for POVRAY), "python" (for Python), "rails" (for Rails), "robots" (for robots.txt), "ruby" (for Ruby), "smarty" (for Smarty), "sql" (for SQL), "text" (for Text), "xml" (for XML).
Line numbering can be enabled/disabled with the attribute "linenumbers". Possible values are: "off" for no line numbers, "normal" for normal line numbers and "fancy" for fancy line numbers (every nth line number highlighted). The start line number can be specified with the attribute "start", which implicitly enables normal line numbering. For fancy line numbering the interval for the highlighted line numbers can be specified with the attribute "fancy", which implicitly enables fancy line numbering.
If the source code between the tags contains a newline (e.g. immediatly after the opening tag), the highlighted source code will be displayed as a code block. Otherwise it will be displayed inline.
Beside the tag style "<foo>" it is also possible to use "[foo]".
Defaults:
Default highlighting mode for generic syntax highlighting tags: when no language attribute is specified, no syntax highlighting will be done.
Default line numbering: fancy line numbers (every 5 lines).
Examples:
You type
You get
<code>foo = "bar";</code>
Inline code with the default syntax highlighting mode.
<code> foo = "bar"; baz = "foz"; </code>
Code block with the default syntax highlighting mode.
Code block with syntax highlighting for Perl source code, line numbers starting from 23 and highlighted line numbers every 7th line.
Link to Amazon products with: [amazon product_id inline|full|thumbnail]. Example: [amazon 1590597559 thumbnail]
Textile Help
Block modifier syntax:
CSS attributes can be applied to blocks (paragraphs, headers,
etc.). CSS classes are specifed with "(class)";
CSS IDs are specified with "(#id)"; both can be
specified with "(class#id)". An arbtirary
CSS style can be applied by using
"{style}". Finally, language attributes are
applied using "[language]".
Additionally, alignment and indentation shorthands are provided. To
left-align, right-align, center, and justify text, use
"<", ">", "=", and
"<>", respectively. "(" left-indents
a block 1em for each occurrence, and ")" right-indents
similarly.
Tables have additional options. "^", "-",
and "~" specify top, middle, and bottom vertical
alignment. The "_" attribute on a cell indicates that
it is a table header.
The examples below illustrate these attributes.
textile input
output
Headings
hx. (where x is 1 - 6)
h1. Heading
Heading
h2(class). Heading with class
Heading with class
Paragraphs
p=. Centered text
Centered text
p())(#id). Indented text with ID
Indented
text with ID
Block quotes
bq(class#id). Quote with class and ID
Quote with class and
ID
bq[en]. English quote
English quote
Ordered lists
{color: blue}# Attributes specified
# before the first item
# affect the whole list