Changes between Version 1 and Version 2 of WikiProcessors
- Timestamp:
- 07/26/05 11:07:11 (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiProcessors
v1 v2 1 1 = Wiki Processors = 2 Processors are WikiMacros designed to provide alternative markup formats for the TracWiki engine. Processors can be thought of as ''macro functions to process user-edited text''.2 Processors are WikiMacros designed to provide alternative markup formats for the Wiki engine. Processors can be thought of as ''macro functions to process user-edited text''. 3 3 4 The wiki engine uses processors to allow using [wiki:Wiki RestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac.4 The wiki engine uses processors to allow using [wiki:WikiHtml raw HTML] in any wiki text. 5 5 6 6 == Using Processors == … … 24 24 25 25 ---- 26 27 '''Example 2''' (''inserting Restructured Text in wiki text''): 28 29 {{{ 30 #!html 31 <pre class="wiki">{{{ 32 #!rst 33 A header 34 -------- 35 This is some **text** with a footnote [*]_. 36 37 .. [*] This is the footnote. 38 }}}</pre> 39 }}} 40 41 '''Results in:''' 42 {{{ 43 #!rst 44 A header 45 -------- 46 This is some **text** with a footnote [*]_. 47 48 .. [*] This is the footnote. 49 }}} 50 ---- 51 '''Example 3''' (''inserting a block of C source code in wiki text''): 26 '''Example 2''' (''inserting a block of C source code in wiki text''): 52 27 53 28 {{{ … … 80 55 The following processors are included in the Trac distribution: 81 56 * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. 82 * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. 83 * '''textile''' -- Initial support as of aug 2, 2004. See [http://projects.edgewall.com/trac/ticket/593 ticket 593] and [http://dealmeida.net/projects/textile/ Textile]. 57 * '''textile''' -- Initial support as of aug 2, 2004. See [http://dealmeida.net/projects/textile/ Textile]. 84 58 85 59 === Source Code Support === 86 T rac includes processors to provide inline [wiki:TracSyntaxColoringsyntax highlighting] for these languages:60 The system includes processors to provide inline syntax highlighting] for these languages: 87 61 * '''c''' -- C 88 62 * '''cpp''' -- C++ … … 94 68 * '''sql''' -- SQL 95 69 * '''xml''' -- XML 96 '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.''97 70 98 By using the mime-type as processor, it is posible to syntax-highlight the same languages that are supported when browsing source code. (The list of mime-types can be found in [source:trunk/trac/Mimeview.py Mimeview.py]).71 By using the mime-type as processor, it is posible to syntax-highlight the same languages that are supported when browsing source code. 99 72 100 73 For example, you can write: … … 109 82 The result will be syntax highlighted html code. The same is valid for all other mime types supported. 110 83 111 112 113 For more processor macros developed and/or contributed by users, visit the macro bazaar:114 http://projects.edgewall.com/trac/wiki/MacroBazaar115 116 84 ---- 117 == Advanced Topics: Developing Processor Macros == 118 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 120 '''Example:''' (''Restructured Text Processor''): 121 {{{ 122 from docutils.core import publish_string 123 124 def execute(hdf, text, env): 125 html = publish_string(text, writer_name = 'html') 126 return html[html.find('<body>')+6:html.find('</body>')].strip() 127 }}} 128 129 ---- 130 See also : WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide 85 See also : WikiMacros, WikiHtml, WikiRestructuredText, WikiFormatting, SystemGuide