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 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 <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. }}} ---- == 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): html = publish_string(text, writer_name = 'html') return html[html.find('<body>')+6:html.find('</body>')].strip() }}} ---- See also: WikiMacros, 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.