close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
- Timestamp:
-
Jul 14, 2008, 10:28:18 AM (16 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
1 | 1 | = Wiki Processors = |
2 | 2 | |
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''. |
| 3 | 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''. |
4 | 4 | |
5 | 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. |
… |
… |
|
25 | 25 | <h1 style="color: orange">This is raw HTML</h1> |
26 | 26 | }}} |
| 27 | |
| 28 | Note that since 0.11, such blocks of HTML have to be self-contained, i.e. you can't start an HTML element in one block and close it later in a second block. Use div or span processors for achieving similar effect (see WikiHtml). |
27 | 29 | |
28 | 30 | ---- |
… |
… |
|
81 | 83 | The following processors are included in the Trac distribution: |
82 | 84 | * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. |
| 85 | * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml. |
| 86 | * '''span''' -- Wrap an arbitrary Wiki content in a <span> element (''since 0.11''). See also WikiHtml. |
83 | 87 | * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. |
84 | | * '''textile''' -- Supported if [http://dealmeida.net/projects/textile/ Textile] is installed. See [http://hobix.com/textile/ a Textile reference]. |
| 88 | * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. |
85 | 89 | * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). |
86 | | |
87 | | Textile link above is rotten. [http://www.textism.com/tools/textile/ this one] works, allows to test example. To install, download from [http://cheeseshop.python.org/pypi/textile] and run `python setup.py install`. |
88 | 90 | |
89 | 91 | === Code Highlighting Support === |
… |
… |
|
95 | 97 | * '''ruby''' -- Ruby |
96 | 98 | * '''php''' -- PHP |
97 | | * '''asp''' --- ASP |
| 99 | * '''asp''' -- ASP |
| 100 | * '''java''' -- Java |
| 101 | * '''js''' -- Javascript |
98 | 102 | * '''sql''' -- SQL |
99 | 103 | * '''xml''' -- XML |
100 | 104 | * '''sh''' -- Bourne/Bash shell |
| 105 | |
101 | 106 | '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' |
102 | 107 | |
… |
… |
|
109 | 114 | }}} |
110 | 115 | |
111 | | The result will be syntax highlighted HTML code. The same is valid for all other mime types supported. |
| 116 | The result will be syntax highlighted HTML code: |
| 117 | {{{ |
| 118 | #!text/html |
| 119 | <h1>text</h1> |
| 120 | }}} |
| 121 | |
| 122 | The same is valid for all other mime types supported. |
112 | 123 | |
113 | 124 | |
114 | 125 | For more processor macros developed and/or contributed by users, visit: |
115 | | * [http://trac.edgewall.org/wiki/ProcessorBazaar ProcessorBazaar] |
116 | | * [http://trac.edgewall.org/wiki/MacroBazaar MacroBazaar] |
| 126 | * [trac:ProcessorBazaar] |
| 127 | * [trac:MacroBazaar] |
| 128 | * [th:WikiStart Trac Hacks] community site |
117 | 129 | |
118 | 130 | |
119 | 131 | == Advanced Topics: Developing Processor Macros == |
120 | | Developing processors is no different from [TracWikiMacros wiki macros]. In fact they work the same way, only the usage syntax differs. |
| 132 | Developing processors is no different from Wiki macros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information. |
121 | 133 | |
122 | | '''Example:''' (''Restructured Text Processor''): |
123 | | {{{ |
124 | | #!python |
125 | | from docutils.core import publish_string |
126 | | |
127 | | def execute(hdf, text, env): |
128 | | html = publish_string(text, writer_name = 'html') |
129 | | return html[html.find('<body>')+6:html.find('</body>')].strip() |
130 | | }}} |
131 | 134 | |
132 | 135 | ---- |
133 | | See also: TracWikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide |
| 136 | See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide |