Edgewall Software
Home
Trac
Trac Hacks
Genshi
Babel
Bitten
Home
Download
Documentation
Mailing Lists
License
FAQ
Search:
Login
Preferences
Help/Guide
About Trac
Wiki
Timeline
Roadmap
Browse Source
View Tickets
New Ticket
Search
Context Navigation
-1
Start Page
Index
History
Editing WikiProcessors
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
= Wiki Processors = 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''. 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. == Using Processors == 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. '''Example 1''' (''inserting raw HTML in a wiki text''): {{{ #!html <pre class="wiki">{{{ #!html <h1 style="color: orange">This is raw HTML</h1> }}}</pre> }}} '''Results in:''' {{{ #!html <h1 style="color: orange">This is raw HTML</h1> }}} ---- '''Example 2''' (''inserting Restructured Text in wiki text''): {{{ #!html <pre class="wiki">{{{ #!rst A header -------- This is some **text** with a footnote [*]_. .. [*] This is the footnote. }}}</pre> }}} '''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 <pre class="wiki">{{{ #!c int main(int argc, char *argv[]) { printf("Hello World\n"); return 0; } }}}</pre> }}} '''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. * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml. * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). === Code Highlighting Support === Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages: * '''c''' -- C * '''cpp''' -- C++ * '''python''' -- Python * '''perl''' -- Perl * '''ruby''' -- Ruby * '''php''' -- PHP * '''asp''' -- ASP * '''java''' -- Java * '''js''' -- Javascript * '''sql''' -- SQL * '''xml''' -- XML * '''sh''' -- Bourne/Bash shell '''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: * [trac:ProcessorBazaar] * [trac:MacroBazaar] * [th:WikiStart Trac Hacks] community site == Advanced Topics: Developing Processor Macros == Developing processors is no different from Wiki macros. In fact they work the same way, only the usage syntax differs. See TracWikiMacros for more information. ---- See also: TracWikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.