3
Processors are WikiMacros designed to provide alternative markup formats for the [TracWiki Wiki engine]. Processors can be thought of as ''macro functions to process user-edited text''.
5
The Wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text], [wiki:WikiHtml raw HTML] and [http://www.textism.com/tools/textile/ textile] in any Wiki text throughout Trac.
10
To use a processor on a block of text, use a Wiki code block, selecting a processor by name using ''shebang notation'' (#!), familiar to most UNIX users from scripts.
12
'''Example 1''' (''inserting raw HTML in a wiki text''):
18
<h1 style="color: orange">This is raw HTML</h1>
25
<h1 style="color: orange">This is raw HTML</h1>
28
Note that since 0.11, such blocks of HTML have to be self-contained, i.e. you can't start an HTML element in one block and close it later in a second block. Use div or span processors for achieving similar effect (see WikiHtml).
32
'''Example 2''' (''inserting Restructured Text in wiki text''):
40
This is some **text** with a footnote [*]_.
42
.. [*] This is the footnote.
51
This is some **text** with a footnote [*]_.
53
.. [*] This is the footnote.
56
'''Example 3''' (''inserting a block of C source code in wiki text''):
62
int main(int argc, char *argv[])
64
printf("Hello World\n");
73
int main(int argc, char *argv[])
75
printf("Hello World\n");
82
== Available Processors ==
83
The following processors are included in the Trac distribution:
84
* '''html''' -- Insert custom HTML in a wiki page. See WikiHtml.
85
* '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml.
86
* '''span''' -- Wrap an arbitrary Wiki content in a <span> element (''since 0.11''). See also WikiHtml.
87
* '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText.
88
* '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference].
89
* '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page).
91
=== Code Highlighting Support ===
92
Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages:
95
* '''python''' -- Python
101
* '''js''' -- Javascript
104
* '''sh''' -- Bourne/Bash shell
106
'''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.''
108
By using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write:
116
The result will be syntax highlighted HTML code:
122
The same is valid for all other mime types supported.
125
For more processor macros developed and/or contributed by users, visit:
126
* [trac:ProcessorBazaar]
128
* [th:WikiStart Trac Hacks] community site
131
== Advanced Topics: Developing Processor Macros ==
132
Developing processors is no different from Wiki macros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information.
136
See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide
b'\\ No newline at end of file'