本文整理汇总了Python中sphinx.application.Sphinx.add_builder方法的典型用法代码示例。如果您正苦于以下问题:Python Sphinx.add_builder方法的具体用法?Python Sphinx.add_builder怎么用?Python Sphinx.add_builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.application.Sphinx
的用法示例。
在下文中一共展示了Sphinx.add_builder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import add_builder [as 别名]
def setup(app: Sphinx) -> Dict[str, Any]:
app.setup_extension('sphinx.builders.html')
app.add_builder(JSONHTMLBuilder)
app.add_builder(PickleHTMLBuilder)
app.add_message_catalog(__name__, path.join(package_dir, 'locales'))
return {
'version': __version__,
'parallel_read_safe': True,
'parallel_write_safe': True,
}
示例2: __run_sphinx
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import add_builder [as 别名]
def __run_sphinx(self):
"""Run sphinx to generate the necessary output files.
This method creates a temporary directory for sphinx's output, then
run sphinx against the Hyde input directory.
"""
logger.info("running sphinx")
self.__build_dir = Folder(tempfile.mkdtemp())
sphinx_app = Sphinx(
self.node().path,
self.node().path,
self.__build_dir.path,
self.node().path,
"json"
)
sphinx_app.add_builder(HydeJSONHTMLBuilder)
sphinx_app._init_builder("hyde_json")
sphinx_app.build()