Builder API¶
課題
もっと拡張すること。
- class sphinx.builders.Builder[ソース]¶
このクラスはすべてのビルダーのベースクラスです。
These attributes should be set on builder classes:
- name = ''¶
The builder's name, for the -b command line option.
- format = ''¶
The builder's output format, or '' if no document output is produced.
- epilog = ''¶
The message emitted upon successful build completion. This can be a printf-style template string with the following keys:
outdir
,project
- allow_parallel = False¶
allow parallel write_doc() calls
- supported_image_types: list[str] = []¶
The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here.
- supported_remote_images = False¶
The builder supports remote images or not.
- supported_data_uri_images = False¶
The builder supports data URIs or not.
- default_translator_class: type[nodes.NodeVisitor]¶
default translator class for the builder. This can be overridden by
set_translator()
.
これらのメソッドは事前に定義されており、アプリケーションから呼び出されます。
- get_relative_uri(from_: str, to: str, typ: str | None = None) str [ソース]¶
2つのソースファイル間の相対URIを返します。
URIを返す方法がない場合には、 environment.NoUri 例外を投げる場合があります。
- build(docnames: Iterable[str] | None, summary: str | None = None, method: str = 'update') None [ソース]¶
メインのビルド用メソッドです。
First updates the environment, and then calls
write()
.
これらのメソッドは派生されたビルダークラス側でオーバーライドできます:
- get_outdated_docs() str | Iterable[str] [ソース]¶
ビルドが必要な、古いファイルを返すイテレータを返します。言い換えると、アップデートビルドを行うと、何がビルドされるか、というのを説明する文字列を返します。
もしもビルダーがソースファイルに関連する、個別のファイルを出力しない場合には、ここでは文字列を返してください。その場合には、書かれるべきファイルのイテレータを返します。
- get_target_uri(docname: str, typ: str | None = None) str [ソース]¶
ドキュメント名に関連する、対象のURLを返します。
typ はそれぞれのビルダーごとのリンクの修飾子として使うことができます。
属性
- events¶
EventManager
オブジェクト。