Changes between Version 1 and Version 2 of WikiMacros


Ignore:
Timestamp:
Jun 21, 2008, 6:11:58 PM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v1 v2  
    1 =  Wiki マクロ =
    2 Wiki マクロとは、 Python で書かれた 'カスタム関数' によって Trac の Wiki エンジンを拡張するプラグインです。 WikiFormatting エンジンが利用可能なあらゆるコンテキストにおいて、マクロを使用することによって、動的な HTML データが挿入されます。
     1=  Wiki Macros =
     2Trac macros are plugins to extend the Trac engine with custom 'functions' written in Python. A macro inserts dynamic HTML data in any context supporting WikiFormatting.
    33
    4 もう 1 種類のマクロは WikiProcessors です。これは通常、Wiki以外のマークアップ形式と表示を取り扱うために使用し、多くは、 (ソースコードハイライトのような) より大きいブロックに使用します。
     4Another kind of macros are WikiProcessors. They typically deal with alternate markup formats and representation of larger blocks of information (like source code highlighting).
    55
    6 == マクロの利用 ==
    7 マクロ呼び出しは、二つの ''角括弧 (square brackets) '' で括られた箇所です。 Python 関数のように、マクロは引数を取ることができ、括弧 (parenthesis) の中に、カンマで区切ったリストで表記します。
     6== Using Macros ==
     7Macro calls are enclosed in two ''square brackets''. Like Python functions, macros can also have arguments, a comma separated list within parentheses.
    88
    9 === 利用例 ===
     9=== Examples ===
    1010
    1111{{{
    1212 [[Timestamp]]
    1313}}}
    14 は、以下のように表示されます:
     14Display:
    1515 [[Timestamp]]
    1616
     
    1818 [[HelloWorld(Testing)]]
    1919}}}
    20 は、以下のように表示されます:
     20Display:
    2121 [[HelloWorld(Testing)]]
    2222
    23 == マクロ一覧 ==
     23== Available Macros ==
    2424
    25 ''Note: 以下に示すリストはマクロドキュメントを含むものだけです。 `-OO` による最適化や、 [wiki:TracModPython mod_python] での `PythonOptimize` オプションが設定されていると表示されません。''
     25''Note that the following list will only contain the macro documentation if you've not enabled `-OO` optimizations, or not set the `PythonOptimize` option for [wiki:TracModPython mod_python].''
    2626
    2727[[MacroList]]
     
    3131The [http://trac-hacks.org/ Trac Hacks] site provides a wide collection of macros and other Trac [TracPlugins plugins] contributed by the Trac community. If you're looking for new macros, or have written one that you'd like to share with the world, please don't hesitate to visit that site.
    3232
    33 == カスタムマクロを開発する ==
    34 マクロは、 Trac 自身と同じように [http://www.python.org/ Python programming language] で書かれています。とてもシンプルなモジュールで、たった一つの `execute()` 関数だけを持ちます。マクロの識別はファイル名で行います。 Trac は、呼び出されたマクロが返却したデータをマクロが呼び出された Wiki ページの HTML に挿入して表示を行います。
     33== Developing Custom Macros ==
     34Macros, like Trac itself, are written in the [http://www.python.org/ Python programming language]. They are very simple modules, identified by the filename and should contain a single `execute()` function. Trac will display the returned data inserted into the HTML representation of the Wiki page where the macro is called.
    3535
    36 最も簡単なマクロの例です:
     36It's easiest to learn from an example:
    3737{{{
    3838#!python
     
    4343}}}
    4444
    45 Environment (`env`) オブジェクトを使用することも出来ます。この例では、コンフィグレーションとデータベースにアクセスしています:
     45You can also use the environment (`env`) object, for example to access configuration data and the database, for example:
    4646{{{
    4747#!python
     
    5050}}}
    5151
    52 Note: バージョン 0.9 以降、 Wiki マクロは TracPlugins でも書くことが出来るようになりました。これによって、 HTTP request へのダイレクトアクセスなど、 "古い" マクロでは実現できなかったことが出来るようになりました。
     52Note that since version 0.9, wiki macros can also be written as TracPlugins. This gives them some capabilities that “classic” macros do not have, such as being able to directly access the HTTP request.
    5353
    54 マクロ開発についての詳しい情報は、プロジェクトメインサイトの [http://trac.edgewall.org/wiki/TracDev 開発リソース] を参照してください。
     54For more information about developing macros, see the [http://projects.edgewall.com/trac/wiki/TracDev development resources] on the main project site.
    5555
    5656----