1 | | = 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''. |
| 1 | [http://www.googleandbaidu.com/ 网站建设][http://www.googletosh.com/ 网站推广] |
| 2 | [http://www.googletosh.com/ google推广][http://www.rentcarok.org/ 租车] |
| 3 | [http://www.rentcarok.org/ 上海租车][http://www.rentcarok.org/ 汽车租èµ] |
| 4 | [http://www.shrentcar.com/ 租车][http://www.shrentcar.com/上海租车] |
| 5 | [http://www.shrentcar.com/ 汽车租èµ][http://www.shrentcar.com/how.htm/ 租车] |
| 6 | [http://www.shrentcar.com/how.htm/上海租车][http://www.shrentcar.com/how.htm/ 汽车租èµ] |
| 7 | [http://www.revivedata.com/ æ•°æ®æ¢å¤][http://www.shticket.com/ 预订机票] |
| 8 | [http://www.translatebbs.com/ 英è¯ç¿»è¯‘][http://www.shticket.com/ 机票] |
| 9 | [http://www.goodticket.org/ 机票][http://www.goodticket.org/ 预订机票] |
| 10 | [http://www.curevitiligo.com/English/index.htm/ vitiligol][http://www.dela88.com/ 防é™ç”µ/防é™ç”µäº§å“] |
| 11 | [http://www.haungsanok.com/ 防é™ç”µ/防é™ç”µæ¤…å][http://www.translatebbs.com/ 翻译] |
| 12 | [http://www.tripto.com/ 三亚][http://www.tripto.com/ 三亚旅游] |
| 13 | [http://duweb.w2.ftpcn.cn/ æ•°æ®ä¿®å¤][http://duweb.w2.ftpcn.cn/ æ•°æ®æ¢å¤] |
| 14 | [http://sticket.w2.ftpcn.cn/ 机票][http://www.sexwebshop.net/ æˆäººç”¨å“] |
| 15 | [http://www.designatchina.com/ 设计][http://www.designatchina.com/ 广告设计] |
| 16 | [http://www.printingok.net/ å°åˆ·][http://sexwebshop.w2.ftpcn.cn/ æˆäººç”¨å“], |
| 17 | [http://printingok.w2.ftpcn.cn/ å°åˆ·][http://www.regsh.com/ 注册公å¸][http://www.regsh.com/ 公叿³¨å†Œ] |
| 18 | [http://www.regsh.com/ 注册上海公å¸][http://www.postdream.org/ 公叿³¨å†Œ][http://www.regsh.com/ 公叿³¨å†Œ] |
| 19 | [http://www.postdream.org/ 注册公å¸][http://www.postdream.org/ 注册上海公å¸][http://www.dreamatsh.com/ 注册公å¸] |
| 20 | [http://www.dreamatsh.com/ 公叿³¨å†Œ][http://www.dreamatsh.com/ 注册公å¸] |
| 21 | [http://www.googletosh.org/ 注册香港公][http://www.postdream.org/ 公叿³¨å†Œ] |
| 22 | [http://www.googletosh.org/Company.htm/ 注册香港公å¸][http://www.googletosh.org/ 注册香港公å¸] |
| 23 | [http://www.dreamhk.org/ 注册香港公å¸][http://www.dreamhk.org/ 香港公å¸] |
4 | | The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac. |
5 | | |
6 | | == 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. |
8 | | |
9 | | '''Example 1''' (''inserting raw HTML in a wiki text''): |
10 | | |
11 | | {{{ |
12 | | #!html |
13 | | <pre class="wiki">{{{ |
14 | | #!html |
15 | | <h1 style="color: orange">This is raw HTML</h1> |
16 | | }}}</pre> |
17 | | }}} |
18 | | |
19 | | '''Results in:''' |
20 | | {{{ |
21 | | #!html |
22 | | <h1 style="color: orange">This is raw HTML</h1> |
23 | | }}} |
24 | | |
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''): |
52 | | |
53 | | {{{ |
54 | | #!html |
55 | | <pre class="wiki">{{{ |
56 | | #!c |
57 | | int main(int argc, char *argv[]) |
58 | | { |
59 | | printf("Hello World |
60 | | "); |
61 | | return 0; |
62 | | } |
63 | | }}}</pre> |
64 | | }}} |
65 | | |
66 | | '''Results in:''' |
67 | | {{{ |
68 | | #!c |
69 | | int main(int argc, char *argv[]) |
70 | | { |
71 | | printf("Hello World |
72 | | "); |
73 | | return 0; |
74 | | } |
75 | | }}} |
76 | | |
77 | | ---- |
78 | | |
79 | | |
80 | | |
81 | | == Available Processors == |
82 | | The following processors are included in the Trac distribution: |
83 | | * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. |
84 | | * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. |
85 | | |
86 | | === Source Code Support === |
87 | | Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for these languages: |
88 | | * '''c''' -- C |
89 | | * '''cpp''' -- C++ |
90 | | * '''python''' -- Python |
91 | | * '''perl''' -- Perl |
92 | | * '''ruby''' -- Ruby |
93 | | * '''php''' -- PHP |
94 | | * '''asp''' --- ASP |
95 | | * '''sql''' -- SQL |
96 | | * '''xml''' -- XML |
97 | | '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' |
98 | | |
99 | | |
100 | | For more processor macros developed and/or contributed by users, visit the processor bazaar: |
101 | | http://projects.edgewall.com/trac/wiki/ProcessorBazaar |
102 | | |
103 | | ---- |
104 | | == Advanced Topics: Developing Processor Macros == |
105 | | Developing processors is no different than WikiMacros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information. |
106 | | |
107 | | '''Example:''' (''Restructured Text Processor''): |
108 | | {{{ |
109 | | from docutils.core import publish_string |
110 | | |
111 | | def execute(hdf, text): |
112 | | html = publish_string(text, writer_name = 'html') |
113 | | return html[html.find('<body>')+6:html.find('</body>')].strip() |
114 | | }}} |
115 | | |
116 | | ---- |
117 | | See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide |