本文整理汇总了Python中sphinx.setup_command.BuildDoc方法的典型用法代码示例。如果您正苦于以下问题:Python setup_command.BuildDoc方法的具体用法?Python setup_command.BuildDoc怎么用?Python setup_command.BuildDoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.setup_command
的用法示例。
在下文中一共展示了setup_command.BuildDoc方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finalize_options
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def finalize_options(self):
# Not a new style class, super keyword does not work.
setup_command.BuildDoc.finalize_options(self)
# Handle builder option from command line - override cfg
option_dict = self.distribution.get_option_dict('build_sphinx')
if 'command line' in option_dict.get('builder', [[]])[0]:
self.builders = option_dict['builder'][1]
# Allow builders to be configurable - as a comma separated list.
if not isinstance(self.builders, list) and self.builders:
self.builders = self.builders.split(',')
# NOTE(dstanek): check for autodoc tree exclusion overrides
# in the setup.cfg
opt = 'autodoc_tree_excludes'
option_dict = self.distribution.get_option_dict('pbr')
if opt in option_dict:
self.autodoc_tree_excludes = option_dict[opt][1]
self.ensure_string_list(opt)
示例2: __init__
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def __init__(self, dist):
super(SDCBuildDoc, self).__init__(dist)
self.format = 'html'
self.doctype = 'user'
try:
from sphinx.setup_command import BuildDoc
except ImportError:
raise ImportError('Cannot import Sphinx. '
'Sphinx is the expected dependency for Intel SDC documentation build')
self._remove_cwd_from_syspath()
self.sdc_build_doc_command = BuildDoc(dist)
self.sdc_build_doc_command.initialize_options()
# Sphinx Developer's Documentation Build
#class build_devdoc(build.build):
# description = "Build developer's documentation"
#
# def run(self):
# spawn(['rm', '-rf', 'docs/_builddev'])
# spawn(['sphinx-build', '-b', 'html', '-d', 'docs/_builddev/docstrees',
# '-j1', 'docs/devsource', '-t', 'developer', 'docs/_builddev/html'])
示例3: __getattr__
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def __getattr__(self, attr):
from sphinx.setup_command import BuildDoc
return getattr(BuildDoc, attr)
示例4: __setattr__
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def __setattr__(self, attr, value):
from sphinx.setup_command import BuildDoc
setattr(BuildDoc, attr, value)
示例5: __call__
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def __call__(self, *args, **kwargs):
from sphinx.setup_command import BuildDoc
return BuildDoc(*args, **kwargs)
# Sphinx manpages and bash completion do not work on Windows
示例6: run
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def run(self):
option_dict = self.distribution.get_option_dict('pbr')
if git._git_is_installed():
git.write_git_changelog(option_dict=option_dict)
git.generate_authors(option_dict=option_dict)
tree_index = options.get_boolean_option(option_dict,
'autodoc_tree_index_modules',
'AUTODOC_TREE_INDEX_MODULES')
auto_index = options.get_boolean_option(option_dict,
'autodoc_index_modules',
'AUTODOC_INDEX_MODULES')
if not os.getenv('SPHINX_DEBUG'):
# NOTE(afazekas): These options can be used together,
# but they do a very similar thing in a different way
if tree_index:
self._sphinx_tree()
if auto_index:
self.generate_autoindex(
set(option_dict.get(
"autodoc_exclude_modules",
[None, ""])[1].split()))
for builder in self.builders:
self.builder = builder
self.finalize_options()
self.project = self.distribution.get_name()
self.version = self.distribution.get_version()
self.release = self.distribution.get_version()
if options.get_boolean_option(option_dict,
'warnerrors', 'WARNERRORS'):
self._sphinx_run()
else:
setup_command.BuildDoc.run(self)
示例7: initialize_options
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def initialize_options(self):
# Not a new style class, super keyword does not work.
setup_command.BuildDoc.initialize_options(self)
# NOTE(dstanek): exclude setup.py from the autodoc tree index
# builds because all projects will have an issue with it
self.autodoc_tree_excludes = ['setup.py']
示例8: run
# 需要导入模块: from sphinx import setup_command [as 别名]
# 或者: from sphinx.setup_command import BuildDoc [as 别名]
def run(self):
# make sure the python path is pointing to the newly built
# code so that the documentation is built on this and not a
# previously installed version
build = self.get_finalized_command('build')
sys.path.insert(0, os.path.abspath(build.build_lib))
try:
sphinx.setup_command.BuildDoc.run(self)
except UnicodeDecodeError:
print("ERROR: unable to build documentation"
" because Sphinx do not handle"
" source path with non-ASCII characters. Please"
" try to move the source package to another"
" location (path with *only* ASCII characters)")
sys.path.pop(0)