本文整理汇总了Python中sphinx.setup_command.BuildDoc.run方法的典型用法代码示例。如果您正苦于以下问题:Python BuildDoc.run方法的具体用法?Python BuildDoc.run怎么用?Python BuildDoc.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphinx.setup_command.BuildDoc
的用法示例。
在下文中一共展示了BuildDoc.run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
""" Execute the build_sphinx command.
The HTML and PDF docs will be included in the tarball. So this script
MUST be executed before creating the distributable tarball.
"""
# Build the Users Guide in HTML and TeX format
for builder in ('html', 'pdf'):
# Tidy up before every build
try:
os.remove(os.path.join(self.source_dir, 'index.rst'))
except OSError:
pass
shutil.rmtree(self.doctree_dir, True)
self.builder = builder
self.builder_target_dir = os.path.join(self.build_dir, builder)
self.mkpath(self.builder_target_dir)
builder_index = 'index_{0}.txt'.format(builder)
copy_file(os.path.join(self.source_dir, builder_index),
os.path.join(self.source_dir, 'index.rst'))
BuildDoc.run(self)
# Copy the docs to their final destination:
# HTML docs (Users Guide and License) -> ./vitables/htmldocs
# PDF guide -> ./doc
output_dir = os.path.join("vitables", "htmldocs")
if not os.access(output_dir, os.F_OK):
# Include the HTML guide and the license in the package
copy_tree(os.path.join(self.build_dir,"html"), output_dir)
shutil.rmtree(os.path.join(output_dir,"_sources"))
copy_file('LICENSE.html', output_dir)
copy_file(os.path.join(self.build_dir, "pdf",
"UsersGuide.pdf"), "doc")
示例2: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
subprocess.call('sphinx-apidoc -f -o doc/source keystone',
shell=True)
for builder in ['html', 'man']:
self.builder = builder
self.finalize_options()
BuildDoc.run(self)
示例3: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
base_dir = os.path.dirname(os.path.abspath(__file__))
subprocess.Popen(["python", "generate_autodoc_index.py"], cwd=os.path.join(base_dir, "doc")).communicate()
for builder in ["html", "man"]:
self.builder = builder
self.finalize_options()
BuildDoc.run(self)
示例4: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
ret = subprocess.call(
[sys.executable, sys.argv[0], 'build_ext', '-i']
)
if ret != 0:
raise RuntimeError("Building Scipy failed!")
SphinxBuildDoc.run(self)
示例5: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
# We need to create some assets in the source tree first...
from robot.libdoc import libdoc
out_file = os.path.join(self.source_dir, 'robot-doc.html')
libdoc('DrupalLibrary::None', out_file)
# ... before running the regular Sphinx builder
BuildDoc.run(self)
示例6: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [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))
# Copy gui files to the path:
dst = os.path.join(os.path.abspath(build.build_lib), "pyFAI", "gui")
if not os.path.isdir(dst):
os.makedirs(dst)
for i in os.listdir("gui"):
if i.endswith(".ui"):
src = os.path.join("gui", i)
idst = os.path.join(dst, i)
if not os.path.exists(idst):
shutil.copy(src, idst)
# Build the Users Guide in HTML and TeX format
for builder in ('html', 'latex'):
self.builder = builder
self.builder_target_dir = os.path.join(self.build_dir, builder)
self.mkpath(self.builder_target_dir)
BuildDoc.run(self)
sys.path.pop(0)
示例7: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
src_dir = (self.distribution.package_dir or {'': ''})['']
src_dir = os.path.join(os.getcwd(), src_dir)
sphinx.apidoc.main(
['', '-f', '-o', os.path.join(self.source_dir, '_apidoc'),
src_dir])
BuildDoc.run(self)
示例8: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [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))
SphinxBuildDoc.run(self)
sys.path.pop(0)
示例9: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
# in place build
ret = subprocess.call([sys.executable, sys.argv[0], 'build_ext', '-i'])
if ret != 0:
raise RuntimeError("Building atoman failed (%d)" % ret)
# build doc
BuildDoc.run(self)
示例10: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
if self.update_gh_pages:
self._clone_gh_pages()
self._copy_docs_source()
self._generate_api_docs()
BuildDoc.run(self)
if self.update_gh_pages:
self._push_gh_pages()
示例11: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
output_dir = os.path.join(__location__, "docs/_rst")
module_dir = os.path.join(__location__, MAIN_PACKAGE)
cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
cmd_line = cmd_line_template.format(outputdir=output_dir,
moduledir=module_dir)
apidoc.main(cmd_line.split(" "))
BuildDoc.run(self)
示例12: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
build = self.get_finalized_command('build')
sys.path.insert(0, os.path.abspath(build.build_lib))
self.builder_target_dir = 'build/doc/{0}/doc'.format(DISTNAME)
BuildDoc.user_options
try:
BuildDoc.run(self)
except UnicodeDecodeError:
print >>sys.stderr, "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)
示例13: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
self.run_command("api_docs")
# We need to be in the doc directory for to plot_directive
# and API generation to work
os.chdir("doc")
try:
BuildDoc.run(self)
finally:
os.chdir("..")
self.zip_docs()
示例14: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
if self.builder == "doctest":
import sphinx.ext.doctest as doctest
# Capture the DocTestBuilder class in order to return the total
# number of failures when exiting
ref = capture_objs(doctest.DocTestBuilder)
BuildDoc.run(self)
errno = ref[-1].total_failures
sys.exit(errno)
else:
BuildDoc.run(self)
示例15: run
# 需要导入模块: from sphinx.setup_command import BuildDoc [as 别名]
# 或者: from sphinx.setup_command.BuildDoc import run [as 别名]
def run(self):
if not os.getenv('SPHINX_DEBUG'):
self.generate_autoindex()
for builder in ['html', 'man']:
self.builder = builder
self.finalize_options()
self.project = self.distribution.get_name()
self.version = self.distribution.get_version()
self.release = self.distribution.get_version()
BuildDoc.run(self)