发布于 2015-09-16 15:40:55 | 344 次阅读 | 评论: 0 | 来源: 网络整理
The configuration directory must contain a file named conf.py
. This file (containing Python code) is called the “build configuration file” and contains all configuration needed to customize Sphinx input and output behavior.
The configuration file is executed as Python code at build time (using execfile()
, and with the current directory set to its containing directory), and therefore can execute arbitrarily complex code. Sphinx then reads simple names from the file’s namespace as its configuration.
Important points to note:
"sphinx.builders.Builder"
means the Builder
class in the sphinx.builders
module./
as the path separator and don’t contain the file name extension.conf.py
is read as a Python file, the usual rules apply for encodings and Unicode support: declare the encoding using an encoding cookie (a comment like # -*- coding: utf-8 -*-
) and use Unicode string literals when you include non-ASCII characters in configuration values.del
if appropriate. Modules are removed automatically, so you don’t need to del
your imports after use.tags
available in the config file. It can be used to query and change the tags (see 包含基于标签的内容). Use tags.has('tag')
to query, tags.add('tag')
and tags.remove('tag')
to change.These options influence Sphinx’ Native Language Support. See the documentation on Internationalization for details.
These options influence HTML as well as HTML Help output, and other builders that use Sphinx’ HTMLWriter class.
These options influence the epub output. As this builder derives from the HTML builder, the HTML options also apply where appropriate. The actual values for some of the options is not really important, they just have to be entered into the Dublin Core metadata.
These options influence LaTeX output.
These options influence text output.
These options influence manual page output.
These options influence Texinfo output.
Footnotes
[1] | A note on available globbing syntax: you can use the standard shell constructs * , ? , [...] and [!...] with the feature that these all don’t match slashes. A double star ** can be used to match any sequence of characters including slashes. |