wiki:WikiProcessors

Version 4 (modified by anonyme, 5 years ago) (diff)

--

bontril diet pill cheap ultram fioricet medication online buy tetracycline drug fioricet ephedrine effects buy celebrex lexapro symptom withdrawal buy meridia buy bontril long term ambien tadalafil drug valtrex vioxx celebrex ambien sleep medication zolpidem order zolpidem brand cheap zanaflex codeine facts cheap bontril by c.o.d. diazepam suicide alprazolam detectable in blood cheap ultracet zoloft withdrawal buy tadalafil vioxx celebrex buy online ultram buy tadalafil codeine addiction diazepam buy online norvasc 10mg generic propecia zoloft harm carisoprodol zoloft lawsuits hydrochloride tetracycline buy cheap xenical acomplia online order cialis zoloft attorney celebrex side effects celebrex recall buy ambien online carisoprodol cheap valtrex meridia effectiveness ambien online online tadalafil celexa anxiety propecia cheap celebrex recall ambien online meridia diet pill diazepam online diazepam buying buy cheap carisoprodol carisoprodol buying bontril 35mg buy online zanaflex buy codeine ephedrine effects buy celexa lexapro withdrawal ambien online ultram carisoprodol online buy ephedrine buy cheap diazepam gain lexapro weight carisoprodol without prescription buy cheap levitra online alprazolam online diazepam buy online zoloft harm ambien free cialis alprazolam 2mg celebrex medication bontril sr purchase ultram no prescription ultram ambien side effects no prescription ultram acomplia mixed bipolar disorder and zyprexa bontril side effects vaspro megapro ephedrine hcl bismuth metronidazole subsalicylate tetracycline order acomplia zolpidem order buy online diazepam carisoprodol buy online effects side tetracycline zoloft suicide ambien online buy cheap carisoprodol propecia hair treatment zithromax antibiotic codeine extraction buy alprazolam online

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 Restructured Text and 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 shebang notation (#!), familiar to most UNIX users from scripts.

Example 1 (inserting raw HTML in a wiki text):

{{{
#!html
<h1 style="color: orange">This is raw HTML</h1>
}}}

Results in:

This is raw HTML


Example 2 (inserting Restructured Text in wiki text):

{{{
#!rst
A header
--------
This is some **text** with a footnote [*]_.

.. [*] This is the footnote.
}}}

Results in:

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):

{{{
#!c
int main(int argc, char *argv[])
{
  printf("Hello World
");
  return 0;
}
}}}

Results in:

int main(int argc, char *argv[])
{
  printf("Hello World
");
  return 0;
}

Available Processors

The following processors are included in the Trac distribution:

Code Highlighting Support

Trac includes processors to provide inline syntax highlighting for the following 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 possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write:

{{{
#!text/html
<h1>text</h1>
}}}

The result will be syntax highlighted HTML code. The same is valid for all other mime types supported.

For more processor macros developed and/or contributed by users, visit:

Advanced Topics: Developing Processor Macros

Developing processors is no different than WikiMacros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information.

Example: (Restructured Text Processor):

from docutils.core import publish_string

def execute(hdf, text, env):
    html = publish_string(text, writer_name = 'html')
    return html[html.find('<body>')+6:html.find('</body>')].strip()

See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide