設定¶
The configuration directory must contain a file named conf.py.
This file (containing Python code) is called the "build configuration file"
and contains (almost) all configuration needed to customise Sphinx input
and output behaviour.
An optional file docutils.conf can be added to the configuration directory to adjust Docutils configuration if not otherwise overridden or set by Sphinx.
詳細に説明するにあたっての注意点を列挙します。
特別に指定されていない場合には、設定値は文字列型になります。また、指定されていない場合のデフォルト値は空文字列です。
The term "fully-qualified name" (FQN) refers to a string that names an importable Python object inside a module; for example, the fully-qualified name
"sphinx.builders.Builder"means theBuilderclass in thesphinx.buildersmodule.Document names use
/as the path separator and do not contain the file name extension.
Where glob-style patterns are permitted, you can use the standard shell constructs (
*,?,[...], and[!...]) with the feature that none of these will match slashes (/). A double star**can be used to match any sequence of characters including slashes.
Tip
The configuration file is executed as Python code at build time
(using importlib.import_module(), with the current directory set
to the configuration directory),
and therefore can execute arbitrarily complex code.
Sphinx then reads simple names from the file's namespace as its configuration. In general, configuration values should be simple strings, numbers, or lists or dictionaries of simple values.
The contents of the config namespace are pickled (so that Sphinx can find out
when configuration changes), so it may not contain unpickleable values --
delete them from the namespace with del if appropriate.
Modules are removed automatically, so deleting imported modules is not needed.
プロジェクト情報¶
- project¶
- タイプ:
str- デフォルト:
'Project name not set'
The documented project's name. Example:
project = 'Thermidor'
- author¶
- タイプ:
str- デフォルト:
'Author name not set'
The project's author(s). Example:
author = 'Joe Bloggs'
- copyright¶
- project_copyright¶
- タイプ:
str | Sequence[str]- デフォルト:
''
A copyright statement. Permitted styles are as follows, where 'YYYY' represents a four-digit year.
copyright = 'YYYY'copyright = 'YYYY, Author Name'copyright = 'YYYY Author Name'copyright = 'YYYY-YYYY, Author Name'copyright = 'YYYY-YYYY Author Name'
If the string
'%Y'appears in a copyright line, it will be replaced with the current four-digit year. For example:copyright = '%Y'copyright = '%Y, Author Name'copyright = 'YYYY-%Y, Author Name'
Added in version 3.5: The
project_copyrightalias.バージョン 7.1 で変更: The value may now be a sequence of copyright statements in the above form, which will be displayed each to their own line.
バージョン 8.1 で変更: Copyright statements support the
'%Y'placeholder.
- version¶
- タイプ:
str- デフォルト:
''
The major project version, used as the replacement for the
|version|default substitution.This may be something like
version = '4.2'. The full project version is defined inrelease.If your project does not draw a meaningful distinction between between a 'full' and 'major' version, set both
versionandreleaseto the same value.
- release¶
- タイプ:
str- デフォルト:
''
The full project version, used as the replacement for the
|release|default substitution, and e.g. in the HTML templates.This may be something like
release = '4.2.1b0'. The major (short) project version is defined inversion.If your project does not draw a meaningful distinction between between a 'full' and 'major' version, set both
versionandreleaseto the same value.
一般的な設定¶
- needs_sphinx¶
- タイプ:
str- デフォルト:
''
Set a minimum supported version of Sphinx required to build the project. The format should be a
'major.minor'version string like'1.1'Sphinx will compare it with its version and refuse to build the project if the running version of Sphinx is too old. By default, there is no minimum version.Added in version 1.0.
バージョン 1.4 で変更: Allow a
'major.minor.micro'version string.
- extensions¶
- タイプ:
list[str]- デフォルト:
[]
A list of strings that are module names of Sphinx extensions. These can be extensions bundled with Sphinx (named
sphinx.ext.*) or custom first-party or third-party extensions.To use a third-party extension, you must ensure that it is installed and include it in the
extensionslist, like so:extensions = [ ... 'numpydoc', ]
There are two options for first-party extensions. The configuration file itself can be an extension; for that, you only need to provide a
setup()function in it. Otherwise, you must ensure that your custom extension is importable, and located in a directory that is in the Python path.Ensure that absolute paths are used when modifying
sys.path. If your custom extensions live in a directory that is relative to the configuration directory, usepathlib.Path.resolve()like so:import sys from pathlib import Path sys.path.append(str(Path('sphinxext').resolve())) extensions = [ ... 'extname', ]
The directory structure illustrated above would look like this:
<project directory>/ ├── conf.py └── sphinxext/ └── extname.py
- needs_extensions¶
- タイプ:
dict[str, str]- デフォルト:
{}
If set, this value must be a dictionary specifying version requirements for extensions in
extensions. The version strings should be in the'major.minor'form. Requirements do not have to be specified for all extensions, only for those you want to check. Example:needs_extensions = { 'sphinxcontrib.something': '1.5', }
This requires that the extension declares its version in the
setup()function. See Sphinx API for further details.Added in version 1.3.
- manpages_url¶
- タイプ:
str- デフォルト:
''
A URL to cross-reference
manpageroles. If this is defined tohttps://manpages.debian.org/{path}, the:manpage:`man(1)`role will link to <https://manpages.debian.org/man(1)>. The patterns available are:pageThe manual page (
man)sectionThe manual section (
1)pathThe original manual page and section specified (
man(1))
This also supports manpages specified as
man.1.# To use manpages.debian.org: manpages_url = 'https://manpages.debian.org/{path}' # To use man7.org: manpages_url = 'https://man7.org/linux/man-pages/man{section}/{page}.{section}.html' # To use linux.die.net: manpages_url = 'https://linux.die.net/man/{section}/{page}' # To use helpmanual.io: manpages_url = 'https://helpmanual.io/man{section}/{page}'
Added in version 1.7.
- today¶
- today_fmt¶
These values determine how to format the current date, used as the replacement for the
|today|default substitution.もし
todayに空ではない値が設定されたらそれが使用されます。そうでない場合には、
today_fmtで与えられたフォーマットを使い、time.strftime()で生成された値が使用されます。
The default for
todayis'', and the default fortoday_fmtis'%b %d, %Y'(or, if translation is enabled withlanguage, an equivalent format for the selected locale).
Options for figure numbering¶
- numfig¶
- タイプ:
bool- デフォルト:
False
If
True, figures, tables and code-blocks are automatically numbered if they have a caption. Thenumrefrole is enabled. Obeyed so far only by HTML and LaTeX builders.注釈
このオプションを有効にしていてもいなくても、LaTeXビルダーは常に番号を振ります。
Added in version 1.3.
- numfig_format¶
- タイプ:
dict[str, str]- デフォルト:
{}
A dictionary mapping
'figure','table','code-block'and'section'to strings that are used for format of figure numbers. The marker%swill be replaced with the figure number.The defaults are:
numfig_format = { 'code-block': 'Listing %s', 'figure': 'Fig. %s', 'section': 'Section', 'table': 'Table %s', }
Added in version 1.3.
- numfig_secnum_depth¶
- タイプ:
int- デフォルト:
1
If set to
0, figures, tables, and code-blocks are continuously numbered starting at1.If
1, the numbering will bex.1,x.2, ... withxrepresenting the section number. (If there is no top-level section, the prefix will not be added ). This naturally applies only if section numbering has been activated via the:numbered:option of thetoctreedirective.If
2, the numbering will bex.y.1,x.y.2, ... withxrepresenting the section number andythe sub-section number. If located directly under a section, there will be noy.prefix, and if there is no top-level section, the prefix will not be added.Any other positive integer can be used, following the rules above.
Added in version 1.3.
バージョン 1.7 で変更: The LaTeX builder obeys this setting if
numfigis set toTrue.
Options for highlighting¶
- highlight_language¶
- タイプ:
str- デフォルト:
'default'
The default language to highlight source code in. The default is
'default', which suppresses warnings if highlighting as Python code fails.The value should be a valid Pygments lexer name, see コードサンプルの表示 for more details.
Added in version 0.5.
バージョン 1.4 で変更: The default is now
'default'.
- highlight_options¶
- タイプ:
dict[str, dict[str, Any]]- デフォルト:
{}
A dictionary that maps Pygments lexer names to their options. These are lexer-specific; for the options understood by each, see the Pygments documentation.
例:
highlight_options = { 'default': {'stripall': True}, 'php': {'startinline': True}, }
Added in version 1.3.
バージョン 3.5 で変更: Allow configuring highlight options for multiple lexers.
- pygments_style¶
- タイプ:
str- デフォルト:
'sphinx'
The style name to use for Pygments highlighting of source code. If not set, either the theme's default style or
'sphinx'is selected for HTML output.バージョン 0.3 で変更: 値に独自のPygmentsスタイルクラスの完全修飾名を指定した場合、カスタムスタイルとして使用されます。
Options for HTTP requests¶
- tls_verify¶
- タイプ:
bool- デフォルト:
True
If True, Sphinx verifies server certificates.
Added in version 1.5.
- tls_cacerts¶
- タイプ:
str | dict[str, str]- デフォルト:
''
A path to a certification file of CA or a path to directory which contains the certificates. This also allows a dictionary mapping hostnames to the certificate file path. The certificates are used to verify server certifications.
Added in version 1.5.
Tip
Sphinx uses requests as a HTTP library internally. If
tls_cacertsis not set, Sphinx falls back to requests' default behaviour. See SSL Cert Verification for further details.
- user_agent¶
- タイプ:
str- デフォルト:
'Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0 Sphinx/X.Y.Z'
Set the User-Agent used by Sphinx for HTTP requests.
Added in version 2.3.
Options for internationalisation¶
These options influence Sphinx's Native Language Support. See the documentation on 国際化 for details.
- language¶
- タイプ:
str- デフォルト:
'en'
The code for the language the documents are written in. Any text automatically generated by Sphinx will be in that language. Also, Sphinx will try to substitute individual paragraphs from your documents with the translation sets obtained from
locale_dirs. Sphinx will search language-specific figures named byfigure_language_filename(e.g. the German version ofmyfigure.pngwill bemyfigure.de.pngby default setting) and substitute them for original figures. In the LaTeX builder, a suitable language will be selected as an option for the Babel package.Added in version 0.5.
バージョン 1.4 で変更: 画像の置き換えをサポートするようになりました。
バージョン 5.0 で変更: The default is now
'en'(previouslyNone).現在は以下の言語をサポートしています:
ar-- Arabicbg-- Bulgarianbn-- ベンガル語ca-- カタルーニャ語cak-- Kaqchikelcs-- チェコ語cy-- Welshda-- デンマーク語de-- ドイツ語el-- Greeken-- English (default)eo-- Esperantoes-- スペイン語et-- エストニア語eu-- バスク語fa-- イラン語fi-- フィンランド語fr-- フランス語he-- ヘブライ語hi-- Hindihi_IN-- Hindi (India)hr-- クロアチア語hu-- ハンガリー語id-- インドネシアit-- イタリア語ja-- 日本語ko-- 韓国語lt-- リトアニア語lv-- ラトビア語mk-- マケドニア語nb_NO-- ノルウェー語ブークモールne-- ネパール語nl-- オランダ語pl-- ポーランド語pt-- ポルトガル語pt_BR-- ブラジルのポーランド語pt_PT-- ヨーロッパのポルトガル語ro-- ローマ語ru-- ロシア語si-- シンハラ語sk-- スロバキア語sl-- スロベニア語sq-- Albaniansr-- Serbiansr@latin-- Serbian (Latin)sr_RS-- Serbian (Cyrillic)sv-- スウェーデン語ta-- Tamilte-- Telugutr-- トルコ語uk_UA-- ウクライナ語ur-- Urduvi-- ベトナム語zh_CN-- 簡体字中国語zh_TW-- 繁体字中国語
- locale_dirs¶
- タイプ:
list[str]- デフォルト:
['locales']
Directories in which to search for additional message catalogs (see
language), relative to the source directory. The directories on this path are searched by thegettextmodule.Internal messages are fetched from a text domain of
sphinx; so if you add the directory./localesto this setting, the message catalogs (compiled from.poformat using msgfmt) must be in./locales/language/LC_MESSAGES/sphinx.mo. The text domain of individual documents depends ongettext_compact.注釈
The
-v option to sphinx-buildis useful to check thelocale_dirssetting is working as expected. If the message catalog directory not found, debug messages are emitted.Added in version 0.5.
バージョン 1.5 で変更:
localesディレクトリをデフォルト値として使うようになりました。
- gettext_allow_fuzzy_translations¶
- タイプ:
bool- デフォルト:
False
If True, "fuzzy" messages in the message catalogs are used for translation.
Added in version 4.3.
- gettext_compact¶
- タイプ:
bool | str- デフォルト:
True
If
True, a document's text domain is its docname if it is a top-level project file and its very base directory otherwise.If
False, a document's text domain is the docname, in full.If set to a string, every document's text domain is set to this string, making all documents use single text domain.
With
gettext_compact = True, the documentmarkup/code.rstends up in themarkuptext domain. With this option set toFalse, it ismarkup/code. With this option set to'sample', it issample.Added in version 1.1.
バージョン 3.3 で変更: Allow string values.
- gettext_uuid¶
- タイプ:
bool- デフォルト:
False
If
True, Sphinx generates UUID information for version tracking in message catalogs. It is used to:Add a UUID line for each msgid in
.potfiles.Calculate similarity between new msgids and previously saved old msgids. (This calculation can take a long time.)
Tip
If you want to accelerate the calculation, you can use a third-party package (Levenshtein) by running pip install levenshtein.
Added in version 1.3.
- gettext_location¶
- タイプ:
bool- デフォルト:
True
If
True, Sphinx generates location information for messages in message catalogs.Added in version 1.3.
- gettext_auto_build¶
- タイプ:
bool- デフォルト:
True
If
True, Sphinx builds a.mofile for each translation catalog file.Added in version 1.3.
- gettext_additional_targets¶
- タイプ:
set[str] | Sequence[str]- デフォルト:
[]
Enable
gettexttranslation for certain element types. Example:gettext_additional_targets = {'literal-block', 'image'}
The following element types are supported:
'index'-- index terms'literal-block'-- literal blocks (::annotation andcode-blockdirective)'doctest-block'-- doctest block'raw'-- raw content'image'-- image/figure uri
Added in version 1.3.
バージョン 4.0 で変更: The alt text for images is translated by default.
バージョン 7.4 で変更: Permit and prefer a set type.
- figure_language_filename¶
- タイプ:
str- デフォルト:
'{root}.{language}{ext}'
The filename format for language-specific figures. The available format tokens are:
{root}: the filename, including any path component, without the file extension. For example:images/filename.{path}: the directory path component of the filename, with a trailing slash if non-empty. For example:images/.{basename}: the filename without the directory path or file extension components. For example:filename.{ext}: the file extension. For example:.png.{language}: the translation language. For example:en.{docpath}: the directory path component for the current document, with a trailing slash if non-empty. For example:dirname/.
By default, an image directive
.. image:: images/filename.png, using an image atimages/filename.png, will use the language-specific figure filenameimages/filename.en.png.If
figure_language_filenameis set as below, the language-specific figure filename will beimages/en/filename.pnginstead.figure_language_filename = '{path}{language}/{basename}{ext}'
Added in version 1.4.
バージョン 1.5 で変更: Added
{path}and{basename}tokens.バージョン 3.2 で変更: Added
{docpath}token.
- translation_progress_classes¶
- タイプ:
bool | 'translated' | 'untranslated'- デフォルト:
False
Control which, if any, classes are added to indicate translation progress. This setting would likely only be used by translators of documentation, in order to quickly indicate translated and untranslated content.
TrueAdd
translatedanduntranslatedclasses to all nodes with translatable content.'translated'Only add the
translatedclass.'untranslated'Only add the
untranslatedclass.FalseDo not add any classes to indicate translation progress.
Added in version 7.1.
Options for markup¶
- default_role¶
- タイプ:
str- デフォルト:
None
The name of a reStructuredText role (builtin or Sphinx extension) to use as the default role, that is, for text marked up
`like this`. This can be set to'py:obj'to make`filter`a cross-reference to the Python function "filter".The default role can always be set within individual documents using the standard reStructuredText default-role directive.
Added in version 0.4.
- keep_warnings¶
- タイプ:
bool- デフォルト:
False
Keep warnings as "system message" paragraphs in the rendered documents. Warnings are always written to the standard error stream when sphinx-build is run, regardless of this setting.
Added in version 0.5.
- option_emphasise_placeholders¶
- タイプ:
bool- デフォルト:
False
When enabled, emphasise placeholders in
optiondirectives. To display literal braces, escape with a backslash (\{). For example,option_emphasise_placeholders=Trueand.. option:: -foption={TYPE}would render withTYPEemphasised.Added in version 5.1.
- primary_domain¶
- タイプ:
str- デフォルト:
'py'
The name of the default domain. Can also be
Noneto disable a default domain. The default is'py', for the Python domain.Those objects in other domain (whether the domain name is given explicitly, or selected by a
default-domaindirective) will have the domain name explicitly prepended when named (e.g., when the default domain is C, Python functions will be named "Python function", not just "function"). Example:primary_domain = 'cpp'
Added in version 1.0.
- rst_epilog¶
- タイプ:
str- デフォルト:
''
A string of reStructuredText that will be included at the end of every source file that is read. This is a possible place to add substitutions that should be available in every file (another being
rst_prolog). Example:rst_epilog = """ .. |psf| replace:: Python Software Foundation """
Added in version 0.6.
- rst_prolog¶
- タイプ:
str- デフォルト:
''
A string of reStructuredText that will be included at the beginning of every source file that is read. This is a possible place to add substitutions that should be available in every file (another being
rst_epilog). Example:rst_prolog = """ .. |psf| replace:: Python Software Foundation """
Added in version 1.0.
- show_authors¶
- タイプ:
bool- デフォルト:
False
codeauthorとsectionauthorディレクティブの出力を、ビルドしたファイルに含めるかどうかのブール値です。
- trim_footnote_reference_space¶
- タイプ:
bool- デフォルト:
False
Trim spaces before footnote references that are necessary for the reStructuredText parser to recognise the footnote, but do not look too nice in the output.
Added in version 0.6.
Options for Maths¶
These options control maths markup and notation.
- math_eqref_format¶
- タイプ:
str- デフォルト:
'({number})'
A string used for formatting the labels of references to equations. The
{number}place-holder stands for the equation number.Example:
'Eq.{number}'gets rendered as, for example,Eq.10.Added in version 1.7.
- math_number_all¶
- タイプ:
bool- デフォルト:
False
Force all displayed equations to be numbered. Example:
math_number_all = True
Added in version 1.4.
- math_numfig¶
- タイプ:
bool- デフォルト:
True
If
True, displayed math equations are numbered across pages whennumfigis enabled. Thenumfig_secnum_depthsetting is respected. Theeq, notnumref, role must be used to reference equation numbers.Added in version 1.7.
- math_numsep¶
- タイプ:
str- デフォルト:
'.'
A string that defines the separator between section numbers and the equation number when
numfigis enabled andnumfig_secnum_depthis positive.Example:
'-'gets rendered as1.2-3.Added in version 7.4.
Options for the nitpicky mode¶
- nitpicky¶
- タイプ:
bool- デフォルト:
False
Enables nitpicky mode if
True. In nitpicky mode, Sphinx will warn about all references where the target cannot be found. This is recommended for new projects as it ensures that all references are to valid targets.You can activate this mode temporarily using the
--nitpickycommand-line option. Seenitpick_ignorefor a way to mark missing references as "known missing".nitpicky = True
Added in version 1.0.
- nitpick_ignore¶
- タイプ:
set[tuple[str, str]] | Sequence[tuple[str, str]]- デフォルト:
()
A set or list of
(warning_type, target)tuples that should be ignored when generating warnings in"nitpicky mode". Note thatwarning_typeshould include the domain name if present. Example:nitpick_ignore = { ('py:func', 'int'), ('envvar', 'LD_LIBRARY_PATH'), }
Added in version 1.1.
バージョン 6.2 で変更: Changed allowable container types to a set, list, or tuple
- nitpick_ignore_regex¶
- タイプ:
set[tuple[str, str]] | Sequence[tuple[str, str]]- デフォルト:
()
An extended version of
nitpick_ignore, which instead interprets thewarning_typeandtargetstrings as regular expressions. Note that the regular expression must match the whole string (as if the^and$markers were inserted).For example,
(r'py:.*', r'foo.*bar\.B.*')will ignore nitpicky warnings for all python entities that start with'foo'and have'bar.B'in them, such as('py:const', 'foo_package.bar.BAZ_VALUE')or('py:class', 'food.bar.Barman').Added in version 4.1.
バージョン 6.2 で変更: Changed allowable container types to a set, list, or tuple
Options for object signatures¶
- add_function_parentheses¶
- タイプ:
bool- デフォルト:
True
A boolean that decides whether parentheses are appended to function and method role text (e.g. the content of
:func:`input`) to signify that the name is callable.
- maximum_signature_line_length¶
- タイプ:
int | None- デフォルト:
None
If a signature's length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line.
When
None, there is no maximum length and the entire signature will be displayed on a single logical line.A 'logical line' is similar to a hard line break---builders or themes may choose to 'soft wrap' a single logical line, and this setting does not affect that behaviour.
Domains may provide options to suppress any hard wrapping on an individual object directive, such as seen in the C, C++, and Python domains (e.g.
py:function:single-line-parameter-list).Added in version 7.1.
- strip_signature_backslash¶
- タイプ:
bool- デフォルト:
False
When backslash stripping is enabled then every occurrence of
\\in a domain directive will be changed to\, even within string literals. This was the behaviour before version 3.0, and setting this variable toTruewill reinstate that behaviour.Added in version 3.0.
- toc_object_entries¶
- タイプ:
bool- デフォルト:
True
Create table of contents entries for domain objects (e.g. functions, classes, attributes, etc.).
Added in version 5.2.
- toc_object_entries_show_parents¶
- タイプ:
'domain' | 'hide' | 'all'- デフォルト:
'domain'
A string that determines how domain objects (functions, classes, attributes, etc.) are displayed in their table of contents entry.
Use
'domain'to allow the domain to determine the appropriate number of parents to show. For example, the Python domain would showClass.method()andfunction(), leaving out themodule.level of parents.Use
'hide'to only show the name of the element without any parents (i.e.method()).Use
'all'to show the fully-qualified name for the object (i.e.module.Class.method()), displaying all parents.Added in version 5.2.
Options for source files¶
- exclude_patterns¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of glob-style patterns that should be excluded when looking for source files. They are matched against the source file names relative to the source directory, using slashes as directory separators on all platforms.
exclude_patternshas priority overinclude_patterns.サンプルのパターン:
'library/xml.rst'-- ignores thelibrary/xml.rstfile'library/xml'-- ignores thelibrary/xmldirectory'library/xml*'-- ignores all files and directories starting withlibrary/xml'**/.git'-- ignores all.gitdirectories'Thumbs.db'-- ignores allThumbs.dbfiles
exclude_patternsは、html_static_path及びhtml_extra_pathの中の静的ファイルを探索する時にも参照されます。Added in version 1.0.
- include_patterns¶
- タイプ:
Sequence[str]- デフォルト:
('**',)
A list of glob-style patterns that are used to find source files. They are matched against the source file names relative to the source directory, using slashes as directory separators on all platforms. By default, all files are recursively included from the source directory.
exclude_patternshas priority overinclude_patterns.サンプルのパターン:
'**'-- all files in the source directory and subdirectories, recursively'library/xml'-- just thelibrary/xmldirectory'library/xml*'-- all files and directories starting withlibrary/xml'**/doc'-- alldocdirectories (this might be useful if documentation is co-located with source files)
Added in version 5.1.
- master_doc¶
- root_doc¶
- タイプ:
str- デフォルト:
'index'
Sphinx builds a tree of documents based on the
toctreedirectives contained within the source files. This sets the name of the document containing the mastertoctreedirective, and hence the root of the entire tree. Example:master_doc = 'contents'
バージョン 2.0 で変更: Default is
'index'(previously'contents').Added in version 4.0: The
root_docalias.
- source_encoding¶
- タイプ:
str- デフォルト:
'utf-8-sig'
The file encoding of all source files. The recommended encoding is
'utf-8-sig'.Added in version 0.5.
バージョン 9.0 で非推奨: Support for source encodings other than UTF-8 is deprecated. Sphinx 11 will only support UTF-8 files.
- source_suffix¶
- タイプ:
dict[str, str] | Sequence[str] | str- デフォルト:
{'.rst': 'restructuredtext'}
A dictionary mapping the file extensions (suffixes) of source files to their file types. Sphinx considers all files files with suffixes in
source_suffixto be source files. Example:source_suffix = { '.rst': 'restructuredtext', '.txt': 'restructuredtext', '.md': 'markdown', }
By default, Sphinx only supports the
'restructuredtext'file type. Further file types can be added with extensions that register different source file parsers, such as MyST-Parser. Refer to the extension's documentation to see which file types it supports.If the value is a string or sequence of strings, Sphinx will consider that they are all
'restructuredtext'files.注釈
File extensions must begin with a dot (
'.').バージョン 1.3 で変更: Support a list of file extensions.
バージョン 1.8 で変更: Change to a map of file extensions to file types.
Options for smart quotes¶
- smartquotes¶
- タイプ:
bool- デフォルト:
True
If
True, the Smart Quotes transform will be used to convert quotation marks and dashes to typographically correct entities.Added in version 1.6.6: Replaces the now-removed
html_use_smartypants. It applies by default to all builders exceptmanandtext(seesmartquotes_excludes.)注釈
A docutils.conf file located in the configuration directory (or a global
~/.docutilsfile) is obeyed unconditionally if it deactivates smart quotes via the corresponding Docutils option. But if it activates them, thensmartquotesdoes prevail.
- smartquotes_action¶
- タイプ:
str- デフォルト:
'qDe'
Customise the Smart Quotes transform. See below for the permitted codes. The default
'qDe'educates normal quote characters",', em- and en-Dashes---,--, and ellipses.....'q'Convert quotation marks
'b'Convert backtick quotation marks (
``double''only)'B'Convert backtick quotation marks (
``double''and`single')'d'Convert dashes (convert
--to em-dashes and---to en-dashes)'D'Convert dashes (old school) (convert
--to en-dashes and---to em-dashes)'i'Convert dashes (inverted old school) (convert
--to em-dashes and---to en-dashes)'e'Convert ellipses
...'w'Convert
'"'entities to'"'
Added in version 1.6.6.
- smartquotes_excludes¶
- タイプ:
dict[str, list[str]]- デフォルト:
{'languages': ['ja'], 'builders': ['man', 'text']}
Control when the Smart Quotes transform is disabled. Permitted keys are
'builders'and'languages', and The values are lists of strings.Each entry gives a sufficient condition to ignore the
smartquotessetting and deactivate the Smart Quotes transform. Example:smartquotes_excludes = { 'languages': ['ja'], 'builders': ['man', 'text'], }
注釈
Currently, in case of invocation of make with multiple targets, the first target name is the only one which is tested against the
'builders'entry and it decides for all. Also, amake textfollowingmake htmlneeds to be issued in the formmake text SPHINXOPTS="-E"to force re-parsing of source files, as the cached ones are already transformed. On the other hand the issue does not arise with direct usage of sphinx-build as it caches (in its default usage) the parsed source files in per builder locations.ヒント
An alternative way to effectively deactivate (or customise) the smart quotes for a given builder, for example
latex, is to usemakethis way:make latex SPHINXOPTS="-D smartquotes_action="This can follow some
make htmlwith no problem, in contrast to the situation from the prior note.Added in version 1.6.6.
Options for templating¶
- template_bridge¶
- タイプ:
str- デフォルト:
''
A string with the fully-qualified name of a callable (or simply a class) that returns an instance of
TemplateBridge. This instance is then used to render HTML documents, and possibly the output of other builders (currently the changes builder). (Note that the template bridge must be made theme-aware if HTML themes are to be used.) Example:template_bridge = 'module.CustomTemplateBridge'
- templates_path¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of paths that contain extra templates (or templates that overwrite builtin/theme-specific templates). Relative paths are taken as relative to the configuration directory. Example:
templates_path = ['.templates']
バージョン 1.3 で変更: As these files are not meant to be built, they are automatically excluded when discovering source files.
Options for warning control¶
- show_warning_types¶
- タイプ:
bool- デフォルト:
True
Add the type of each warning as a suffix to the warning message. For example,
WARNING: [...] [index]orWARNING: [...] [toc.circular]. This setting can be useful for determining which warnings types to include in asuppress_warningslist.Added in version 7.3.0.
バージョン 8.0.0 で変更: The default is now
True.
- suppress_warnings¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of warning codes to suppress arbitrary warning messages.
Added in version 1.4.
By default, Sphinx supports the following warning codes:
app.add_directiveapp.add_generic_roleapp.add_nodeapp.add_roleapp.add_source_parserconfig.cachedocutilsdownload.not_readableduplicate_declaration.cduplicate_declaration.cppepub.duplicated_toc_entryepub.unknown_project_filesi18n.babeli18n.inconsistent_referencesi18n.not_readablei18n.not_writeableimage.not_readableindexmisc.copy_overwritemisc.highlighting_failureref.anyref.citationref.docref.equationref.footnoteref.keywordref.numrefref.optionref.pythonref.refref.termsource_code_parser.csource_code_parser.cpptoc.circulartoc.duplicate_entrytoc.empty_globtoc.excludedtoc.no_titletoc.not_includedtoc.not_readabletoc.secnum
Extensions can also define their own warning types. Those defined by the first-party
sphinx.extextensions are:autodocautodoc.import_objectautodoc.mocked_objectautosectionlabel.<document name>autosummaryautosummary.import_cycledurationintersphinx.external
You can choose from these types. You can also give only the first component to exclude all warnings attached to it.
Added in version 1.4:
ref.citation,ref.doc,ref.keyword,ref.numref,ref.option,ref.ref, andref.term.Added in version 1.4.2:
app.add_directive,app.add_generic_role,app.add_node,app.add_role, andapp.add_source_parser.Added in version 1.5:
misc.highlighting_failure.Added in version 1.5.1:
epub.unknown_project_files.Added in version 1.5.2:
toc.secnum.Added in version 1.6:
ref.footnote,download.not_readable, andimage.not_readable.Added in version 1.7:
ref.python.Added in version 2.0:
autodoc.import_object.Added in version 2.1:
autosectionlabel.<document name>.Added in version 3.1:
toc.circular.Added in version 3.3:
epub.duplicated_toc_entry.Added in version 4.3:
toc.excludedandtoc.not_readable.Added in version 4.5:
i18n.inconsistent_references.Added in version 7.1:
index.Added in version 7.3:
config.cache,intersphinx.external, andtoc.no_title.Added in version 7.4:
docutilsandautosummary.import_cycle.Added in version 8.0:
misc.copy_overwrite.Added in version 8.2:
autodoc.mocked_object,duplicate_declaration.c,duplicate_declaration.cpp,i18n.babel,i18n.not_readable,i18n.not_writeable,ref.any,toc.duplicate_entry,toc.empty_glob, andtoc.not_included.Added in version 9.0:
duration.
Builder options¶
HTML出力のオプション¶
These options influence HTML output. Various other builders are derived from the HTML output, and also make use of these options.
- html_theme¶
- タイプ:
str- デフォルト:
'alabaster'
The theme for HTML output. See the HTML theming section.
Added in version 0.6.
バージョン 1.3 で変更: The default theme is now
'alabaster'.
- html_theme_options¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. The options understood by the builtin themes are described here.
Added in version 0.6.
- html_theme_path¶
- タイプ:
list[str]- デフォルト:
[]
A list of paths that contain custom themes, either as subdirectories or as zip files. Relative paths are taken as relative to the configuration directory.
Added in version 0.6.
- html_style¶
- タイプ:
Sequence[str] | str- デフォルト:
()
Stylesheets to use for HTML pages. The stylesheet given by the selected theme is used by default A file of that name must exist either in Sphinx's
static/path or in one of the custom paths given inhtml_static_path. If you only want to add or override a few things from the theme, use CSS@importto import the theme's stylesheet.バージョン 5.1 で変更: The value can be a iterable of strings.
- html_title¶
- タイプ:
str- デフォルト:
'project release documentation'
The "title" for HTML documentation generated with Sphinx's own templates. This is appended to the
<title>tag of individual pages, and used in the navigation bar as the "topmost" element.
- html_short_title¶
- タイプ:
str- デフォルト:
- The value of html_title
A shorter "title" for HTML documentation. This is used for links in the header and in the HTML Help documentation.
Added in version 0.4.
- html_baseurl¶
- タイプ:
str- デフォルト:
''
The base URL which points to the root of the HTML documentation. It is used to indicate the location of document using the Canonical Link Relation.
Added in version 1.8.
- html_codeblock_linenos_style¶
- タイプ:
'inline' | 'table'- デフォルト:
'inline'
The style of line numbers for code-blocks.
'table'Display line numbers using
<table>tag'inline'Display line numbers using
<span>tag
Added in version 3.2.
バージョン 4.0 で変更: It defaults to
'inline'.バージョン 4.0 で非推奨.
- html_context¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary of values to pass into the template engine's context for all pages. Single values can also be put in this dictionary using sphinx-build's
--html-definecommand-line option.Added in version 0.5.
- html_logo¶
- タイプ:
str- デフォルト:
''
If given, this must be the name of an image file (path relative to the configuration directory) that is the logo of the documentation, or a URL that points an image file for the logo. It is placed at the top of the sidebar; its width should therefore not exceed 200 pixels.
Added in version 0.4.1: The image file will be copied to the
_staticdirectory, but only if the file does not already exist there.バージョン 4.0 で変更: Also accepts a URL.
- html_favicon¶
- タイプ:
str- デフォルト:
''
If given, this must be the name of an image file (path relative to the configuration directory) that is the favicon of the documentation, or a URL that points an image file for the favicon. Browsers use this as the icon for tabs, windows and bookmarks. It should be a 16-by-16 pixel icon in the PNG, SVG, GIF, or ICO file formats.
例:
html_favicon = 'static/favicon.png'
Added in version 0.4: The image file will be copied to the
_static, but only if the file does not already exist there.バージョン 4.0 で変更: Also accepts the URL for the favicon.
- html_css_files¶
- タイプ:
Sequence[str | tuple[str, dict[str, str]]]- デフォルト:
[]
A list of CSS files. The entry must be a filename string or a tuple containing the filename string and the attributes dictionary. The filename must be relative to the
html_static_path, or a full URI with scheme like'https://example.org/style.css'. The attributes dictionary is used for the<link>tag's attributes.例:
html_css_files = [ 'custom.css', 'https://example.com/css/custom.css', ('print.css', {'media': 'print'}), ]
The special attribute priority can be set as an integer to load the CSS file at an earlier or later step. For more information, refer to
Sphinx.add_css_file().Added in version 1.8.
バージョン 3.5 で変更: Support the priority attribute
- html_js_files¶
- タイプ:
Sequence[str | tuple[str, dict[str, str]]]- デフォルト:
[]
A list of JavaScript files. The entry must be a filename string or a tuple containing the filename string and the attributes dictionary. The filename must be relative to the
html_static_path, or a full URI with scheme like'https://example.org/script.js'. The attributes dictionary is used for the<script>tag's attributes.例:
html_js_files = [ 'script.js', 'https://example.com/scripts/custom.js', ('custom.js', {'async': 'async'}), ]
As a special attribute, priority can be set as an integer to load the JavaScript file at an earlier or later step. For more information, refer to
Sphinx.add_js_file().Added in version 1.8.
バージョン 3.5 で変更: Support the priority attribute
- html_static_path¶
- タイプ:
list[str]- デフォルト:
[]
A list of paths that contain custom static files (such as style sheets or script files). Relative paths are taken as relative to the configuration directory. They are copied to the output's
_staticdirectory after the theme's static files, so a file nameddefault.csswill overwrite the theme'sdefault.css.As these files are not meant to be built, they are automatically excluded from source files.
注釈
For security reasons, dotfiles under
html_static_pathwill not be copied. If you would like to copy them intentionally, explicitly add each file to this setting:html_static_path = ['_static', '_static/.htaccess']
An alternative approach is to use
html_extra_path, which allows copying dotfiles under the directories.参考
add_static_dir(), for use in extensions to copy static files to the output directory.バージョン 0.4 で変更:
html_static_pathで指定されるパスにはサブディレクトリも含めることができます。バージョン 1.0 で変更:
html_static_path内のエントリーに、単独のファイルを入れることができます。バージョン 1.8 で変更: The files under
html_static_pathare excluded from source files.
- html_extra_path¶
- タイプ:
list[str]- デフォルト:
[]
A list of paths that contain extra files not directly related to the documentation, such as
robots.txtor.htaccess. Relative paths are taken as relative to the configuration directory. They are copied to the output directory. They will overwrite any existing file of the same name.As these files are not meant to be built, they are automatically excluded from source files.
Added in version 1.2.
バージョン 1.4 で変更: The dotfiles in the extra directory will be copied to the output directory. And it refers
exclude_patternson copying extra files and directories, and ignores if path matches to patterns.
- html_last_updated_fmt¶
- タイプ:
str- デフォルト:
None
If set, a 'Last updated on:' timestamp is inserted into the page footer using the given
strftime()format. The empty string is equivalent to'%b %d, %Y'(or a locale-dependent equivalent).
- html_last_updated_use_utc¶
- タイプ:
bool- デフォルト:
False
Use GMT/UTC (+00:00) instead of the system's local time zone for the time supplied to
html_last_updated_fmt. This is most useful when the format used includes the time.
- html_permalinks¶
- タイプ:
bool- デフォルト:
True
Add link anchors for each heading and description environment.
Added in version 3.5.
- html_permalinks_icon¶
- タイプ:
str- デフォルト:
'¶'(the paragraph sign)
Text for link anchors for each heading and description environment. HTML entities and Unicode are allowed.
Added in version 3.5.
- html_sidebars¶
- タイプ:
dict[str, Sequence[str]]- デフォルト:
{}
A dictionary defining custom sidebar templates, mapping document names to template names.
The keys can contain glob-style patterns, in which case all matching documents will get the specified sidebars. (A warning is emitted when a more than one glob-style pattern matches for any document.)
Each value must be a list of strings which specifies the complete list of sidebar templates to include. If all or some of the default sidebars are to be included, they must be put into this list as well.
The default sidebars (for documents that don't match any pattern) are defined by theme itself. The builtin themes use these templates by default:
'localtoc.html','relations.html','sourcelink.html', and'searchbox.html'.The bundled first-party sidebar templates that can be rendered are:
localtoc.html -- 現在のドキュメントの、詳細な目次
globaltoc.html -- ドキュメントセット全体に関する、荒い粒度の折りたたまれた目次
relations.html -- 前のドキュメントと、次のドキュメントへの2つのリンク
sourcelink.html -- もし
html_show_sourcelinkが有効にされている場合に、現在のドキュメントのソースへのリンクsearchbox.html -- "クイック検索"ボックス
例:
html_sidebars = { '**': ['globaltoc.html', 'sourcelink.html', 'searchbox.html'], 'using/windows': ['windows-sidebar.html', 'searchbox.html'], }
This will render the custom template
windows-sidebar.htmland the quick search box within the sidebar of the given document, and render the default sidebars for all other pages (except that the local TOC is replaced by the global TOC).これらの値は、組み込みの scrolls と haiku テーマのように、設定したテーマによっては効果がありません。
Added in version 1.0: globスタイルのキーが利用できるようになり、複数のサイドバーが設定できるようになりました。
バージョン 1.7 で非推奨: A single string value for
html_sidebarswill be removed.バージョン 2.0 で変更:
html_sidebarsmust be a list of strings, and no longer accepts a single string value.
- html_additional_pages¶
- タイプ:
dict[str, str]- デフォルト:
{}
HTMLページにレンダリングする、追加のHTMLテンプレートを指定します。設定値はドキュメント名をキーに、テンプレート名を値に持つ辞書として設定します。
例:
html_additional_pages = { 'download': 'custom-download.html.jinja', }
This will render the template
custom-download.html.jinjaas the pagedownload.html.
- html_domain_indices¶
- タイプ:
bool | Sequence[str]- デフォルト:
True
If True, generate domain-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index.
This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name
'py-modindex'.例:
html_domain_indices = { 'py-modindex', }
Added in version 1.0.
バージョン 7.4 で変更: Permit and prefer a set type.
- html_use_index¶
- タイプ:
bool- デフォルト:
True
Controls if an index is added to the HTML documents.
Added in version 0.4.
- html_split_index¶
- タイプ:
bool- デフォルト:
False
Generates two versions of the index: once as a single page with all the entries, and once as one page per starting letter.
Added in version 0.4.
- html_copy_source¶
- タイプ:
bool- デフォルト:
True
If True, the reStructuredText sources are included in the HTML build as
_sources/docname.
- html_show_sourcelink¶
- タイプ:
bool- デフォルト:
True
If True (and
html_copy_sourceis true as well), links to the reStructuredText sources will be added to the sidebar.Added in version 0.6.
- html_sourcelink_suffix¶
- タイプ:
str- デフォルト:
'.txt'
The suffix to append to source links (see
html_show_sourcelink), unless files they have this suffix already.Added in version 1.5.
- html_use_opensearch¶
- タイプ:
str- デフォルト:
''
If nonempty, an OpenSearch description file will be output, and all pages will contain a
<link>tag referring to it. Since OpenSearch doesn't support relative URLs for its search page location, the value of this option must be the base URL from which these documents are served (without trailing slash), e.g.'https://docs.python.org'.Added in version 0.2.
- html_file_suffix¶
- タイプ:
str- デフォルト:
'.html'
The file name suffix (file extension) for generated HTML files.
Added in version 0.4.
- html_link_suffix¶
- タイプ:
str- デフォルト:
- The value of html_file_suffix
The suffix for generated links to HTML files. Intended to support more esoteric server setups.
Added in version 0.6.
- html_show_copyright¶
- タイプ:
bool- デフォルト:
True
If True, "© Copyright ..." is shown in the HTML footer, with the value or values from
copyright.Added in version 1.0.
- html_show_search_summary¶
- タイプ:
bool- デフォルト:
True
Show a summary of the search result, i.e., the text around the keyword.
Added in version 4.5.
- html_show_sphinx¶
- タイプ:
bool- デフォルト:
True
Add "Created using Sphinx" to the HTML footer.
Added in version 0.4.
- html_output_encoding¶
- タイプ:
str- デフォルト:
'utf-8'
Encoding of HTML output files. This encoding name must both be a valid Python encoding name and a valid HTML
charsetvalue.Added in version 1.0.
- html_compact_lists¶
- タイプ:
bool- デフォルト:
True
If True, a list all whose items consist of a single paragraph and/or a sub-list all whose items etc... (recursive definition) will not use the
<p>element for any of its items. This is standard docutils behaviour. Default:True.Added in version 1.0.
- html_secnumber_suffix¶
- タイプ:
str- デフォルト:
'. '
Suffix for section numbers in HTML output. Set to
' 'to suppress the final dot on section numbers.Added in version 1.0.
- html_search_language¶
- タイプ:
str- デフォルト:
- The value of language
Language to be used for generating the HTML full-text search index. This defaults to the global language selected with
language. English ('en') is used as a fall-back option if there is no support for this language.Support exists for the following languages:
da-- デンマーク語nl-- オランダ語en-- 英語fi-- フィンランド語fr-- フランス語de-- ドイツ語hu-- ハンガリー語it-- イタリア語ja-- 日本語no-- ノルウェー語pt-- ポルトガル語ro-- ローマ語ru-- ロシア語es-- スペイン語sv-- スウェーデン語tr-- トルコ語zh-- 中国語
Tip
ビルドスピードの向上
Each language (except Japanese) provides its own stemming algorithm. Sphinx uses a Python implementation by default. If you want to accelerate building the index file, you can use a third-party package (PyStemmer) by running pip install PyStemmer.
Added in version 1.1: Support English (
en) and Japanese (ja).バージョン 1.3 で変更: さらに複数言語を追加
- html_search_options¶
- タイプ:
dict[str, str]- デフォルト:
{}
A dictionary with options for the search language support. The meaning of these options depends on the language selected. Currently, only Japanese and Chinese support options.
- Japanese:
type-- the type of the splitter to use.The other options depend on the splitter used.
'sphinx.search.ja.DefaultSplitter'The TinySegmenter algorithm, used by default.
'sphinx.search.ja.MecabSplitter':The MeCab binding To use this splitter, the 'mecab' python binding or dynamic link library ('libmecab.so' for Linux, 'libmecab.dll' for Windows) is required.
'sphinx.search.ja.JanomeSplitter':The Janome binding. To use this splitter, Janome is required.
バージョン 1.6 で非推奨:
'mecab','janome'and'default'is deprecated. To keep compatibility,'mecab','janome'and'default'are also acceptable.- Options for
'mecab': - dic_enc:
dic_enc option では MeCabアルゴリズムのエンコーディングを指定します。
- dict:
dict option では MeCabアルゴリズムで使用する辞書を指定します。
- lib:
lib option is the library name for finding the MeCab library via
ctypesif the Python binding is not installed.
例:
html_search_options = { 'type': 'mecab', 'dic_enc': 'utf-8', 'dict': '/path/to/mecab .dic', 'lib': '/path/to/libmecab.so', }
- Options for
'janome': - user_dic:
user_dic option はJanomeのユーザー辞書ファイルへのパスです。
- user_dic_enc:
user_dic_enc option は
user_dicオプションで設定されたユーザー辞書ファイルのエンコーディングです。デフォルト値は 'utf8' です。
- Chinese:
dictThe
jiebadictionary path for using a custom dictionary.
Added in version 1.1.
バージョン 1.4 で変更: Allow any custom splitter in the type setting for Japanese.
- html_search_scorer¶
- タイプ:
str- デフォルト:
''
The name of a JavaScript file (relative to the configuration directory) that implements a search results scorer. If empty, the default will be used.
The scorer must implement the following interface, and may optionally define the
score()function for more granular control.const Scorer = { // Implement the following function to further tweak the score for each result score: result => { const [docName, title, anchor, descr, score, filename] = result // ... calculate a new score ... return score }, // query matches the full name of an object objNameMatch: 11, // or matches in the last dotted part of the object name objPartialMatch: 6, // Additive scores depending on the priority of the object objPrio: { 0: 15, // used to be importantResults 1: 5, // used to be objectResults 2: -5, // used to be unimportantResults }, // Used when the priority is not in the mapping. objPrioDefault: 0, // query found in title title: 15, partialTitle: 7, // query found in terms term: 5, partialTerm: 2, };
Added in version 1.2.
- html_scaled_image_link¶
- タイプ:
bool- デフォルト:
True
Link images that have been resized with a scale option (scale, width, or height) to their original full-resolution image. This will not overwrite any link given by the target option on the the image directive, if present.
Tip
To disable this feature on a per-image basis, add the
no-scaled-linkclass to the image directive:.. image:: sphinx.png :scale: 50% :class: no-scaled-link
Added in version 1.3.
バージョン 3.0 で変更: Images with the
no-scaled-linkclass will not be linked.
- html_math_renderer¶
- タイプ:
str- デフォルト:
'mathjax'
The maths renderer to use for HTML output. The bundled renders are mathjax and imgmath. You must also load the relevant extension in
extensions.Added in version 1.8.
Options for Single HTML output¶
These options influence Single HTML output. This builder derives from the HTML builder, so the HTML options also apply where appropriate.
- singlehtml_sidebars¶
- タイプ:
dict[str, Sequence[str]]- デフォルト:
- The value of html_sidebars
A dictionary defining custom sidebar templates, mapping document names to template names.
This has the same effect as
html_sidebars, but the only permitted key is'index', and all other keys are ignored.
Options for HTML help output¶
These options influence HTML help output. This builder derives from the HTML builder, so the HTML options also apply where appropriate.
- htmlhelp_basename¶
- タイプ:
str- デフォルト:
'{project}doc'
Output file base name for HTML help builder. The default is the
project namewith spaces removed anddocappended.
- htmlhelp_file_suffix¶
- タイプ:
str- デフォルト:
'.html'
This is the file name suffix for generated HTML help files.
Added in version 2.0.
- htmlhelp_link_suffix¶
- タイプ:
str- デフォルト:
- The value of htmlhelp_file_suffix
Suffix for generated links to HTML files.
Added in version 2.0.
AppleHelp出力のオプション¶
Added in version 1.3.
これらのオプションはAppleヘルプの出力に影響します。このビルダーはHTMLビルダーから派生しているため、必要に応じてHTMLオプションも適用されます。
注釈
Apple Help output will only work on Mac OS X 10.6 and higher, as it requires the hiutil and codesign command-line tools, neither of which are Open Source.
You can disable the use of these tools using
applehelp_disable_external_tools,
but the result will not be a valid help book
until the indexer is run over the .lproj directories within the bundle.
- applehelp_bundle_name¶
- タイプ:
str- デフォルト:
- The value of project
The basename for the Apple Help Book. The default is the
project namewith spaces removed.
- applehelp_bundle_id¶
- タイプ:
str- デフォルト:
None
ヘルプブックバンドルのバンドルID
警告
Appleヘルプの生成を行うためには設定が*必須*です。
- applehelp_bundle_version¶
- タイプ:
str- デフォルト:
'1'
バンドルの文字列としてのバージョン。
- applehelp_dev_region¶
- タイプ:
str- デフォルト:
'en-us'
The development region. Defaults to Apple’s recommended setting,
'en-us'.
- applehelp_icon¶
- タイプ:
str- デフォルト:
None
Path to the help bundle icon file or
Nonefor no icon. According to Apple's documentation, this should be a 16-by-16 pixel version of the application's icon with a transparent background, saved as a PNG file.
- applehelp_kb_product¶
- タイプ:
str- デフォルト:
'project-release'
The product tag for use with
applehelp_kb_url.
- applehelp_kb_url¶
- タイプ:
str- デフォルト:
None
The URL for your knowledgebase server, e.g.
https://example.com/kbsearch.py?p='product'&q='query'&l='lang'. At runtime, Help Viewer will replace'product'with the contents ofapplehelp_kb_product,'query'with the text entered by the user in the search box, and'lang'with the user's system language.Set this to to
Noneto disable remote search.
- applehelp_remote_url¶
- タイプ:
str- デフォルト:
None
The URL for remote content. You can place a copy of your Help Book's
Resourcesdirectory at this location and Help Viewer will attempt to use it to fetch updated content.For example, if you set it to
https://example.com/help/Foo/and Help Viewer wants a copy ofindex.htmlfor an English speaking customer, it will look athttps://example.com/help/Foo/en.lproj/index.html.Set this to to
Nonefor no remote content.
- applehelp_index_anchors¶
- タイプ:
bool- デフォルト:
False
Tell the help indexer to index anchors in the generated HTML. This can be useful for jumping to a particular topic using the
AHLookupAnchorfunction or theopenHelpAnchor:inBook:method in your code. It also allows you to usehelp:anchorURLs; see the Apple documentation for more information on this topic.
- applehelp_min_term_length¶
- タイプ:
str- デフォルト:
None
Controls the minimum term length for the help indexer. If
None, use the default length.
- applehelp_stopwords¶
- タイプ:
str- デフォルト:
- The value of language
Either a language specification (to use the built-in stopwords), or the path to a stopwords plist, or
Noneif you do not want to use stopwords. The default stopwords plist can be found at/usr/share/hiutil/Stopwords.plistand contains, at time of writing, stopwords for the following languages:German (
de)English (
en)Spanish (
es)French (
fr)Hungarian (
hu)Italian (
it)Swedish (
sv)
- applehelp_locale¶
- タイプ:
str- デフォルト:
- The value of language
Specifies the locale to generate help for. This is used to determine the name of the
.lprojdirectory inside the Help Book’sResources, and is passed to the help indexer.
- applehelp_title¶
- タイプ:
str- デフォルト:
'project Help'
ヘルプ ブックのタイトルを指定します。
- applehelp_codesign_identity¶
- タイプ:
str- デフォルト:
- The value of CODE_SIGN_IDENTITY
Specifies the identity to use for code signing. Use
Noneif code signing is not to be performed.Defaults to the value of the
CODE_SIGN_IDENTITYenvironment variable, which is set by Xcode for script build phases, orNoneif that variable is not set.
- applehelp_codesign_flags¶
- タイプ:
list[str]- デフォルト:
- The value of OTHER_CODE_SIGN_FLAGS
A list of additional arguments to pass to codesign when signing the help book.
Defaults to a list based on the value of the
OTHER_CODE_SIGN_FLAGSenvironment variable, which is set by Xcode for script build phases, or the empty list if that variable is not set.
- applehelp_codesign_path¶
- タイプ:
str- デフォルト:
'/usr/bin/codesign'
The path to the codesign program.
- applehelp_indexer_path¶
- タイプ:
str- デフォルト:
'/usr/bin/hiutil'
The path to the hiutil program.
- applehelp_disable_external_tools¶
- タイプ:
bool- デフォルト:
False
Do not run the indexer or the code signing tool, no matter what other settings are specified.
This is mainly useful for testing, or where you want to run the Sphinx build on a non-macOS platform and then complete the final steps on a Mac for some reason.
EPUB出力のオプション¶
These options influence EPUB output. This builder derives from the HTML builder, so the HTML options also apply where appropriate.
注釈
The actual value for some of these options is not important, but they are required for the Dublin Core metadata.
- epub_basename¶
- タイプ:
str- デフォルト:
- The value of project
The basename for the EPUB file.
- epub_theme¶
- タイプ:
str- デフォルト:
'epub'
The HTML theme for the EPUB output. Since the default themes are not optimised for small screen space, using the same theme for HTML and EPUB output is usually not wise. This defaults to
'epub', a theme designed to save visual space.
- epub_theme_options¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. The options understood by the builtin themes are described here.
Added in version 1.2.
- epub_title¶
- タイプ:
str- デフォルト:
- The value of project
The title of the document.
バージョン 2.0 で変更: It defaults to the
projectoption (previouslyhtml_title).
- epub_description¶
- タイプ:
str- デフォルト:
'unknown'
The description of the document.
Added in version 1.4.
バージョン 1.5 で変更: Renamed from
epub3_description
- epub_author¶
- タイプ:
str- デフォルト:
- The value of author
文書の著者。これはDublin Coreメタデータに格納されます。
- epub_contributor¶
- タイプ:
str- デフォルト:
'unknown'
The name of a person, organisation, etc. that played a secondary role in the creation of the content of an EPUB Publication.
Added in version 1.4.
バージョン 1.5 で変更: Renamed from
epub3_contributor
- epub_language¶
- タイプ:
str- デフォルト:
- The value of language
The language of the document. This is put in the Dublin Core metadata.
- epub_publisher¶
- タイプ:
str- デフォルト:
- The value of author
The publisher of the document. This is put in the Dublin Core metadata. You may use any sensible string, e.g. the project homepage.
- epub_copyright¶
- タイプ:
str- デフォルト:
- The value of copyright
The copyright of the document. See
copyrightfor permitted formats.
- epub_identifier¶
- タイプ:
str- デフォルト:
'unknown'
An identifier for the document. This is put in the Dublin Core metadata. For published documents this is the ISBN number, but you can also use an alternative scheme, e.g. the project homepage.
- epub_scheme¶
- タイプ:
str- デフォルト:
'unknown'
The publication scheme for the
epub_identifier. This is put in the Dublin Core metadata. For published books the scheme is'ISBN'. If you use the project homepage,'URL'seems reasonable.
- epub_uid¶
- タイプ:
str- デフォルト:
'unknown'
A unique identifier for the document. This is put in the Dublin Core metadata. You may use a XML's Name format string. You can't use hyphen, period, numbers as a first character.
- epub_cover¶
- タイプ:
tuple[str, str]- デフォルト:
()
The cover page information. This is a tuple containing the filenames of the cover image and the html template. The rendered html cover page is inserted as the first item in the spine in
content.opf. If the template filename is empty, no html cover page is created. No cover at all is created if the tuple is empty.Examples:
epub_cover = ('_static/cover.png', 'epub-cover.html') epub_cover = ('_static/cover.png', '') epub_cover = ()
Added in version 1.1.
- epub_css_files¶
- タイプ:
Sequence[str | tuple[str, dict[str, str]]]- デフォルト:
[]
A list of CSS files. The entry must be a filename string or a tuple containing the filename string and the attributes dictionary. The filename must be relative to the
html_static_path, or a full URI with scheme like'https://example.org/style.css'. The attributes dictionary is used for the<link>tag's attributes. For more information, seehtml_css_files.Added in version 1.8.
- epub_guide¶
- タイプ:
Sequence[tuple[str, str, str]]- デフォルト:
()
Meta data for the guide element of
content.opf. This is a sequence of tuples containing the type, the uri and the title of the optional guide information. See the OPF documentation for details. If possible, default entries for the cover and toc types are automatically inserted. However, the types can be explicitly overwritten if the default entries are not appropriate.例:
epub_guide = ( ('cover', 'cover.html', 'Cover Page'), )
The default value is
().
- epub_pre_files¶
- タイプ:
Sequence[tuple[str, str]]- デフォルト:
()
Additional files that should be inserted before the text generated by Sphinx. It is a list of tuples containing the file name and the title. If the title is empty, no entry is added to
toc.ncx.例:
epub_pre_files = [ ('index.html', 'Welcome'), ]
- epub_post_files¶
- タイプ:
Sequence[tuple[str, str]]- デフォルト:
()
Additional files that should be inserted after the text generated by Sphinx. It is a list of tuples containing the file name and the title. This option can be used to add an appendix. If the title is empty, no entry is added to
toc.ncx.例:
epub_post_files = [ ('appendix.xhtml', 'Appendix'), ]
- epub_exclude_files¶
- タイプ:
Sequence[str]- デフォルト:
[]
A sequence of files that are generated/copied in the build directory but should not be included in the EPUB file.
- epub_tocdepth¶
- タイプ:
int- デフォルト:
3
The depth of the table of contents in the file
toc.ncx. It should be an integer greater than zero.Tip
A deeply nested table of contents may be difficult to navigate.
- epub_tocdup¶
- タイプ:
bool- デフォルト:
True
This flag determines if a ToC entry is inserted again at the beginning of its nested ToC listing. This allows easier navigation to the top of a chapter, but can be confusing because it mixes entries of different depth in one list.
- epub_tocscope¶
- タイプ:
'default' | 'includehidden'- デフォルト:
'default'
This setting control the scope of the EPUB table of contents. The setting can have the following values:
'default'Include all ToC entries that are not hidden
'includehidden'Include all ToC entries
Added in version 1.2.
- epub_fix_images¶
- タイプ:
bool- デフォルト:
False
Try and fix image formats that are not supported by some EPUB readers. At the moment palette images with a small colour table are upgraded. This is disabled by default because the automatic conversion may lose information. You need the Python Image Library (Pillow) installed to use this option.
Added in version 1.2.
- epub_max_image_width¶
- タイプ:
int- デフォルト:
0
This option specifies the maximum width of images. If it is set to a valuevgreater than zero, images with a width larger than the given value are scaled accordingly. If it is zero, no scaling is performed. You need the Python Image Library (Pillow) installed to use this option.
Added in version 1.2.
- epub_show_urls¶
- タイプ:
'footnote' | 'no' | 'inline'- デフォルト:
'footnote'
Control how to display URL addresses. This is very useful for readers that have no other means to display the linked URL. The setting can have the following values:
'inline'Display URLs inline in parentheses.
'footnote'Display URLs in footnotes.
'no'Do not display URLs.
The display of inline URLs can be customised by adding CSS rules for the class
link-target.Added in version 1.2.
- epub_use_index¶
- タイプ:
bool- デフォルト:
- The value of html_use_index
Add an index to the EPUB document.
Added in version 1.2.
- epub_writing_mode¶
- タイプ:
'horizontal' | 'vertical'- デフォルト:
'horizontal'
It specifies writing direction. It can accept
'horizontal'and'vertical'epub_writing_mode'horizontal''vertical'horizontal-tbvertical-rlpage progression
left to right
right to left
iBook's Scroll Theme support
scroll-axis is vertical.
scroll-axis is horizontal.
LaTeX出力のオプション¶
これらのオプションはLaTeX出力に影響を与えます。
- latex_engine¶
- タイプ:
'pdflatex' | 'xelatex' | 'lualatex' | 'platex' | 'uplatex'- デフォルト:
'pdflatex'
The LaTeX engine to build the documentation. The setting can have the following values:
'pdflatex'-- PDFLaTeX (default)'xelatex'-- XeLaTeX (default iflanguageis one ofel,zh_CN, orzh_TW)'lualatex'-- LuaLaTeX'platex'-- pLaTeX'uplatex'-- upLaTeX (default iflanguageis'ja')
重要
'pdflatex''s support for Unicode characters is limited. If your project uses Unicode characters, setting the engine to'xelatex'or'lualatex'and making sure to use an OpenType font with wide-enough glyph coverage is often easier than trying to make'pdflatex'work with the extra Unicode characters. Since Sphinx 2.0, the default typeface is GNU FreeFont, which has good coverage of Latin, Cyrillic, and Greek glyphs.注釈
Sphinx 2.0 adds support for occasional Cyrillic and Greek letters or words in documents using a Latin language and
'pdflatex'. To enable this, the 'fontenc' key of latex_elements must be used appropriately.注釈
Contrarily to MathJaX math rendering in HTML output, LaTeX requires some extra configuration to support Unicode literals in
math: the only comprehensive solution (as far as we know) is to use'xelatex'or'lualatex'and to addr'\usepackage{unicode-math}'(e.g. via the 'preamble' key of latex_elements). You may preferr'\usepackage[math-style=literal]{unicode-math}'to keep a Unicode literal such asα(U+03B1) as-is in output, rather than being rendered as \(\alpha\).バージョン 2.1.0 で変更: Use
'xelatex'(and LaTeX packagexeCJK) by default for Chinese documents.バージョン 2.2.1 で変更: Use
'xelatex'by default for Greek documents.バージョン 2.3 で変更: Add
'uplatex'support.バージョン 4.0 で変更: Use
'uplatex'by default for Japanese documents.
- latex_documents¶
- タイプ:
Sequence[tuple[str, str, str, str, str, bool]]- デフォルト:
- The default LaTeX documents
This value determines how to group the document tree into LaTeX source files. It must be a list of tuples
(startdocname, targetname, title, author, theme, toctree_only), where the items are:- startdocname
String that specifies the document name of the LaTeX file's master document. All documents referenced by the startdoc document in ToC trees will be included in the LaTeX file. (If you want to use the default master document for your LaTeX build, provide your
master_dochere.)- targetname
File name of the LaTeX file in the output directory.
- title
LaTeX document title. Can be empty to use the title of the startdoc document. This is inserted as LaTeX markup, so special characters like a backslash or ampersand must be represented by the proper LaTeX commands if they are to be inserted literally.
- author
Author for the LaTeX document. The same LaTeX markup caveat as for title applies. Use
\\andto separate multiple authors, as in:'John \\and Sarah'(backslashes must be Python-escaped to reach LaTeX).- theme
LaTeX theme. See
latex_theme.- toctree_only
Must be
TrueorFalse. If True, the startdoc document itself is not included in the output, only the documents referenced by it via ToC trees. With this option, you can put extra stuff in the master document that shows up in the HTML, but not the LaTeX output.
Added in version 0.3: The 6th item
toctree_only. Tuples with 5 items are still accepted.Added in version 1.2: 以前は、あなたのドキュメントクラスを使用するには、ドキュメントクラス名を"sphinx"で始める必要がありました。これはもはや必要ありません。
- latex_logo¶
- タイプ:
str- デフォルト:
''
If given, this must be the name of an image file (path relative to the configuration directory) that is the logo of the documentation. It is placed at the top of the title page.
- latex_toplevel_sectioning¶
- タイプ:
'part' | 'chapter' | 'section'- デフォルト:
None
This value determines the topmost sectioning unit. The default setting is
'section'iflatex_themeis'howto', and'chapter'if it is'manual'. The alternative in both cases is to specify'part', which means that LaTeX document will use the\partcommand.In that case the numbering of sectioning units one level deep gets off-sync with HTML numbering, as by default LaTeX does not reset
\chapternumbering (or\sectionfor'howto'theme) when encountering\partcommand.Added in version 1.4.
- latex_appendices¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of document names to append as an appendix to all manuals. This is ignored if
latex_themeis set to'howto'.
- latex_domain_indices¶
- タイプ:
bool | Sequence[str]- デフォルト:
True
If True, generate domain-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index.
This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name
'py-modindex'.例:
latex_domain_indices = { 'py-modindex', }
Added in version 1.0.
バージョン 7.4 で変更: Permit and prefer a set type.
- latex_show_pagerefs¶
- タイプ:
bool- デフォルト:
False
Add page references after internal references. This is very useful for printed copies of the manual.
Added in version 1.0.
- latex_show_urls¶
- タイプ:
'no' | 'footnote' | 'inline'- デフォルト:
'no'
Control how to display URL addresses. This is very useful for printed copies of the manual. The setting can have the following values:
'no'Do not display URLs
'footnote'Display URLs in footnotes
'inline'Display URLs inline in parentheses
Added in version 1.0.
バージョン 1.1 で変更: This value is now a string; previously it was a boolean value, and a true value selected the
'inline'display. For backwards compatibility,Trueis still accepted.
- latex_use_latex_multicolumn¶
- タイプ:
bool- デフォルト:
False
Use standard LaTeX's
\multicolumnfor merged cells in tables.FalseSphinx's own macros are used for merged cells from grid tables. They allow general contents (literal blocks, lists, blockquotes, ...) but may have problems if the
tabularcolumnsdirective was used to inject LaTeX mark-up of the type>{..},<{..},@{..}as column specification.TrueUse LaTeX's standard
\multicolumn; this is incompatible with literal blocks in horizontally merged cells, and also with multiple paragraphs in such cells if the table is rendered usingtabulary.
Added in version 1.6.
- latex_table_style¶
- タイプ:
list[str]- デフォルト:
['booktabs', 'colorrows']
A list of styling classes (strings). Currently supported:
'booktabs'No vertical lines, and only 2 or 3 horizontal lines (the latter if there is a header), using the booktabs package.
'borderless'No lines whatsoever.
'colorrows'The table rows are rendered with alternating background colours. The interface to customise them is via dedicated keys of The sphinxsetup configuration setting.
重要
With the
'colorrows'style, the\rowcolorsLaTeX command becomes a no-op (this command has limitations and has never correctly supported all types of tables Sphinx produces in LaTeX). Please use the latex table color configuration keys instead.
To customise the styles for a table, use the
:class:option if the table is defined using a directive, or otherwise insert a rst-class directive before the table (cf. テーブル).Currently recognised classes are
booktabs,borderless,standard,colorrows,nocolorrows. The latter two can be combined with any of the first three. Thestandardclass produces tables with both horizontal and vertical lines (as had been the default prior to Sphinx 6.0.0).A single-row multi-column merged cell will obey the row colour, if it is set. See also
TableMergeColor{Header,Odd,Even}in the The sphinxsetup configuration setting section.注釈
It is hard-coded in LaTeX that a single cell will obey the row colour even if there is a column colour set via
\columncolorfrom a column specification (seetabularcolumns). Sphinx provides\sphinxnorowcolorwhich can be used in a table column specification like this:>{\columncolor{blue}\sphinxnorowcolor}
Sphinx also provides
\sphinxcolorblend, which however requires the xcolor package. Here is an example:>{\sphinxcolorblend{!95!red}}
It means that in this column, the row colours will be slightly tinted by red; refer to xcolor documentation for more on the syntax of its
\blendcolorscommand (a\blendcolorsin place of\sphinxcolorblendwould modify colours of the cell contents, not of the cell background colour panel...). You can find an example of usage in the 非推奨 API section of this document in PDF format.ヒント
If you want to use a special colour for the contents of the cells of a given column use
>{\noindent\color{<color>}}, possibly in addition to the above.Multi-row merged cells, whether single column or multi-column currently ignore any set column, row, or cell colour.
It is possible for a simple cell to set a custom colour via the raw directive and the
\cellcolorLaTeX command used anywhere in the cell contents. This currently is without effect in a merged cell, whatever its kind.
ヒント
In a document not using
'booktabs'globally, it is possible to style an individual table via thebooktabsclass, but it will be necessary to addr'\usepackage{booktabs}'to the LaTeX preamble.On the other hand one can use
colorrowsclass for individual tables with no extra package (as Sphinx since 5.3.0 always loads colortbl).Added in version 5.3.0.
バージョン 6.0.0 で変更: Modify default from
[]to['booktabs', 'colorrows'].
- latex_use_xindy¶
- タイプ:
bool- デフォルト:
True if latex_engine in {'xelatex', 'lualatex'} else False
Use Xindy to prepare the index of general terms. By default, the LaTeX builder uses makeindex for preparing the index of general terms . Using Xindy means that words with UTF-8 characters will be ordered correctly for the
language.This option is ignored if
latex_engineis'platex'(Japanese documents; mendex replaces makeindex then).The default is
Truefor'xelatex'or'lualatex'as makeindex creates.indfiles containing invalid bytes for the UTF-8 encoding if any indexed term starts with a non-ASCII character. With'lualatex'this then breaks the PDF build.The default is
Falsefor'pdflatex', butTrueis recommended for non-English documents as soon as some indexed terms use non-ASCII characters from the language script. Attempting to index a term whose first character is non-ASCII will break the build, iflatex_use_xindyis left to its defaultFalse.
Sphinx adds some dedicated support to the xindy base distribution for using
'pdflatex'engine with Cyrillic scripts. With both'pdflatex'and Unicode engines, Cyrillic documents handle the indexing of Latin names correctly, even those having diacritics.Added in version 1.8.
- latex_elements¶
- タイプ:
dict[str, str]- デフォルト:
{}
Added in version 0.5.
- latex_docclass¶
- タイプ:
dict[str, str]- デフォルト:
{}
A dictionary mapping
'howto'and'manual'to names of real document classes that will be used as the base for the two Sphinx classes. Default is to use'article'for'howto'and'report'for'manual'.Added in version 1.0.
バージョン 1.5 で変更: In Japanese documentation (
languageis'ja'), by default'jreport'is used for'howto'and'jsbook'for'manual'.
- latex_additional_files¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of file names, relative to the configuration directory, to copy to the build directory when building LaTeX output. This is useful to copy files that Sphinx doesn't copy automatically, or to overwrite Sphinx LaTeX support files with custom versions. Image files that are referenced in source files (e.g. via
.. image::) are copied automatically and should not be listed there.注意
Filenames with the
.texextension will be automatically handed over to the PDF build process triggered bysphinx-build -M latexpdfor by make latexpdf. If the file was added only to be\input{}from a modified preamble, you must add a further suffix such as.txtto the filename and adjust the\input{}macro accordingly.Added in version 0.6.
バージョン 1.2 で変更: This overrides the files provided from Sphinx such as
sphinx.sty.
- latex_theme¶
- タイプ:
str- デフォルト:
'manual'
The "theme" that the LaTeX output should use. It is a collection of settings for LaTeX output (e.g. document class, top level sectioning unit and so on).
The bundled first-party LaTeX themes are manual and howto:
manualA LaTeX theme for writing a manual. It imports the
reportdocument class (Japanese documents usejsbook).howtoA LaTeX theme for writing an article. It imports the
articledocument class (Japanese documents usejreport).latex_appendicesis only available for this theme.
Added in version 3.0.
- latex_theme_options¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary of options that influence the look and feel of the selected theme. These are theme-specific.
Added in version 3.1.
- latex_theme_path¶
- タイプ:
list[str]- デフォルト:
[]
A list of paths that contain custom LaTeX themes as subdirectories. Relative paths are taken as relative to the configuration directory.
Added in version 3.0.
テキスト出力のオプション¶
これらのオプションは、テキスト出力に影響を与えます。
- text_add_secnumbers¶
- タイプ:
bool- デフォルト:
True
Include section numbers in text output.
Added in version 1.7.
- text_newlines¶
- タイプ:
'unix' | 'windows' | 'native'- デフォルト:
'unix'
テキスト出力で、どの改行コードを使用するのかを決定します。
'unix'Use Unix-style line endings (
\n).'windows'Use Windows-style line endings (
\r\n).'native'Use the line ending style of the platform the documentation is built on.
Added in version 1.1.
- text_secnumber_suffix¶
- タイプ:
str- デフォルト:
'. '
Suffix for section numbers in text output. Set to
' 'to suppress the final dot on section numbers.Added in version 1.7.
- text_sectionchars¶
- タイプ:
str- デフォルト:
'*=-~"+`'
7文字の文字列で、セクションタイトルで指定する記号を設定します。それぞれ、1文字目が最初のヘッダ、2文字目が2段目のヘッダとして使用されます。
Added in version 1.1.
manページ出力のオプション¶
これらのオプションは、manページ出力に影響を与えます。
- man_pages¶
- タイプ:
Sequence[tuple[str, str, str, str, str]]- デフォルト:
- The default manual pages
This value determines how to group the document tree into manual pages. It must be a list of tuples
(startdocname, name, description, authors, section), where the items are:- startdocname
String that specifies the document name of the manual page's master document. All documents referenced by the startdoc document in ToC trees will be included in the manual page. (If you want to use the default master document for your manual pages build, provide your
master_dochere.)- name
Name of the manual page. This should be a short string without spaces or special characters. It is used to determine the file name as well as the name of the manual page (in the NAME section).
- description
Description of the manual page. This is used in the NAME section. Can be an empty string if you do not want to automatically generate the NAME section.
- authors
A list of strings with authors, or a single string. Can be an empty string or list if you do not want to automatically generate an AUTHORS section in the manual page.
- section
The manual page section. Used for the output file name as well as in the manual page header.
Added in version 1.0.
- man_show_urls¶
- タイプ:
bool- デフォルト:
False
Add URL addresses after links.
Added in version 1.1.
- man_make_section_directory¶
- タイプ:
bool- デフォルト:
True
Make a section directory on build man page.
Added in version 3.3.
バージョン 4.0 で変更: The default is now
False(previouslyTrue).バージョン 4.0.2 で変更: Revert the change in the default.
Texinfo出力のオプション¶
これらのオプションは、Texinfo出力に影響を与えます。
- texinfo_documents¶
- タイプ:
Sequence[tuple[str, str, str, str, str, str, str, bool]]- デフォルト:
- The default Texinfo documents
This value determines how to group the document tree into Texinfo source files. It must be a list of tuples
(startdocname, targetname, title, author, dir_entry, description, category, toctree_only), where the items are:- startdocname
String that specifies the document name of the Texinfo file's master document. All documents referenced by the startdoc document in ToC trees will be included in the Texinfo file. (If you want to use the default master document for your Texinfo build, provide your
master_dochere.)- targetname
File name (no extension) of the Texinfo file in the output directory.
- title
Texinfo document title. Can be empty to use the title of the startdoc document. Inserted as Texinfo markup, so special characters like
@and{}will need to be escaped to be inserted literally.- author
Author for the Texinfo document. Inserted as Texinfo markup. Use
@*to separate multiple authors, as in:'John@*Sarah'.- dir_entry
The name that will appear in the top-level
DIRmenu file.- description
Descriptive text to appear in the top-level
DIRmenu file.- category
Specifies the section which this entry will appear in the top-level
DIRmenu file.- toctree_only
Must be
TrueorFalse. If True, the startdoc document itself is not included in the output, only the documents referenced by it via ToC trees. With this option, you can put extra stuff in the master document that shows up in the HTML, but not the Texinfo output.
Added in version 1.1.
- texinfo_appendices¶
- タイプ:
Sequence[str]- デフォルト:
[]
すべてのマニュアルのAppendixに追加されるドキュメント名のリストです。
Added in version 1.1.
- texinfo_cross_references¶
- タイプ:
bool- デフォルト:
True
Generate inline references in a document. Disabling inline references can make an info file more readable with a stand-alone reader (
info).Added in version 4.4.
- texinfo_domain_indices¶
- タイプ:
bool | Sequence[str]- デフォルト:
True
If True, generate domain-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index.
This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name
'py-modindex'.例:
texinfo_domain_indices = { 'py-modindex', }
Added in version 1.1.
バージョン 7.4 で変更: Permit and prefer a set type.
- texinfo_elements¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary that contains Texinfo snippets that override those that Sphinx usually puts into the generated
.texifiles.オーバーライドできるキーには、次のようなものがあります:
'paragraphindent'Number of spaces to indent the first line of each paragraph, default
2. Specify0for no indentation.'exampleindent'Number of spaces to indent the lines for examples or literal blocks, default
4. Specify0for no indentation.'preamble'Texinfoはこのファイルの先頭付近に挿入されます。
'copying'Texinfo markup inserted within the
@copyingblock and displayed after the title. The default value consists of a simple title page identifying the project.
Keys that are set by other options and therefore should not be overridden are
'author','body','date','direntry''filename','project','release', and'title'.
Added in version 1.1.
- タイプ:
bool- デフォルト:
False
Do not generate a
@detailmenuin the "Top" node's menu containing entries for each sub-node in the document.Added in version 1.2.
- texinfo_show_urls¶
- タイプ:
'footnote' | 'no' | 'inline'- デフォルト:
'footnote'
Control how to display URL addresses. The setting can have the following values:
'footnote'Display URLs in footnotes.
'no'Do not display URLs.
'inline'Display URLs inline in parentheses.
Added in version 1.1.
Options for QtHelp output¶
These options influence qthelp output. This builder derives from the HTML builder, so the HTML options also apply where appropriate.
- qthelp_basename¶
- タイプ:
str- デフォルト:
- The value of project
The basename for the qthelp file.
- qthelp_namespace¶
- タイプ:
str- デフォルト:
'org.sphinx.{project_name}.{project_version}'
The namespace for the qthelp file.
- qthelp_theme¶
- タイプ:
str- デフォルト:
'nonav'
The HTML theme for the qthelp output.
- qthelp_theme_options¶
- タイプ:
dict[str, Any]- デフォルト:
{}
A dictionary of options that influence the look and feel of the selected theme. These are theme-specific. The options understood by the builtin themes are described here.
Options for XML output¶
- xml_pretty¶
- タイプ:
bool- デフォルト:
True
Pretty-print the XML.
Added in version 1.2.
リンクチェックビルダーのオプション¶
Filtering¶
These options control which links the linkcheck builder checks, and which failures and redirects it ignores.
- linkcheck_allowed_redirects¶
- タイプ:
dict[str, str]
A dictionary that maps a pattern of the source URI to a pattern of the canonical URI. The linkcheck builder treats the redirected link as "working" when:
the link in the document matches the source URI pattern, and
the redirect location matches the canonical URI pattern.
The linkcheck builder will emit a warning when it finds redirected links that don't meet the rules above. It can be useful to detect unexpected redirects when using
the fail-on-warnings mode.例:
linkcheck_allowed_redirects = { # All HTTP redirections from the source URI to # the canonical URI will be treated as "working". r'https://sphinx-doc\.org/.*': r'https://sphinx-doc\.org/en/master/.*' }
Added in version 4.1.
バージョン 9.0 で変更: Setting
linkcheck_allowed_redirectsto an empty dictionary may now be used to warn on all redirects encountered by the linkcheck builder.
- linkcheck_anchors¶
- タイプ:
bool- デフォルト:
True
Check the validity of
#anchors in links. Since this requires downloading the whole document, it is considerably slower when enabled.Added in version 1.2.
- linkcheck_anchors_ignore¶
- タイプ:
Sequence[str]- デフォルト:
["^!"]
A list of regular expressions that match anchors that the linkcheck builder should skip when checking the validity of anchors in links. For example, this allows skipping anchors added by a website's JavaScript.
Tip
Use
linkcheck_anchors_ignore_for_urlto check a URL, but skip verifying that the anchors exist.注釈
If you want to ignore anchors of a specific page or of pages that match a specific pattern (but still check occurrences of the same page(s) that don't have anchors), use
linkcheck_ignoreinstead, for example as follows:linkcheck_ignore = [ 'https://www.sphinx-doc.org/en/1.7/intro.html#', ]
Added in version 1.5.
- linkcheck_anchors_ignore_for_url¶
- タイプ:
Sequence[str]- デフォルト:
()
A list or tuple of regular expressions matching URLs for which the linkcheck builder should not check the validity of anchors. This allows skipping anchor checks on a per-page basis while still checking the validity of the page itself.
Added in version 7.1.
- linkcheck_exclude_documents¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of regular expressions that match documents in which the linkcheck builder should not check the validity of links. This can be used for permitting link decay in legacy or historical sections of the documentation.
例:
# ignore all links in documents located in a subdirectory named 'legacy' linkcheck_exclude_documents = [r'.*/legacy/.*']
Added in version 4.4.
- linkcheck_ignore¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of regular expressions that match URIs that should not be checked when doing a
linkcheckbuild.Server-issued redirects that match
ignored URIswill not be followed.例:
linkcheck_ignore = [r'https://localhost:\d+/']
Added in version 1.1.
HTTP Requests¶
These options control how the linkcheck builder makes HTTP requests, including how it handles redirects and authentication, and the number of workers to use.
- linkcheck_auth¶
- タイプ:
Sequence[tuple[str, Any]]- デフォルト:
[]
Pass authentication information when doing a
linkcheckbuild.A list of
(regex_pattern, auth_info)tuples where the items are:- regex_pattern
A regular expression that matches a URI.
- auth_info
Authentication information to use for that URI. The value can be anything that is understood by the
requestslibrary (see requests authentication for details).
The linkcheck builder will use the first matching
auth_infovalue it can find in thelinkcheck_authlist, so values earlier in the list have higher priority.例:
linkcheck_auth = [ ('https://foo\.yourcompany\.com/.+', ('johndoe', 'secret')), ('https://.+\.yourcompany\.com/.+', HTTPDigestAuth(...)), ]
Added in version 2.3.
- linkcheck_allow_unauthorized¶
- タイプ:
bool- デフォルト:
False
When a webserver responds with an HTTP 401 (unauthorised) response, the current default behaviour of the linkcheck builder is to treat the link as "broken". To change that behaviour, set this option to
True.バージョン 8.0 で変更: The default value for this option changed to
False, meaning HTTP 401 responses to checked hyperlinks are treated as "broken" by default.Added in version 7.3.
- linkcheck_case_insensitive_urls¶
- タイプ:
Set[str] | Sequence[str]- デフォルト:
()
A collection of regular expressions that match URLs for which the linkcheck builder should perform case-insensitive comparisons. This is useful for links to websites that are case-insensitive or normalise URL casing.
By default, linkcheck requires the destination URL to match the documented URL case-sensitively. For example, a link to
http://example.org/PATHthat redirects tohttp://example.org/pathwill be reported asredirected.If the URL matches a pattern contained in
linkcheck_case_insensitive_urls, it would instead be reported asworking.For example, to treat all GitHub URLs as case-insensitive:
linkcheck_case_insensitive_urls = [ r'https://github\.com/.*', ]
Or, to treat all URLs as case-insensitive:
linkcheck_case_insensitive_urls = ['.*']
注釈
URI fragments (HTML anchors) are not affected by this option. They are always checked with case-sensitive comparisons.
Added in version 9.0.
- linkcheck_rate_limit_timeout¶
- タイプ:
int- デフォルト:
300
The linkcheck builder may issue a large number of requests to the same site over a short period of time. This setting controls the builder behaviour when servers indicate that requests are rate-limited, by setting the maximum duration (in seconds) that the builder will wait for between each attempt before recording a failure.
The linkcheck builder always respects a server's direction of when to retry (using the Retry-After header). Otherwise,
linkcheckwaits for a minute before to retry and keeps doubling the wait time between attempts until it succeeds or exceeds thelinkcheck_rate_limit_timeout(in seconds). Custom timeouts should be given as a number of seconds.Added in version 3.4.
- linkcheck_report_timeouts_as_broken¶
- タイプ:
bool- デフォルト:
False
If
linkcheck_timeoutexpires while waiting for a response from a hyperlink, the linkcheck builder will report the link as atimeoutby default. To report timeouts asbrokeninstead, you can setlinkcheck_report_timeouts_as_brokentoTrue.バージョン 8.0 で変更: The default value for this option changed to
False, meaning timeouts that occur while checking hyperlinks will be reported using the new 'timeout' status code.Added in version 7.3.
- linkcheck_request_headers¶
- タイプ:
dict[str, dict[str, str]]- デフォルト:
{}
A dictionary that maps URL (without paths) to HTTP request headers.
The key is a URL base string like
'https://www.sphinx-doc.org/'. To specify headers for other hosts,"*"can be used. It matches all hosts only when the URL does not match other settings.The value is a dictionary that maps header name to its value.
例:
linkcheck_request_headers = { "https://www.sphinx-doc.org/": { "Accept": "text/html", "Accept-Encoding": "utf-8", }, "*": { "Accept": "text/html,application/xhtml+xml", } }
Added in version 3.1.
- linkcheck_retries¶
- タイプ:
int- デフォルト:
1
The number of times the linkcheck builder will attempt to check a URL before declaring it broken.
Added in version 1.4.
- linkcheck_timeout¶
- タイプ:
int- デフォルト:
30
The duration, in seconds, that the linkcheck builder will wait for a response after each hyperlink request.
Added in version 1.1.
- linkcheck_workers¶
- タイプ:
int- デフォルト:
5
The number of worker threads to use when checking links.
Added in version 1.1.
Domain options¶
Options for the C domain¶
- c_extra_keywords¶
- タイプ:
Set[str] | Sequence[str]- デフォルト:
['alignas', 'alignof', 'bool', 'complex', 'imaginary', 'noreturn', 'static_assert', 'thread_local']
A list of identifiers to be recognised as keywords by the C parser.
Added in version 4.0.3.
バージョン 7.4 で変更:
c_extra_keywordscan now be a set.
- c_id_attributes¶
- タイプ:
Sequence[str]- デフォルト:
()
A sequence of strings that the parser should additionally accept as attributes. For example, this can be used when
#definehas been used for attributes, for portability.例:
c_id_attributes = [ 'my_id_attribute', ]
Added in version 3.0.
バージョン 7.4 で変更:
c_id_attributescan now be a tuple.
- c_maximum_signature_line_length¶
- タイプ:
int | None- デフォルト:
None
If a signature's length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line.
When
None, there is no maximum length and the entire signature will be displayed on a single logical line.This is a domain-specific setting, overriding
maximum_signature_line_length.Added in version 7.1.
- c_paren_attributes¶
- タイプ:
Sequence[str]- デフォルト:
()
A sequence of strings that the parser should additionally accept as attributes with one argument. That is, if
my_align_asis in the list, thenmy_align_as(X)is parsed as an attribute for all stringsXthat have balanced braces ((),[], and{}). For example, this can be used when#definehas been used for attributes, for portability.例:
c_paren_attributes = [ 'my_align_as', ]
Added in version 3.0.
バージョン 7.4 で変更:
c_paren_attributescan now be a tuple.
C++ ドメインのオプション¶
- cpp_id_attributes¶
- タイプ:
Sequence[str]- デフォルト:
()
A sequence of strings that the parser should additionally accept as attributes. For example, this can be used when
#definehas been used for attributes, for portability.例:
cpp_id_attributes = [ 'my_id_attribute', ]
Added in version 1.5.
バージョン 7.4 で変更:
cpp_id_attributescan now be a tuple.
- cpp_index_common_prefix¶
- タイプ:
Sequence[str]- デフォルト:
()
A list of prefixes that will be ignored when sorting C++ objects in the global index.
例:
cpp_index_common_prefix = [ 'awesome_lib::', ]
Added in version 1.5.
- cpp_maximum_signature_line_length¶
- タイプ:
int | None- デフォルト:
None
If a signature's length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line.
When
None, there is no maximum length and the entire signature will be displayed on a single logical line.This is a domain-specific setting, overriding
maximum_signature_line_length.Added in version 7.1.
- cpp_paren_attributes¶
- タイプ:
Sequence[str]- デフォルト:
()
A sequence of strings that the parser should additionally accept as attributes with one argument. That is, if
my_align_asis in the list, thenmy_align_as(X)is parsed as an attribute for all stringsXthat have balanced braces ((),[], and{}). For example, this can be used when#definehas been used for attributes, for portability.例:
cpp_paren_attributes = [ 'my_align_as', ]
Added in version 1.5.
バージョン 7.4 で変更:
cpp_paren_attributescan now be a tuple.
Options for the Javascript domain¶
- javascript_maximum_signature_line_length¶
- タイプ:
int | None- デフォルト:
None
If a signature's length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line.
When
None, there is no maximum length and the entire signature will be displayed on a single logical line.This is a domain-specific setting, overriding
maximum_signature_line_length.Added in version 7.1.
- javascript_trailing_comma_in_multi_line_signatures¶
- タイプ:
bool- デフォルト:
True
Use a trailing comma in parameter lists spanning multiple lines, if true.
Added in version 8.2.
Options for the Python domain¶
- add_module_names¶
- タイプ:
bool- デフォルト:
True
A boolean that decides whether module names are prepended to all object names (for object types where a "module" of some kind is defined), e.g. for
py:functiondirectives.
- modindex_common_prefix¶
- タイプ:
list[str]- デフォルト:
[]
A list of prefixes that are ignored for sorting the Python module index (e.g., if this is set to
['foo.'], thenfoo.baris shown underB, notF). This can be handy if you document a project that consists of a single package.注意
Works only for the HTML builder currently.
Added in version 0.6.
- python_display_short_literal_types¶
- タイプ:
bool- デフォルト:
False
This value controls how
Literaltypes are displayed.サンプル¶
The examples below use the following
py:functiondirective:.. py:function:: serve_food(item: Literal["egg", "spam", "lobster thermidor"]) -> None
When
False,Literaltypes display as per standard Python syntax, i.e.:serve_food(item: Literal["egg", "spam", "lobster thermidor"]) -> None
When
True,Literaltypes display with a short, PEP 604-inspired syntax, i.e.:serve_food(item: "egg" | "spam" | "lobster thermidor") -> None
Added in version 6.2.
- python_maximum_signature_line_length¶
- タイプ:
int | None- デフォルト:
None
If a signature's length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line.
When
None, there is no maximum length and the entire signature will be displayed on a single logical line.This is a domain-specific setting, overriding
maximum_signature_line_length.For the Python domain, the signature length depends on whether the type parameters or the list of arguments are being formatted. For the former, the signature length ignores the length of the arguments list; for the latter, the signature length ignores the length of the type parameters list.
For instance, with
python_maximum_signature_line_length = 20, only the list of type parameters will be wrapped while the arguments list will be rendered on a single line.. py:function:: add[T: VERY_LONG_SUPER_TYPE, U: VERY_LONG_SUPER_TYPE](a: T, b: U)
Added in version 7.1.
- python_trailing_comma_in_multi_line_signatures¶
- タイプ:
bool- デフォルト:
True
Use a trailing comma in parameter lists spanning multiple lines, if true.
Added in version 8.2.
- python_use_unqualified_type_names¶
- タイプ:
bool- デフォルト:
False
Suppress the module name of the python reference if it can be resolved.
Added in version 4.0.
注意
This feature is experimental.
- trim_doctest_flags¶
- タイプ:
bool- デフォルト:
True
Remove doctest flags (comments looking like
# doctest: FLAG, ...) at the ends of lines and<BLANKLINE>markers for all code blocks showing interactive Python sessions (i.e. doctests). See the extensiondoctestfor more possibilities of including doctests.Added in version 1.0.
バージョン 1.1 で変更:
<BLANKLINE>も削除対象にしました。
拡張オプション¶
Extensions frequently have their own configuration options. Those for Sphinx's first-party extensions are documented in each extension's page.
Example configuration file¶
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'Test Project'
copyright = '2000-2042, The Test Project Authors'
author = 'The Authors'
version = release = '4.16'
# -- General configuration ------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
exclude_patterns = [
'_build',
'Thumbs.db',
'.DS_Store',
]
extensions = []
language = 'en'
master_doc = 'index'
pygments_style = 'sphinx'
source_suffix = '.rst'
templates_path = ['_templates']
# -- Options for HTML output ----------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'alabaster'
html_static_path = ['_static']