本文整理汇总了Python中sphinx.application.Sphinx.publisher方法的典型用法代码示例。如果您正苦于以下问题:Python Sphinx.publisher方法的具体用法?Python Sphinx.publisher怎么用?Python Sphinx.publisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.application.Sphinx
的用法示例。
在下文中一共展示了Sphinx.publisher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_sphinx
# 需要导入模块: from sphinx.application import Sphinx [as 别名]
# 或者: from sphinx.application.Sphinx import publisher [as 别名]
def get_sphinx():
sphinx = getattr(local_data, 'sphinx', None)
if sphinx is None:
sphinx = Sphinx(tempdir, tempdir, tempdir,
tempdir, 'json', status=None, warning=None)
sphinx.builder.translator_class = CustomHTMLTranslator
sphinx.env.patch_lookup_functions()
sphinx.env.temp_data['docname'] = 'text'
sphinx.env.temp_data['default_domain'] = 'py'
pub = Publisher(reader=None,
parser=None,
writer=HTMLWriter(sphinx.builder),
source_class=io.StringInput,
destination_class=io.NullOutput)
pub.set_components('standalone', 'restructuredtext', None)
pub.process_programmatic_settings(None, sphinx.env.settings, None)
pub.set_destination(None, None)
sphinx.publisher = pub
local_data.sphinx = sphinx
return sphinx, sphinx.publisher