Changes between Version 1 and Version 2 of WikiProcessors


Ignore:
Timestamp:
Apr 9, 2008, 4:17:48 PM (16 years ago)
Author:
trac
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''.
    32
    4 The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac.
     3Processors 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
     5The 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
    57
    68== Using Processors ==
    7 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.
     9
     10To 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.
    811
    912'''Example 1''' (''inserting raw HTML in a wiki text''):
     
    7578----
    7679
    77 
    78 
    7980== Available Processors ==
    8081The following processors are included in the Trac distribution:
    8182 * '''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.
    8284 * '''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].
     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).
    8487
    85 === Source Code Support ===
    86 Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for these languages:
     88=== Code Highlighting Support ===
     89Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages:
    8790 * '''c''' -- C
    8891 * '''cpp''' -- C++
     
    9497 * '''sql''' -- SQL
    9598 * '''xml''' -- XML
     99 * '''sh''' -- Bourne/Bash shell
    96100'''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.''
    97101
    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]).
    99 
    100 For example, you can write:
    101 
     102By using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write:
    102103{{{
    103104{{{
     
    107108}}}
    108109
    109 The result will be syntax highlighted html code. The same is valid for all other mime types supported.
     110The result will be syntax highlighted HTML code. The same is valid for all other mime types supported.
    110111
    111112
     113For more processor macros developed and/or contributed by users, visit:
     114 * [http://trac.edgewall.org/wiki/ProcessorBazaar ProcessorBazaar]
     115 * [http://trac.edgewall.org/wiki/MacroBazaar MacroBazaar]
    112116
    113 For more processor macros developed and/or contributed by users, visit the macro bazaar:
    114  http://projects.edgewall.com/trac/wiki/MacroBazaar
     117
     118== Advanced Topics: Developing Processor Macros ==
     119Developing processors is no different from [TracWikiMacros wiki macros]. In fact they work the same way, only the usage syntax differs.
     120
    115121
    116122----
    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
     123See also: TracWikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide