Changes between Version 1 and Version 2 of WikiRestructuredText
- Timestamp:
- 11 May 2016, 13:40:24 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiRestructuredText
v1 v2 1 = reStructuredText Support in Trac = 2 3 Trac supports using ''reStructuredText'' (RST) as an alternative to wiki markup in any context WikiFormatting is used. 1 = reStructuredText Support in Trac 2 3 == Introduction 4 5 6 Trac supports [http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html reStructuredText (RST)] as an alternative to wiki markup where WikiFormatting is used. 4 7 5 8 From the reStucturedText webpage: 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` asvalue 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 ===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`. See [trac:source:/trunk/INSTALL this example]. 12 13 === Requirements 14 15 To activate RST support in Trac, install the python docutils package: `easy_install docutils`. If not already available on your operating system, you can download it at the [http://docutils.sourceforge.net/rst.html RST Website]. 16 17 Do not use the package manager of your OS, eg `apt-get install python-docutils`, because Trac will not find docutils then. 18 19 === More information on RST 17 20 18 21 * reStructuredText Website -- http://docutils.sourceforge.net/rst.html 19 22 * RST Quick Reference -- http://docutils.sourceforge.net/docs/rst/quickref.html 20 23 21 ---- 22 23 == Using RST in Trac == 24 == Using RST in Trac 25 24 26 To specify that a block of text should be parsed using RST, use the ''rst'' processor. 25 27 26 === TracLinks in reStructuredText ===28 === TracLinks in reStructuredText 27 29 28 30 * Trac provides a custom RST directive `trac::` to allow TracLinks from within RST text. … … 70 72 For a complete example of all uses of the `:trac:` role, please see WikiRestructuredTextLinks. 71 73 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 74 === Syntax highlighting in reStructuredText 75 76 There is a directive for doing TracSyntaxColoring in RST as well. The directive is called code-block: 77 77 78 78 ||= Wiki Markup ||= Display || … … 107 107 Note the need to indent the code at least one character after the `.. code-block` directive. 108 108 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. 109 === Wiki Macros in reStructuredText 110 111 To enable [WikiMacros Wiki Macros] in RST, you use the same directive as for syntax highlighting, ie code-block: 112 112 113 113 ||= Wiki Markup ||= Display || … … 135 135 }}} 136 136 137 Or a more concise Wiki Macro 137 Or a more concise Wiki Macro-like syntax is also available, using the `:code-block:` role: 138 138 139 139 ||= Wiki Markup ||= Display || … … 155 155 }}} 156 156 157 === Bigger RST Example === 158 The example below should be mostly self-explanatory: 157 === Bigger RST Example 158 159 The example below should be self-explanatory: 159 160 160 161 ||= Wiki Markup ||= Display ||