Changes between Version 1 and Version 2 of WikiMacros


Ignore:
Timestamp:
Jun 21, 2005, 1:13:36 AM (19 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v1 v2  
    1 =  Wiki Macros =
    2 Trac 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.
     1=  Wiki マクロ =
     2Wiki マクロとは、Python で書かれた 'カスタム関数' によって Trac の Wiki エンジンを拡張するプラグインです。 WikiFormatting エンジンがサポートするあらゆるコンテクストにおいて、マクロを使用することによって、動的なHTMLデータが挿入されます。
    33
    4 Another kind of macros are WikiProcessors. They typically deal with alternate markup formats and representation of larger blocks of information (like source code highlighting). See also: WikiProcessors.
     4もう1種類のマクロは WikiProcessors です。これは通常、Wiki以外のマークアップ形式と表示を取り扱うために使用し、多くは、(ソースコードハイライトのような)より大きいブロックに使用します。参考: WikiProcessors
    55
    6 == Using Macros ==
    7 Macro calls are enclosed in two ''square brackets''. Like python functions, macros can also have arguments, a comma separated list within parenthesis.
     6== マクロの利用 ==
     7マクロ呼び出しは、二つの ''角括弧 (square brackets) '' で括られた箇所です。Python関数のように、マクロは引数を取ることができ、括弧 (parenthesis) の中に、カンマで区切ったリストで表記します。
    88
    9 === Examples ===
     9=== 利用例 ===
    1010
    1111{{{
    1212 [[Timestamp]]
    1313}}}
    14 Display:
     14は、以下のように表示されます:
    1515 [[Timestamp]]
    1616
     
    1818 [[HelloWorld(Testing)]]
    1919}}}
    20 Display:
     20は、以下のように表示されます:
    2121 [[HelloWorld(Testing)]]
    2222
    2323
    24 == Available Macros ==
    25 Macros are still a new feature, and the list of available (and distributed) macros is
    26 admittedly not very impressive. In future Trac releases, we hope to build a library of useful macros, and will of course happily include contributed macros (see below).
     24== 利用可能なマクロ ==
     25マクロは現在のところ新機能の扱いです。利用可能な (そして配布対象となっている) マクロの一覧は、まだそれほど充実していません。
     26今後の Trac のリリースででは、役に立つマクロライブラリの構築を考えています。マクロを寄贈してもらえるのであれば、喜んで配布に含めます (詳しくは下をご覧下さい) 。
    2727
    28  * '''!HelloWorld''' -- An example macro, useful for learning how to write macros.
    29  * '''Timestamp''' -- Insert the current date and time.
     28 * '''HelloWorld''' -- マクロの例。これからマクロを書きたいときに参考になります。
     29 * '''Timestamp''' -- 現在の日時を挿入する。
    3030
    3131
     
    4242
    4343
    44 == Developing New Macros ==
    45 Macros, 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 ''entry point'' function. Trac will display the returned data inserted into the HTML where the macro was called.
     44== 新しいマクロを開発する ==
     45マクロは、 Trac 自身と同じように [http://www.python.org/ Python programming language] で書かれています。とてもシンプルなモジュールで、たった一つの ''インタフェース (entry point) '' 関数だけを持ちます。マクロの識別はファイル名で行います。Trac は、呼び出されたマクロが返却したデータをHTMLに挿入して表示を行います。
    4646
    47 It's easiest to learn from an example:
     47最も簡単なマクロの例です:
    4848{{{
    4949# MyMacro.py -- The world's simplest macro
     
    5353}}}
    5454
    55 === Advanced Topics: Template-enabled Macros ===
    56 For advanced uses, macros can also render structured output in HDF, to be rendered to HTML using clearsilver templates - like most Trac output. In short, this allows more generic and well-designed advanced macros.
     55=== 上級トピック: Template-enabled Macros ===
     56高度な用途のために、マクロでは HDF 形式での構造化出力をサポートしています。これは、 Trac が生成するページと同じように clearSilver テンプレートを使って HTML を生成することができます。要するに、これは普遍的かつ、よく設計された高度なマクロを可能にします。
    5757
    58 Macros gain direct access to the main HDF tree, and are free to manipulate it.
     58マクロでは、メインとなる HDF ツリーに直接アクセスし、自由に操作することができます。
    5959
    60 Example:
     60:
    6161{{{
    6262def execute(hdf, args, env):
     
    7171}}}
    7272
    73 You can also use the environment (env) object to access configuration data.
     73また、environment (env) オブジェクトによって、コンフィグデータへのアクセスも提供されています。
    7474
    75 Example.
     75例:
    7676{{{
    7777def execute(hdf, txt, env):
     
    7979}}}
    8080----
    81 See also:  WikiProcessors, WikiFormatting, TracGuide
     81参考:  WikiProcessors, WikiFormatting, TracGuide