|
- Timestamp:
-
Apr 28, 2008, 2:20:33 PM (17 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
1 | 1 | = Wiki Processors = |
2 | | 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''. |
3 | 2 | |
4 | | The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac. |
| 3 | Processors are [TracWikiMacros wiki macros] designed to provide alternative markup formats for the [TracWiki Wiki engine]. Processors can be thought of as ''macro functions to process user-edited text''. |
| 4 | |
| 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. |
| 6 | |
5 | 7 | |
6 | 8 | == Using Processors == |
7 | | 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. |
| 9 | |
| 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. |
8 | 11 | |
9 | 12 | '''Example 1''' (''inserting raw HTML in a wiki text''): |
… |
… |
|
78 | 81 | The following processors are included in the Trac distribution: |
79 | 82 | * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. |
| 83 | * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml. |
80 | 84 | * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. |
81 | | * '''textile''' -- Supported if [http://dealmeida.net/projects/textile/ Textile] is installed. |
| 85 | * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. |
| 86 | * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). |
82 | 87 | |
83 | 88 | === Code Highlighting Support === |
… |
… |
|
92 | 97 | * '''sql''' -- SQL |
93 | 98 | * '''xml''' -- XML |
| 99 | * '''sh''' -- Bourne/Bash shell |
94 | 100 | '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' |
95 | 101 | |
… |
… |
|
106 | 112 | |
107 | 113 | For more processor macros developed and/or contributed by users, visit: |
108 | | * [http://projects.edgewall.com/trac/wiki/ProcessorBazaar ProcessorBazaar] |
109 | | * [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] |
| 114 | * [http://trac.edgewall.org/wiki/ProcessorBazaar ProcessorBazaar] |
| 115 | * [http://trac.edgewall.org/wiki/MacroBazaar MacroBazaar] |
110 | 116 | |
111 | 117 | |
112 | 118 | == Advanced Topics: Developing Processor Macros == |
113 | | Developing processors is no different than WikiMacros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information. |
| 119 | Developing processors is no different from [TracWikiMacros wiki macros]. In fact they work the same way, only the usage syntax differs. |
114 | 120 | |
115 | | '''Example:''' (''Restructured Text Processor''): |
116 | | {{{ |
117 | | from docutils.core import publish_string |
118 | | |
119 | | def execute(hdf, text, env): |
120 | | html = publish_string(text, writer_name = 'html') |
121 | | return html[html.find('<body>')+6:html.find('</body>')].strip() |
122 | | }}} |
123 | 121 | |
124 | 122 | ---- |
125 | | See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide |
| 123 | See also: TracWikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide |
|