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
-
supported_image_types
= []¶ 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
= None¶ default translator class for the builder. This can be overridden by
app.set_translator()
.
これらのメソッドは事前に定義されており、アプリケーションから呼び出されます。
-
get_relative_uri
(from_: str, to: str, typ: str = None) → str[ソース]¶ 2つのソースファイル間の相対URIを返します。
URIを返す方法がない場合には、 environment.NoUri 例外を投げる場合があります。
-
build
(docnames: Iterable[str], summary: str = None, method: str = 'update') → None[ソース]¶ メインのビルド用メソッドです。
最初に環境をアップデートしてから、
write()
を呼びます。
これらのメソッドは派生されたビルダークラス側でオーバーライドできます:
-
get_outdated_docs
() → Union[str, Iterable[str]][ソース]¶ ビルドが必要な、古いファイルを返すイテレータを返します。言い換えると、アップデートビルドを行うと、何がビルドされるか、というのを説明する文字列を返します。
もしもビルダーがソースファイルに関連する、個別のファイルを出力しない場合には、ここでは文字列を返してください。その場合には、書かれるべきファイルのイテレータを返します。
-
get_target_uri
(docname: str, typ: str = None) → str[ソース]¶ ドキュメント名に関連する、対象のURLを返します。
typ はそれぞれのビルダーごとのリンクの修飾子として使うことができます。
-
prepare_writing
(docnames: Set[str]) → None[ソース]¶ write_doc()
が実行される前に実行したい動作を記述する場所です。
-
write_doc
(docname: str, doctree: docutils.nodes.document) → None[ソース]¶ ファイルシステムに実際になにかを書き込む際に使う場所です。
属性
-
events
¶ An
EventManager
object.
-