WikiRestructuredTextバージョン 1バージョン 2 との変更


以下の違いを無視:
日時:
2015/05/27 0:24:03 (11年前)
更新者:
trac
コメント:

--

凡例:

変更なし
追加
削除
更新
  • 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.
    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
     3Trac は WikiFormatting を使用できるすべての箇所で、 Wiki マークアップの代わりに ''reStructuredText'' を使用することができます。
     4
     5reStructuredText の Web ページより:
     6 "''reStructuredText は読みやすく、 WYSIWYG なプレーンテキストへのマークアップ文法と、そのパーサシステムです。 (Python の docstring のような) プログラムへのインラインドキュメンテーションや、シンプルな Web ページの素早い作成、スタンドアロンのドキュメントの記述に役立ちます。 reStructuredText は個別のアプリケーション向けに拡張ができるように設計されています。''"
     7
     8Subversion リポジトリのファイルを reStructuredText として Trac のソースブラウザに表示したい場合、 Subversion の `svn:mime-type` 属性に `text/x-rst` を設定してください。 [http://trac.edgewall.org/browser/trunk/INSTALL この例] が参考になります。
     9
     10=== 必須条件 === #Requirements
     11Trac で RST を使うためには、 Python の docutils パッケージがインストールされていなければなりません。
     12あなたのオペレーティングシステムでまだ使用できない場合は、 [http://docutils.sourceforge.net/rst.html RST Website] からダウンロードすることができます。
     13
     14docutils のインストールには `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
    2020
    2121----
    2222
    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 マークアップ ||= 表示 ||
    7979{{{#!td
    8080  {{{
     
    8888         def TestFunction(self):
    8989             pass
    90  
     90
    9191  }}}
    9292  }}}
     
    105105  }}}
    106106}}}
    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 マークアップ ||= 表示 ||
    114114{{{#!td
    115115  {{{
     
    135135}}}
    136136
    137 Or a more concise Wiki Macro like syntax is also available, using the `:code-block:` role:
    138 
    139 ||= Wiki Markup ||= Display ||
     137`:code-block:` を使って、より簡素な構文でも Wiki マクロを利用できます:
     138
     139||= Wiki マークアップ ||= 表示 ||
    140140{{{#!td
    141141  {{{
     
    155155}}}
    156156
    157 === Bigger RST Example ===
    158 The example below should be mostly self-explanatory:
    159 
    160 ||= Wiki Markup ||= Display ||
     157=== より大きい RST の例 === #BiggerRSTExample
     158この例のように書くと、とても分かりやすくなります:
     159
     160||= Wiki マークアップ ||= 表示 ||
    161161{{{#!td
    162162{{{
     
    164164<pre class="wiki">{{{
    165165#!rst
    166 FooBar Header
    167 =============
    168 reStructuredText is **nice**. It has its own webpage_.
    169 
    170 A table:
    171 
    172 =====  =====  ======
    173    Inputs     Output
    174 ------------  ------
    175   A      B    A or B
    176 =====  =====  ======
    177 False  False  False
    178 True   False  True
    179 False  True   True
    180 True   True   True
    181 =====  =====  ======
    182 
    183 RST TracLinks
    184 -------------
    185 
    186 See also ticket `#42`:trac:.
     166ほげほげヘッダ
     167==============
     168reStructuredText は **素敵** 。この続きは webpage_ で。
     169
     170:
     171
     172==  ==  ======
     173 入力    出力
     174------  ------
     175A   B   A or B
     176==  ==  ======
     177偽  偽    偽
     178真  偽    真
     179偽  真    真
     180真  真    真
     181==  ==  ======
     182
     183RST での TracLinks
     184------------------
     185
     186チケット `[trac:#42]`:trac: のように使用します。
    187187
    188188.. _webpage: http://docutils.sourceforge.net/rst.html
     
    193193{{{
    194194#!rst
    195 FooBar Header
    196 =============
    197 reStructuredText is **nice**. It has its own webpage_.
    198 
    199 A table:
    200 
    201 =====  =====  ======
    202    Inputs     Output
    203 ------------  ------
    204   A      B    A or B
    205 =====  =====  ======
    206 False  False  False
    207 True   False  True
    208 False  True   True
    209 True   True   True
    210 =====  =====  ======
    211 
    212 RST TracLinks
    213 -------------
    214 
    215 See also ticket `#42`:trac:.
     195ほげほげヘッダ
     196==============
     197reStructuredText は **素敵** 。この続きは webpage_ で。
     198
     199:
     200
     201==  ==  ======
     202 入力    出力
     203------  ------
     204A   B   A or B
     205==  ==  ======
     206偽  偽    偽
     207真  偽    真
     208偽  真    真
     209真  真    真
     210==  ==  ======
     211
     212RST での TracLinks
     213------------------
     214
     215チケット `[trac:#42]`:trac: のように使用します。
    216216
    217217.. _webpage: http://docutils.sourceforge.net/rst.html
    218218}}}
    219219}}}
     220
     221'''訳注: 日本語でテーブルを作成する場合、 Python-2.4 以降かつ docutils-0.4 以降でない場合は、 docutils に日本語テーブルパッチを適用する必要があります。'''
    220222
    221223----