6 | | "''reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. reStructuredText is designed for extensibility for specific application domains. ''" |
7 | | |
8 | | If you want a file from your Subversion repository be displayed as reStructuredText in Trac's source browser, set `text/x-rst` as value for the Subversion property `svn:mime-type`. See [trac:source:/trunk/INSTALL this example]. |
9 | | |
10 | | === Requirements === |
11 | | Note that to activate RST support in Trac, the python docutils package must be installed. |
12 | | If not already available on your operating system, you can download it at the [http://docutils.sourceforge.net/rst.html RST Website]. |
13 | | |
14 | | Install docutils using `easy_install docutils`. Do not use the package manager of your OS (e.g. `apt-get install python-docutils`), because Trac will not find docutils then. |
15 | | |
16 | | === More information on RST === |
17 | | |
18 | | * reStructuredText Website -- http://docutils.sourceforge.net/rst.html |
19 | | * RST Quick Reference -- http://docutils.sourceforge.net/docs/rst/quickref.html |
20 | | |
21 | | ---- |
22 | | |
23 | | == Using RST in Trac == |
| 9 | "reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. reStructuredText is designed for extensibility for specific application domains." |
| 10 | |
| 11 | If you want a file from your Subversion repository to be displayed as reStructuredText in the Trac source browser, set `text/x-rst` as the value for the Subversion property `svn:mime-type`, or add the extension `rst` to the filename. See [trac:source:branches/1.0-stable/INSTALL this example]. |
| 12 | |
| 13 | The examples will only be rendered as reStructuredText if docutils is installed. If Pygments is installed but docutils is not installed, the examples will be syntax-highlighted rather than rendered as reStructuredText. |
| 14 | |
| 15 | === Requirements |
| 16 | |
| 17 | To activate RST support in Trac, install the python docutils package with the command `easy_install docutils`, or through your operating system package manager. If not already available on your operating system, you can download it from [https://pypi.python.org/pypi/docutils PyPI]. |
| 18 | |
| 19 | === More information on RST |
| 20 | |
| 21 | * [http://docutils.sourceforge.net/rst.html reStructuredText Website] |
| 22 | * [http://docutils.sourceforge.net/docs/rst/quickref.html RST Quick Reference] |
| 23 | |
| 24 | == Using RST in Trac |
| 25 | |
70 | | For a complete example of all uses of the `:trac:` role, please see WikiRestructuredTextLinks. |
71 | | |
72 | | |
73 | | === Syntax highlighting in reStructuredText === |
74 | | |
75 | | There is a directive for doing TracSyntaxColoring in RST as well. The directive is called |
76 | | code-block |
77 | | |
78 | | ||= Wiki Markup ||= Display || |
79 | | {{{#!td |
80 | | {{{ |
81 | | {{{ |
82 | | #!rst |
| 68 | For a complete example of all uses of the `:trac:` role, see WikiRestructuredTextLinks. |
| 69 | |
| 70 | === Syntax highlighting in reStructuredText |
| 71 | |
| 72 | There is a directive for doing TracSyntaxColoring in RST as well. The directive is called code-block: |
| 73 | |
| 74 | ||= Wiki Markup ||= Display || |
| 75 | {{{#!td |
| 76 | {{{ |
| 77 | {{{#!rst |
109 | | === Wiki Macros in reStructuredText === |
110 | | |
111 | | For doing [WikiMacros Wiki Macros] in RST you use the same directive as for syntax highlighting i.e code-block. |
| 103 | === Wiki Macros in reStructuredText |
| 104 | |
| 105 | To enable [WikiMacros Wiki Macros] in RST, you use the same `code-block` directive as for syntax highlighting: |
| 106 | |
| 107 | ||= Wiki Markup ||= Display || |
| 108 | {{{#!td |
| 109 | {{{ |
| 110 | {{{#!rst |
| 111 | |
| 112 | .. code-block:: RecentChanges |
| 113 | |
| 114 | Trac,3 |
| 115 | |
| 116 | }}} |
| 117 | }}} |
| 118 | }}} |
| 119 | {{{#!td |
| 120 | {{{#!rst |
| 121 | |
| 122 | .. code-block:: RecentChanges |
| 123 | |
| 124 | Trac,3 |
| 125 | |
| 126 | }}} |
| 127 | }}} |
| 128 | |
| 129 | Or use the `:code-block:` role for a more concise Wiki Macro-like syntax: |