| 1 | = reStructuredText Support in Trac = |
| 2 | |
| 3 | Since 0.6, Trac supports using ''reStructuredText'' (RST) as an alternative to wiki markup in any context where WikiFormatting is used. |
| 4 | |
| 5 | 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 | === Requirements === |
| 9 | Note that to activate RST support in Trac, the python docutils package must be installed. |
| 10 | If not already available on your operating system, you can download it at the [http://docutils.sourceforge.net/rst.html RST Website]. |
| 11 | |
| 12 | === More information on RST === |
| 13 | |
| 14 | * reStructuredText Website -- http://docutils.sourceforge.net/rst.html |
| 15 | * RST Quick Reference -- http://docutils.sourceforge.net/docs/rst/quickref.html |
| 16 | |
| 17 | ---- |
| 18 | |
| 19 | == Using RST in Trac == |
| 20 | To specify that a block of text should be parsed using RST, use the ''rst'' processor. |
| 21 | |
| 22 | === TracLinks in reStructuredText === |
| 23 | Trac provides a custom RST reference-directive 'trac' to allow TracLinks from within RST text. |
| 24 | |
| 25 | Example: |
| 26 | {{{ |
| 27 | {{{ |
| 28 | #!rst |
| 29 | This is a reference to |a ticket| |
| 30 | |
| 31 | .. |a ticket| trac:: #42 |
| 32 | }}} |
| 33 | }}} |
| 34 | |
| 35 | For a complete example of all uses of the ''trac''-directive, please see WikiRestructuredTextLinks. |
| 36 | |
| 37 | === Example === |
| 38 | The example below should be mostly self-explanatory: |
| 39 | {{{ |
| 40 | #!html |
| 41 | <pre class="wiki">{{{ |
| 42 | #!rst |
| 43 | FooBar Header |
| 44 | ============= |
| 45 | reStructuredText is **nice**. It has its own webpage_. |
| 46 | |
| 47 | A table: |
| 48 | |
| 49 | ===== ===== ====== |
| 50 | Inputs Output |
| 51 | ------------ ------ |
| 52 | A B A or B |
| 53 | ===== ===== ====== |
| 54 | False False False |
| 55 | True False True |
| 56 | False True True |
| 57 | True True True |
| 58 | ===== ===== ====== |
| 59 | |
| 60 | RST TracLinks |
| 61 | ------------- |
| 62 | |
| 63 | See also ticket |#42|. |
| 64 | |
| 65 | .. |#42| trac:: #42 |
| 66 | |
| 67 | .. _webpage: http://docutils.sourceforge.net/rst.html |
| 68 | }}}</pre> |
| 69 | }}} |
| 70 | |
| 71 | |
| 72 | Results in: |
| 73 | {{{ |
| 74 | #!rst |
| 75 | FooBar Header |
| 76 | ============= |
| 77 | reStructuredText is **nice**. It has its own webpage_. |
| 78 | |
| 79 | A table: |
| 80 | |
| 81 | ===== ===== ====== |
| 82 | Inputs Output |
| 83 | ------------ ------ |
| 84 | A B A or B |
| 85 | ===== ===== ====== |
| 86 | False False False |
| 87 | True False True |
| 88 | False True True |
| 89 | True True True |
| 90 | ===== ===== ====== |
| 91 | |
| 92 | RST TracLinks |
| 93 | ------------- |
| 94 | |
| 95 | See also ticket |#42|. |
| 96 | |
| 97 | .. |#42| trac:: #42 |
| 98 | |
| 99 | .. _webpage: http://docutils.sourceforge.net/rst.html |
| 100 | }}} |
| 101 | |
| 102 | |
| 103 | ---- |
| 104 | See also: WikiRestructuredTextLinks, WikiProcessors, WikiFormatting |