| 1 | | = reStructuredText Support in Trac = |
| 2 | | |
| 3 | | Trac supports using ''reStructuredText'' (RST) as an alternative to wiki markup in any context 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 | | 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 |
| | 1 | = Trac での reStructuredText 対応 = #reStructuredTextSupportinTrac |
| | 2 | |
| | 3 | Trac は WikiFormatting を使用できるすべての箇所で、 Wiki マークアップの代わりに ''reStructuredText'' を使用することができます。 |
| | 4 | |
| | 5 | reStructuredText の Web ページより: |
| | 6 | "''reStructuredText は読みやすく、 WYSIWYG なプレーンテキストへのマークアップ文法と、そのパーサシステムです。 (Python の docstring のような) プログラムへのインラインドキュメンテーションや、シンプルな Web ページの素早い作成、スタンドアロンのドキュメントの記述に役立ちます。 reStructuredText は個別のアプリケーション向けに拡張ができるように設計されています。''" |
| | 7 | |
| | 8 | Subversion リポジトリのファイルを reStructuredText として Trac のソースブラウザに表示したい場合、 Subversion の `svn:mime-type` 属性に `text/x-rst` を設定してください。 [http://trac.edgewall.org/browser/trunk/INSTALL この例] が参考になります。 |
| | 9 | |
| | 10 | === 必須条件 === #Requirements |
| | 11 | Trac で RST を使うためには、 Python の docutils パッケージがインストールされていなければなりません。 |
| | 12 | あなたのオペレーティングシステムでまだ使用できない場合は、 [http://docutils.sourceforge.net/rst.html RST Website] からダウンロードすることができます。 |
| | 13 | |
| | 14 | docutils のインストールには `easy_install docutils` を使用してください。 Trac が docutils パッケージを探すことが出来ない可能性があるので、 (`apt-get install python-docutils` などの) OS のパッケージマネージャは使わないでください。('''訳注:''' docutils が提供している `setup.py` では `setuptools` を使用していないため、 OS のパッケージでは `docutils-*.egg-info` が作成されない場合があることを指しています。 egg-info さえ作成されていれば OS のパッケージマネージャを使用しても問題ないと思われます。) |
| | 15 | |
| | 16 | === さらなる RST に関する情報 === #MoreinformationonRST |
| | 17 | |
| | 18 | * reStructuredText Web サイト -- http://docutils.sourceforge.net/rst.html |
| | 19 | * RST クイックリファレンス -- http://docutils.sourceforge.net/docs/rst/quickref.html |
| 23 | | == Using RST in Trac == |
| 24 | | To specify that a block of text should be parsed using RST, use the ''rst'' processor. |
| 25 | | |
| 26 | | === TracLinks in reStructuredText === |
| 27 | | |
| 28 | | * Trac provides a custom RST directive `trac::` to allow TracLinks from within RST text. |
| 29 | | ||= Wiki Markup ||= Display || |
| 30 | | {{{#!td |
| 31 | | {{{ |
| 32 | | {{{ |
| 33 | | #!rst |
| 34 | | This is a reference to |a ticket| |
| 35 | | |
| 36 | | .. |a ticket| trac:: #42 |
| 37 | | }}} |
| 38 | | }}} |
| 39 | | }}} |
| 40 | | {{{#!td |
| 41 | | {{{ |
| 42 | | #!rst |
| 43 | | This is a reference to |a ticket| |
| 44 | | |
| 45 | | .. |a ticket| trac:: #42 |
| 46 | | }}} |
| 47 | | }}} |
| 48 | | |
| 49 | | * Trac allows an even easier way of creating TracLinks in RST, using the custom `:trac:` role. |
| 50 | | ||= Wiki Markup ||= Display || |
| 51 | | {{{#!td |
| 52 | | {{{ |
| 53 | | {{{ |
| 54 | | #!rst |
| 55 | | This is a reference to ticket `#12`:trac: |
| 56 | | |
| 57 | | To learn how to use Trac, see `TracGuide`:trac: |
| 58 | | }}} |
| 59 | | }}} |
| 60 | | }}} |
| 61 | | {{{#!td |
| 62 | | {{{ |
| 63 | | #!rst |
| 64 | | This is a reference to ticket `#12`:trac: |
| 65 | | |
| 66 | | To learn how to use Trac, see `TracGuide`:trac: |
| 67 | | }}} |
| 68 | | }}} |
| 69 | | |
| 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 || |
| | 23 | == RST を Trac で使用する == #UsingRSTinTrac |
| | 24 | テキストブロックが RST でパースされるようにするには、 ''rst'' プロセッサを使用してください。 |
| | 25 | |
| | 26 | === reStructuredText における TracLinks === #TracLinksinreStructuredText |
| | 27 | |
| | 28 | * Trac は RST テキストの中で TracLinks が可能になる、 RST のディレクティブ 'trac' を提供しています |
| | 29 | ||= Wiki マークアップ ||= 表示 || |
| | 30 | {{{#!td |
| | 31 | {{{ |
| | 32 | {{{ |
| | 33 | #!rst |
| | 34 | これは |チケット| へのリンクです。 |
| | 35 | |
| | 36 | .. |チケット| trac:: #42 |
| | 37 | }}} |
| | 38 | }}} |
| | 39 | }}} |
| | 40 | {{{#!td |
| | 41 | {{{ |
| | 42 | #!rst |
| | 43 | これは |チケット| へのリンクです。 |
| | 44 | |
| | 45 | .. |チケット| trac:: #42 |
| | 46 | }}} |
| | 47 | }}} |
| | 48 | |
| | 49 | * Trac は RST で TracLinks を簡単に作成できるように、 `:trac:` というロールを予約しています |
| | 50 | ||= Wiki マークアップ ||= 表示 || |
| | 51 | {{{#!td |
| | 52 | {{{ |
| | 53 | {{{ |
| | 54 | #!rst |
| | 55 | これはチケット `#12`:trac: へのリンクです。 |
| | 56 | |
| | 57 | Trac の使い方を学ぶためには、 `TracGuide`:trac: を参照して下さい。 |
| | 58 | }}} |
| | 59 | }}} |
| | 60 | }}} |
| | 61 | {{{#!td |
| | 62 | {{{ |
| | 63 | #!rst |
| | 64 | これはチケット `#12`:trac: へのリンクです。 |
| | 65 | |
| | 66 | Trac の使い方を学ぶためには、 `TracGuide`:trac: を参照して下さい。 |
| | 67 | }}} |
| | 68 | }}} |
| | 69 | |
| | 70 | `:trac:` ロールのすべての使用例の一覧は、 WikiRestructuredTextLinks を見てください。 |
| | 71 | |
| | 72 | |
| | 73 | === reStructuredText におけるシンタックスハイライト === #SyntaxhighlightinginreStructuredText |
| | 74 | |
| | 75 | 同様に、 RST において TracSyntaxColoring を行なうディレクティブがあります。 |
| | 76 | ディレクティブは code-block と呼ばれます。 |
| | 77 | |
| | 78 | ||= Wiki マークアップ ||= 表示 || |
| 107 | | Note the need to indent the code at least one character after the `.. code-block` directive. |
| 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. |
| 112 | | |
| 113 | | ||= Wiki Markup ||= Display || |
| | 107 | `.. code-block` ディレクティブの後のコードは少なくとも1文字インデントする必要があります。 |
| | 108 | |
| | 109 | === reStructuredText の中における Wiki Macros === #WikiMacrosinreStructuredText |
| | 110 | |
| | 111 | [WikiMacros Wiki マクロ] を RST の中で使用するには、 code-block のようなシンタックスハイライトと同様のディレクティブを使用します。 |
| | 112 | |
| | 113 | ||= Wiki マークアップ ||= 表示 || |