Changes between Version 3 and Version 4 of WikiProcessors


Ignore:
Timestamp:
04/03/14 16:26:46 (11 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiProcessors

    v3 v4  
    5959{{{ 
    6060{{{ 
     61#!html 
    6162<h1 style="color: grey">This is raw HTML</h1> 
    6263}}} 
     
    153154The following processors are included in the Trac distribution: 
    154155 
    155  `#!default` :: Present the text verbatim in a preformatted text block.  
    156                 This is the same as specifying ''no'' processor name 
    157                 (and no `#!`) 
    158  `#!comment` :: Do not process the text in this section (i.e. contents exist 
    159                 only in the plain text - not in the rendered page). 
    160  
    161 === HTML related === 
    162  
    163  `#!html`        :: Insert custom HTML in a wiki page. 
    164  `#!htmlcomment` :: Insert an HTML comment in a wiki page (''since 0.12''). 
    165  
    166 Note that `#!html` blocks have to be ''self-contained'', 
    167 i.e. you can't start an HTML element in one block and close it later in a second block. Use the following processors for achieving a similar effect.  
    168  
    169   `#!div` :: Wrap an arbitrary Wiki content inside a <div> element 
    170              (''since 0.11''). 
    171  `#!span` :: Wrap an arbitrary Wiki content inside a <span> element  
    172              (''since 0.11'').  
    173  
    174  `#!td` :: Wrap an arbitrary Wiki content inside a <td> element (''since 0.12'') 
    175  `#!th` :: Wrap an arbitrary Wiki content inside a <th> element (''since 0.12'')  
    176  `#!tr` :: Can optionally be used for wrapping `#!td` and `#!th` blocks, 
    177        either for specifying row attributes of better visual grouping 
    178        (''since 0.12'') 
    179  
    180 See WikiHtml for example usage and more details about these processors. 
    181  
    182 === Other Markups === 
    183  
    184      `#!rst` :: Trac support for Restructured Text. See WikiRestructuredText. 
    185  `#!textile` :: Supported if [http://cheeseshop.python.org/pypi/textile Textile]  
    186                 is installed.  
    187                 See [http://www.textism.com/tools/textile/ a Textile reference]. 
    188  
    189  
    190 === Code Highlighting Support === 
    191  
    192 Trac includes processors to provide inline syntax highlighting: 
    193  `#!c` (C), `#!cpp` (C++), `#!python` (Python), `#!perl` (Perl),  
    194  `#!ruby` (Ruby), `#!php` (PHP), `#!asp` (ASP), `#!java` (Java),  
    195  `#!js` (Javascript), `#!sql (SQL)`, `#!xml` (XML or HTML), 
    196  `#!sh` (!Bourne/Bash shell), etc. 
    197  
    198 Trac relies on external software packages for syntax coloring, 
    199 like [http://pygments.org Pygments].  
    200  
    201 See TracSyntaxColoring for information about which languages 
    202 are supported and how to enable support for more languages. 
    203  
    204 Note also that by 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: 
    205 {{{ 
     156|| '''`#!default`''' || Present the text verbatim in a preformatted text block. This is the same as specifying ''no'' processor name (and no `#!`) || 
     157|| '''`#!comment`''' || Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). || 
     158|||| || 
     159||||= '''HTML related''' =|| 
     160|| '''`#!html`''' || Insert custom HTML in a wiki page. || 
     161|| '''`#!htmlcomment`''' || Insert an HTML comment in a wiki page (''since 0.12''). || 
     162|| || Note that `#!html` blocks 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 the following processors for achieving a similar effect.  || 
     163|| '''`#!div`''' || Wrap an arbitrary Wiki content inside a <div> element (''since 0.11''). || 
     164|| '''`#!span`''' || Wrap an arbitrary Wiki content inside a <span> element (''since 0.11''). || 
     165|| '''`#!td`''' || Wrap an arbitrary Wiki content inside a <td> element (''since 0.12'') || 
     166|| '''`#!th`''' || Wrap an arbitrary Wiki content inside a <th> element (''since 0.12'') || 
     167|| '''`#!tr`''' || Can optionally be used for wrapping `#!td` and `#!th` blocks, either for specifying row attributes of better visual grouping (''since 0.12'') || 
     168|| || See WikiHtml for example usage and more details about these processors. || 
     169|||| || 
     170||||= '''Other Markups''' =|| 
     171|| '''`#!rst`''' || Trac support for Restructured Text. See WikiRestructuredText. || 
     172|| '''`#!textile`''' || Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. || 
     173|||| || 
     174||||= '''Code Highlighting Support''' =|| 
     175|| '''`#!c`''' [[BR]] '''`#!cpp`''' (C++) [[BR]] '''`#!python`''' [[BR]] '''`#!perl`''' [[BR]] '''`#!ruby`''' [[BR]] '''`#!php`''' [[BR]] '''`#!asp`''' [[BR]] '''`#!java`''' [[BR]] '''`#!js`''' (Javascript) [[BR]] '''`#!sql`''' [[BR]] '''`#!xml`''' (XML or HTML) [[BR]] '''`#!sh`''' (!Bourne/Bash shell) [[BR]] '''etc.''' [[BR]] || Trac includes processors to provide inline syntax highlighting for source code in various languages. [[BR]] [[BR]] Trac relies on external software packages for syntax coloring, like [http://pygments.org Pygments]. [[BR]] [[BR]] See TracSyntaxColoring for information about which languages are supported and how to enable support for more languages. || 
     176|||| || 
     177||||= '''MIME Type Processors''' =|| 
     178|||| Using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. || 
     179{{{#!tr 
     180{{{#!td 
     181Some examples: 
     182 {{{ 
    206183{{{ 
    207184#!text/html 
    208185<h1>text</h1> 
    209186}}} 
    210 }}} 
    211  
     187 }}} 
     188}}} 
     189{{{#!td 
    212190The result will be syntax highlighted HTML code: 
    213 {{{ 
     191 {{{ 
    214192#!text/html 
    215193<h1>text</h1> 
    216 }}} 
     194 }}} 
    217195 
    218196The same is valid for all other [TracSyntaxColoring#SyntaxColoringSupport mime types supported]. 
    219  
     197}}} 
     198}}} 
     199{{{#!td 
     200 {{{ 
     201{{{ 
     202#!diff 
     203--- Version 55 
     204+++ Version 56 
     205@@ -115,8 +115,9 @@ 
     206     name='TracHelloWorld', version='1.0', 
     207     packages=find_packages(exclude=['*.tests*']), 
     208-    entry_points = """ 
     209-        [trac.plugins] 
     210-        helloworld = myplugs.helloworld 
     211-    """, 
     212+    entry_points = { 
     213+        'trac.plugins': [ 
     214+            'helloworld = myplugs.helloworld', 
     215+        ], 
     216+    }, 
     217 ) 
     218}}} 
     219 }}} 
     220}}} 
     221{{{#!td 
     222'''`#!diff`''' has a particularly nice renderer: 
     223 {{{ 
     224#!diff 
     225--- Version 55 
     226+++ Version 56 
     227@@ -115,8 +115,9 @@ 
     228     name='TracHelloWorld', version='1.0', 
     229     packages=find_packages(exclude=['*.tests*']), 
     230-    entry_points = """ 
     231-        [trac.plugins] 
     232-        helloworld = myplugs.helloworld 
     233-    """, 
     234+    entry_points = { 
     235+        'trac.plugins': [ 
     236+            'helloworld = myplugs.helloworld', 
     237+        ], 
     238+    }, 
     239 ) 
     240 }}} 
     241}}} 
    220242 
    221243For more processor macros developed and/or contributed by users, visit:  
    222244 * [trac:ProcessorBazaar] 
    223245 * [trac:MacroBazaar] 
    224  * [th:WikiStart Trac Hacks] community site 
     246 * [http://trac-hacks.org Trac Hacks] community site 
    225247 
    226248Developing processors is no different from Wiki macros.