Changes between Version 31 and Version 32 of WikiRestructuredText
- Timestamp:
- Sep 13, 2016, 12:29:17 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiRestructuredText
v31 v32 10 10 "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." 11 11 12 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 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:/trunk/INSTALL.rst this example]. 13 14 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. 13 15 14 16 === Requirements 15 17 16 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]. 17 18 Do not use the package manager of your OS, eg `apt-get install python-docutils`, because Trac will not find docutils then. 18 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]. 19 19 20 20 === More information on RST 21 21 22 * reStructuredText Website -- http://docutils.sourceforge.net/rst.html23 * RST Quick Reference -- http://docutils.sourceforge.net/docs/rst/quickref.html22 * [http://docutils.sourceforge.net/rst.html reStructuredText Website] 23 * [http://docutils.sourceforge.net/docs/rst/quickref.html RST Quick Reference] 24 24 25 25 == Using RST in Trac … … 33 33 {{{#!td 34 34 {{{ 35 {{{#!rst 36 This is a reference to |a ticket| 37 38 .. |a ticket| trac:: #42 39 }}} 40 }}} 41 }}} 42 {{{#!td 43 {{{#!rst 44 This is a reference to |a ticket| 45 46 .. |a ticket| trac:: #42 47 }}} 48 }}} 49 50 * You can also use the custom `:trac:` role to create TracLinks in RST. 51 ||= Wiki Markup ||= Display || 52 {{{#!td 35 53 {{{ 36 #!rst 37 This is a reference to |a ticket| 38 39 .. |a ticket| trac:: #42 40 }}} 41 }}} 42 }}} 43 {{{#!td 44 {{{ 45 #!rst 46 This is a reference to |a ticket| 47 48 .. |a ticket| trac:: #42 49 }}} 50 }}} 51 52 * Trac allows an even easier way of creating TracLinks in RST, using the custom `:trac:` role. 53 ||= Wiki Markup ||= Display || 54 {{{#!td 55 {{{ 56 {{{ 57 #!rst 54 {{{#!rst 58 55 This is a reference to ticket `#12`:trac: 59 56 … … 63 60 }}} 64 61 {{{#!td 65 {{{ 66 #!rst 62 {{{#!rst 67 63 This is a reference to ticket `#12`:trac: 68 64 … … 71 67 }}} 72 68 73 For a complete example of all uses of the `:trac:` role, pleasesee WikiRestructuredTextLinks.69 For a complete example of all uses of the `:trac:` role, see WikiRestructuredTextLinks. 74 70 75 71 === Syntax highlighting in reStructuredText … … 80 76 {{{#!td 81 77 {{{ 82 {{{ 83 #!rst 78 {{{#!rst 84 79 85 80 .. code-block:: python … … 94 89 }}} 95 90 {{{#!td 96 {{{ 97 #!rst 91 {{{#!rst 98 92 99 93 .. code-block:: python … … 110 104 === Wiki Macros in reStructuredText 111 105 112 To enable [WikiMacros Wiki Macros] in RST, you use the same directive as for syntax highlighting, ie code-block: 106 To enable [WikiMacros Wiki Macros] in RST, you use the same `code-block` directive as for syntax highlighting: 107 108 ||= Wiki Markup ||= Display || 109 {{{#!td 110 {{{ 111 {{{#!rst 112 113 .. code-block:: RecentChanges 114 115 Trac,3 116 117 }}} 118 }}} 119 }}} 120 {{{#!td 121 {{{#!rst 122 123 .. code-block:: RecentChanges 124 125 Trac,3 126 127 }}} 128 }}} 129 130 Or use the `:code-block:` role for a more concise Wiki Macro-like syntax: 113 131 114 132 ||= Wiki Markup ||= Display || … … 118 136 #!rst 119 137 120 .. code-block:: RecentChanges121 122 Trac,3123 124 }}}125 }}}126 }}}127 {{{#!td128 {{{129 #!rst130 131 .. code-block:: RecentChanges132 133 Trac,3134 135 }}}136 }}}137 138 Or a more concise Wiki Macro-like syntax is also available, using the `:code-block:` role:139 140 ||= Wiki Markup ||= Display ||141 {{{#!td142 {{{143 {{{144 #!rst145 146 138 :code-block:`RecentChanges:Trac,3` 147 139 }}} … … 149 141 }}} 150 142 {{{#!td 151 {{{ 152 #!rst 143 {{{#!rst 153 144 154 145 :code-block:`RecentChanges:Trac,3` … … 162 153 ||= Wiki Markup ||= Display || 163 154 {{{#!td 164 {{{ 165 #!html 166 <pre class="wiki">{{{ 167 #!rst 155 {{{#!html 156 <pre class="wiki">{{{#!rst 168 157 FooBar Header 169 158 ============= … … 193 182 }}} 194 183 {{{#!td 195 {{{ 196 #!rst 184 {{{#!rst 197 185 FooBar Header 198 186 =============