Changes between Version 5 and Version 6 of WikiProcessors
- Timestamp:
- 01/24/11 13:44:25 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiProcessors
v5 v6 1 2 1 = Wiki Processors = 3 2 … … 14 13 15 14 {{{ 15 {{{ 16 16 #!html 17 <pre class="wiki">{{{ 18 #!html 19 <h1 style="color: orange">This is raw HTML</h1> 20 }}}</pre> 17 <h1 style="color: orange">This is raw HTML</h1> 18 }}} 21 19 }}} 22 20 … … 27 25 }}} 28 26 27 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). 28 29 29 ---- 30 30 … … 32 32 33 33 {{{ 34 #!html 35 <pre class="wiki">{{{ 34 {{{ 36 35 #!rst 37 36 A header … … 40 39 41 40 .. [*] This is the footnote. 42 }}} </pre>41 }}} 43 42 }}} 44 43 … … 56 55 57 56 {{{ 58 #!html 59 <pre class="wiki">{{{ 57 {{{ 60 58 #!c 61 59 int main(int argc, char *argv[]) … … 64 62 return 0; 65 63 } 66 }}} </pre>64 }}} 67 65 }}} 68 66 … … 78 76 79 77 ---- 78 '''Example 4''' (''Searching from a wiki page by custom field. Allows user to reuse most common searches on a wiki page''): 79 80 {{{ 81 {{{ 82 #!html 83 <form action="/query" method="get"> 84 <input type="text" name="keywords" value="~" size="30"> <input type="submit" value="Search by Keywords#"> 85 <!-- To control what fields show up use hidden fields 86 <input type="hidden" name="col" value="id"> 87 <input type="hidden" name="col" value="summary"> 88 <input type="hidden" name="col" value="status"> 89 <input type="hidden" name="col" value="milestone"> 90 <input type="hidden" name="col" value="version"> 91 <input type="hidden" name="col" value="owner"> 92 <input type="hidden" name="col" value="priority"> 93 <input type="hidden" name="col" value="component"> 94 --> 95 </form> 96 }}} 97 }}} 98 99 100 ''' Result:''' 101 {{{ 102 #!html 103 <form action="/query" method="get"> 104 <input type="text" name="keywords" value="~" size="30"> <input type="submit" value="Search by Keywords#"> 105 <!-- To control what fields show up use hidden fields 106 <input type="hidden" name="col" value="id"> 107 <input type="hidden" name="col" value="summary"> 108 <input type="hidden" name="col" value="status"> 109 <input type="hidden" name="col" value="milestone"> 110 <input type="hidden" name="col" value="version"> 111 <input type="hidden" name="col" value="owner"> 112 <input type="hidden" name="col" value="priority"> 113 <input type="hidden" name="col" value="component"> 114 --> 115 </form> 116 }}} 117 118 119 ---- 80 120 81 121 == Available Processors == 82 122 The following processors are included in the Trac distribution: 83 123 * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. 124 * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml. 125 * '''span''' -- Wrap an arbitrary Wiki content in a <span> element (''since 0.11''). See also WikiHtml. 84 126 * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. 85 * '''textile''' -- Supported if [http://dealmeida.net/projects/textile/ Textile] is installed. See [http://hobix.com/textile/ a Textile reference].86 87 Textile link above is rotten. [http://www.textism.com/tools/textile/ this one] works, allows to test example.127 * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. 128 * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text that can be viewed when editing the wiki page content - not in the rendered page). 129 * '''diff''' -- Pretty print patches and diffs. 88 130 89 131 === Code Highlighting Support === … … 91 133 * '''c''' -- C 92 134 * '''cpp''' -- C++ 135 * '''csharp''' --- C# 93 136 * '''python''' -- Python 94 137 * '''perl''' -- Perl 95 138 * '''ruby''' -- Ruby 96 139 * '''php''' -- PHP 97 * '''asp''' --- ASP 140 * '''asp''' -- ASP 141 * '''java''' -- Java 142 * '''js''' -- Javascript 98 143 * '''sql''' -- SQL 99 144 * '''xml''' -- XML 145 * '''sh''' -- Bourne/Bash shell 146 100 147 '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' 101 148 … … 108 155 }}} 109 156 110 The result will be syntax highlighted HTML code. The same is valid for all other mime types supported. 157 The result will be syntax highlighted HTML code: 158 {{{ 159 #!text/html 160 <h1>text</h1> 161 }}} 162 163 The same is valid for all other [TracSyntaxColoring#SyntaxColoringSupport mime types supported]. 111 164 112 165 113 166 For more processor macros developed and/or contributed by users, visit: 114 * [http://projects.edgewall.com/trac/wiki/ProcessorBazaar ProcessorBazaar] 115 * [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] 167 * [trac:ProcessorBazaar] 168 * [trac:MacroBazaar] 169 * [th:WikiStart Trac Hacks] community site 116 170 117 171 118 172 == Advanced Topics: Developing Processor Macros == 119 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.173 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. 120 174 121 '''Example:''' (''Restructured Text Processor''):122 {{{123 #!python124 from docutils.core import publish_string125 126 def execute(hdf, text, env):127 html = publish_string(text, writer_name = 'html')128 return html[html.find('<body>')+6:html.find('</body>')].strip()129 }}}130 175 131 176 ----