Changes between Version 1 and Version 2 of WikiProcessors


Ignore:
Timestamp:
07/26/05 11:07:11 (19 years ago)
Author:
joe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiProcessors

    v1 v2  
    11= 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''.  
     2Processors 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''.  
    33 
    4 The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac. 
     4The wiki engine uses processors to allow using [wiki:WikiHtml raw HTML] in any wiki text. 
    55 
    66== Using Processors == 
     
    2424 
    2525---- 
    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''): 
    5227 
    5328{{{ 
     
    8055The following processors are included in the Trac distribution: 
    8156 * '''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]. 
    8458 
    8559=== Source Code Support === 
    86 Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for these languages: 
     60The system includes processors to provide inline syntax highlighting] for these languages: 
    8761 * '''c''' -- C 
    8862 * '''cpp''' -- C++ 
     
    9468 * '''sql''' -- SQL 
    9569 * '''xml''' -- XML 
    96 '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' 
    9770 
    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]). 
     71By using the mime-type as processor, it is posible to syntax-highlight the same languages that are supported when browsing source code.  
    9972 
    10073For example, you can write: 
     
    10982The result will be syntax highlighted html code. The same is valid for all other mime types supported. 
    11083 
    111  
    112  
    113 For more processor macros developed and/or contributed by users, visit the macro bazaar:  
    114  http://projects.edgewall.com/trac/wiki/MacroBazaar 
    115  
    11684---- 
    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 
     85See also : WikiMacros, WikiHtml, WikiRestructuredText, WikiFormatting, SystemGuide