= Wiki Processors = Processors are WikiMacros designed to provide alternative markup formats for the Trac Wiki engine. Processors can be thought of as ''macro functions to process user-edited text''. The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac. == Using Processors == To use a processor on a block of text, use a wiki blockquote, selecting a processor by name using 'hashbang notation' (#!), familiar to most UNIX users from scripts. '''Example 1''' (''inserting raw HTML in a wiki text''): {{{ #!html
{{{ #!html <h1 style="color: orange">This is raw HTML</h1> }}}}}} '''Results in:''' {{{ #!html
{{{ #!rst A header -------- This is some **text** with a footnote [*]_. .. [*] This is the footnote. }}}}}} '''Results in:''' {{{ #!rst A header -------- This is some **text** with a footnote [*]_. .. [*] This is the footnote. }}} ---- '''Example 3''' (''inserting a block of C source code in wiki text''): {{{ #!html
{{{ #!c int main(int argc, char *argv[]) { printf("Hello World\n"); return 0; } }}}}}} '''Results in:''' {{{ #!c int main(int argc, char *argv[]) { printf("Hello World\n"); return 0; } }}} ---- == Available Processors == The following processors are included in the Trac distribution: * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. * '''textile''' -- Initial support as of aug 2, 2004. See [http://projects.edgewall.com/trac/ticket/593 ticket 593] and [http://dealmeida.net/projects/textile/ Textile]. === Source Code Support === Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for these languages: * '''c''' -- C * '''cpp''' -- C++ * '''python''' -- Python * '''perl''' -- Perl * '''ruby''' -- Ruby * '''php''' -- PHP * '''asp''' --- ASP * '''sql''' -- SQL * '''xml''' -- XML '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' By using the mime-type as processor, it is posible to syntax-highlight the same languages that are supported when browsing source code. (The list of mime-types can be found in [source:trunk/trac/Mimeview.py Mimeview.py]). For example, you can write: {{{ {{{ #!text/html