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