Changes between Version 2 and Version 3 of WikiProcessors
- Timestamp:
- Dec 31, 2005, 4:43:10 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiProcessors
v2 v3 1 = Wiki プロセッサ=2 プロセッサは Trac の Wiki エンジンが、 Wiki 以外のフォーマットを提供するために設計された WikiMacros です。プロセッサは、 ''ユーザが編集したテキストを処理するマクロ機能'' と考えることができます。 1 = Wiki Processors = 2 Processors are WikiMacros designed to provide alternative markup formats for the Trac Wiki engine. Processors can be thought of as ''macro functions to process user-edited text''. 3 3 4 T rac 内の全ての Wiki テキストにおいて、 [wiki:WikiRestructuredText Restructured Text] および [wiki:WikiHtml raw HTML] をプロセッサとして使用することができます。4 The wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text] and [wiki:WikiHtml raw HTML] in any wiki text throughout Trac. 5 5 6 == プロセッサの利用法==7 テキストブロックでプロセッサを使うには、 Wiki の引用ブロックを使用し、プロセッサの名前を (Unix 系 OS のスクリプトのように) 'sharbang行' (#!) に続いて指定します。 6 == Using Processors == 7 To use a processor on a block of text, use a wiki blockquote, selecting a processor by name using ''shebang notation'' (#!), familiar to most UNIX users from scripts. 8 8 9 ''' 例1''' (''Wiki テキストに 生 HTML を挿入する''):9 '''Example 1''' (''inserting raw HTML in a wiki text''): 10 10 11 11 {{{ … … 13 13 <pre class="wiki">{{{ 14 14 #!html 15 <h1 style="color: orange"> これは生 HTML です</h1>15 <h1 style="color: orange">This is raw HTML</h1> 16 16 }}}</pre> 17 17 }}} 18 18 19 ''' 結果、このように表示されます:'''19 '''Results in:''' 20 20 {{{ 21 21 #!html 22 <h1 style="color: orange"> これは生 HTML です</h1>22 <h1 style="color: orange">This is raw HTML</h1> 23 23 }}} 24 24 25 25 ---- 26 26 27 ''' 例2''' (''Wiki テキストに !ReStructured テキストを挿入する''):27 '''Example 2''' (''inserting Restructured Text in wiki text''): 28 28 29 29 {{{ … … 31 31 <pre class="wiki">{{{ 32 32 #!rst 33 見出し 34 ------ 35 脚注 [*]_ 付きの **text** です。 33 A header 34 -------- 35 This is some **text** with a footnote [*]_. 36 36 37 .. [*] ここは脚注。37 .. [*] This is the footnote. 38 38 }}}</pre> 39 39 }}} 40 40 41 ''' 結果、このように表示されます:'''41 '''Results in:''' 42 42 {{{ 43 43 #!rst 44 見出し 45 ------ 46 脚注 [*]_ 付きの **text** です。 44 A header 45 -------- 46 This is some **text** with a footnote [*]_. 47 47 48 .. [*] ここは脚注。48 .. [*] This is the footnote. 49 49 }}} 50 (訳注: !ReStructuredText は国際化が甘いので、使えないかもしれません)51 50 ---- 52 ''' 例3''' (''Wiki テキストに C 言語ソースコードブロックを挿入する''):51 '''Example 3''' (''inserting a block of C source code in wiki text''): 53 52 54 53 {{{ … … 64 63 }}} 65 64 66 ''' 結果、このように表示されます:'''65 '''Results in:''' 67 66 {{{ 68 67 #!c … … 76 75 ---- 77 76 77 == Available Processors == 78 The following processors are included in the Trac distribution: 79 * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. 80 * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. 81 * '''textile''' -- Supported if [http://dealmeida.net/projects/textile/ Textile] is installed. 78 82 79 80 == 利用可能なプロセッサ == 81 以下のプロセッサが Trac の配布に含まれています: 82 * '''html''' -- Wiki ページにカスタム HTML を挿入する。 WikiHtml を参照してください。 83 * '''rst''' -- Restructured テキスト を Trac でサポートする。 WikiRestructuredText を参照してください。 84 * '''textile''' -- 2004年8月2日にサポートを開始したばかり。 [http://projects.edgewall.com/trac/ticket/593 ticket 593] および [http://dealmeida.net/projects/textile/ Textile] を参照してください。 85 86 === ソースコードのサポート === 87 Trac では、以下のプログラミング言語でのインライン [wiki:TracSyntaxColoring syntax ハイライト] を行うプロセッサを内蔵しています。 83 === Code Highlighting Support === 84 Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages: 88 85 * '''c''' -- C 89 86 * '''cpp''' -- C++ … … 95 92 * '''sql''' -- SQL 96 93 * '''xml''' -- XML 97 '''Note:''' ''Trac はシンタックスの色付けを、外部のソフトウェアパッケージに依存しています。詳しくは TracSyntaxColoring をご覧下さい。''94 '''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' 98 95 99 プロセッサ使用時に mime-type が指定されると、ソースコードをブラウズする際に可能な限り同じ言語で、シンタックスハイライトを行います。(mime-type のリストは [http://projects.edgewall.com/trac/browser/trunk/trac/Mimeview.py Mimeview.py] にあります) 100 101 例えば、以下のように書くと: 102 96 By using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write: 103 97 {{{ 104 98 {{{ … … 108 102 }}} 109 103 110 この結果はシンタックスハイライトされた HTML コードになります。サポートされている全ての mime-type でも、これは同じく有効です。 104 The result will be syntax highlighted HTML code. The same is valid for all other mime types supported. 111 105 112 106 107 For more processor macros developed and/or contributed by users, visit: 108 * [http://projects.edgewall.com/trac/wiki/ProcessorBazaar ProcessorBazaar] 109 * [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] 113 110 114 プロセッサマクロの開発やユーザによるコントリビュートのため、マクロバザールが開かれています:115 http://projects.edgewall.com/trac/wiki/MacroBazaar116 111 117 ---- 118 == 上級トピック: プロセッサマクロを開発する == 119 プロセッサの開発は WikiMacros と違いはありません。事実、これらは同じような機能を持ち、シンタックスだけが異なります。詳しくは WikiMacros に記述します。 112 == Advanced Topics: Developing Processor Macros == 113 Developing processors is no different than WikiMacros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information. 120 114 121 ''' 例:''' (''Restructured テキストプロセッサ''):115 '''Example:''' (''Restructured Text Processor''): 122 116 {{{ 123 117 from docutils.core import publish_string … … 129 123 130 124 ---- 131 参考: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide125 See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuide