Changes between Version 5 and Version 6 of WikiProcessors

Show
Ignore:
Timestamp:
01/28/10 04:25:37 (8 months ago)
Author:
trac (IP: 127.0.0.1)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiProcessors

    v5 v6  
    1 = Wiki プロセッサ = 
     1= Wiki Processors = 
    22 
    3 プロセッサは [TracWiki Trac Wiki エンジン] が、 Wiki 以外のフォーマットを提供するために設計された WikiMacros です。プロセッサは ''ユーザが編集したテキストを処理するマクロ機能'' と考えることができます。 
     3Processors 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''.  
    44 
    5 Trac 内の全ての Wiki テキストにおいて、 [wiki:WikiRestructuredText Restructured Text], [wiki:WikiHtml raw HTML] および [http://www.textism.com/tools/textile/ textile] をプロセッサとして使用することができます。 
     5The 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. 
    66 
    7 == プロセッサを使用する == 
    87 
    9 テキストブロックでプロセッサを使うには、 Wiki のコードブロックを使用し、プロセッサの名前を (Unix 系 OS のスクリプトのように) ''shebang 行'' (#!) に続いて指定します。 
     8== Using Processors == 
    109 
    11 '''例1''' (''Wiki テキストに 生 HTML を挿入する''): 
     10To 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''): 
    1213 
    1314{{{ 
     
    1516<pre class="wiki">{{{ 
    1617#!html 
    17 &lt;h1 style="color: orange"&gt;これは生 HTML です&lt;/h1&gt; 
     18&lt;h1 style="color: orange"&gt;This is raw HTML&lt;/h1&gt; 
    1819}}}</pre> 
    1920}}} 
    2021 
    21 '''結果、このように表示されます:''' 
     22'''Results in:''' 
    2223{{{ 
    2324#!html 
    24 <h1 style="color: orange">これは生 HTML です</h1> 
     25<h1 style="color: orange">This is raw HTML</h1> 
    2526}}} 
     27 
     28Note that since 0.11, such blocks of HTML have to be self-contained, i.e. you can't start an HTML element in one block and close it later in a second block. Use div or span processors for achieving similar effect (see WikiHtml). 
    2629 
    2730---- 
    2831 
    29 '''例2''' (''Wiki テキストに !ReStructured テキストを挿入する''): 
     32'''Example 2''' (''inserting Restructured Text in wiki text''): 
    3033 
    3134{{{ 
     
    3336<pre class="wiki">{{{ 
    3437#!rst 
    35 見出し 
    36 ------ 
    37 脚注 [*]_ 付きの **text** です。 
     38A header 
     39-------- 
     40This is some **text** with a footnote [*]_. 
    3841 
    39 .. [*] ここは脚注。 
     42.. [*] This is the footnote. 
    4043}}}</pre> 
    4144}}} 
    4245 
    43 '''結果、このように表示されます:''' 
     46'''Results in:''' 
    4447{{{ 
    4548#!rst 
    46 見出し 
    47 ------ 
    48 脚注 [*]_ 付きの **text** です。 
     49A header 
     50-------- 
     51This is some **text** with a footnote [*]_. 
    4952 
    50 .. [*] ここは脚注。 
     53.. [*] This is the footnote. 
    5154}}} 
    52 (訳注: !ReStructuredText は国際化が甘いので、使えないかもしれません) 
    5355---- 
    54 '''例3''' (''Wiki テキストに C 言語ソースコードブロックを挿入する''): 
     56'''Example 3''' (''inserting a block of C source code in wiki text''): 
    5557 
    5658{{{ 
     
    6668}}} 
    6769 
    68 '''結果、このように表示されます:''' 
     70'''Results in:''' 
    6971{{{ 
    7072#!c 
     
    7880---- 
    7981 
    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] を参照。 
     82== Available Processors == 
     83The following processors are included in the Trac distribution: 
     84 * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml. 
     85 * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml. 
     86 * '''span''' -- Wrap an arbitrary Wiki content in a <span> element (''since 0.11''). See also WikiHtml. 
     87 * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText. 
     88 * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference]. 
     89 * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). 
    8590 
    86 上記の Textile のリンクは切れています。 [http://www.textism.com/tools/textile/ このサイト] は動いていて、試しに使ってみることが可能です。 
    87  
    88 === ソースコードの強調表示対応 === 
    89 Trac では、以下のプログラミング言語でのインライン [wiki:TracSyntaxColoring シンタックスハイライト] を行うプロセッサが組み込まれています。 
     91=== Code Highlighting Support === 
     92Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages: 
    9093 * '''c''' -- C 
    9194 * '''cpp''' -- C++ 
     
    9497 * '''ruby''' -- Ruby 
    9598 * '''php''' -- PHP 
    96  * '''asp''' --- ASP 
     99 * '''asp''' -- ASP 
     100 * '''java''' -- Java 
     101 * '''js''' -- Javascript 
    97102 * '''sql''' -- SQL 
    98103 * '''xml''' -- XML 
    99 '''Note:''' ''Trac はシンタックスの色付けを、外部のソフトウェアパッケージに依存しています。詳しくは TracSyntaxColoring をご覧下さい。'' 
     104 * '''sh''' -- Bourne/Bash shell 
    100105 
    101 プロセッサとして mime-type が指定されると、ソースコードをブラウズするときと同じく、対応されている言語であれば、シンタックスハイライトを行うことができます。例えば、以下のように書くと: 
     106'''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.'' 
     107 
     108By 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: 
    102109{{{ 
    103110{{{ 
     
    107114}}} 
    108115 
    109 この結果はシンタックスハイライトされた HTML コードになります。対応している全ての mime-type でも、これは同じく有効です。 
     116The result will be syntax highlighted HTML code: 
     117{{{ 
     118#!text/html 
     119<h1>text</h1> 
     120}}} 
     121 
     122The same is valid for all other mime types supported. 
    110123 
    111124 
    112 ユーザによるプロセッサマクロの開発やコントリビュート: 
    113  * [http://trac.edgewall.org/wiki/ProcessorBazaar ProcessorBazaar] 
    114  * [http://trac.edgewall.org/wiki/MacroBazaar MacroBazaar] 
     125For more processor macros developed and/or contributed by users, visit:  
     126 * [trac:ProcessorBazaar] 
     127 * [trac:MacroBazaar] 
     128 * [th:WikiStart Trac Hacks] community site 
    115129 
    116130 
    117 == 上級トピック: プロセッサマクロを開発する == 
    118 プロセッサの開発は WikiMacros と違いはありません。事実、これらは同じような機能を持ち、シンタックスだけが異なります。詳しくは WikiMacros に記述します。 
     131== Advanced Topics: Developing Processor Macros == 
     132Developing processors is no different from Wiki macros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information. 
    119133 
    120 '''例:''' (''Restructured テキストプロセッサ''): 
    121 {{{ 
    122 #!python 
    123 from docutils.core import publish_string 
    124  
    125 def execute(hdf, text, env): 
    126     html = publish_string(text, writer_name = 'html') 
    127     return html[html.find('<body>')+6:html.find('</body>')].strip() 
    128 }}} 
    129134 
    130135----