本文整理汇总了Python中vilya.models.sphinx_docs.SphinxDocs.build_all方法的典型用法代码示例。如果您正苦于以下问题:Python SphinxDocs.build_all方法的具体用法?Python SphinxDocs.build_all怎么用?Python SphinxDocs.build_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.sphinx_docs.SphinxDocs
的用法示例。
在下文中一共展示了SphinxDocs.build_all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_with_index_and_doc_and_two_builders
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc_and_two_builders(self):
prj = self._prj()
base_yaml_conf_two_builders = """
docs:
docs:
builder: html
dir: ""
html_theme: default
html_short_title: testsub
docs2:
dir: ""
builder: pickle
"""
self._add(prj, "code_config.yaml", base_yaml_conf_two_builders)
self._add(prj, "index.rst", base_index_rst)
self._add(prj, "doc1.rst", base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.builders == ["docs", "docs2"]
pickle_builder = sd.get_builder("docs2")
assert pickle_builder.template
doc = pickle_builder.template_data("", {})
assert doc["title"] == "Unit testing sphinx docs"
html_builder = sd.get_builder("docs")
assert not html_builder.template
raw = html_builder.raw_content("index.html", {})
assert "<h1>Unit testing sphinx docs" in raw
示例2: test_html_and_raw_builders_in_different_dirs
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_html_and_raw_builders_in_different_dirs(self):
prj = self._prj()
base_yaml_conf_two_builders = """
docs:
html:
dir: html_docs
builder: html
raw:
builder: raw
dir: pages
"""
self._add(prj, 'code_config.yaml', base_yaml_conf_two_builders)
self._add(prj, 'html_docs/index.rst', base_index_rst)
self._add(prj, 'html_docs/doc1.rst', base_document1_rst)
self._add(prj, 'pages/index.html', self.html1)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.builders == ['html', 'raw']
raw_builder = sd.get_builder('raw')
doc = raw_builder.raw_content('index.html', {})
assert doc == self.html1
html_builder = sd.get_builder('html')
assert not html_builder.template
raw = html_builder.raw_content('index.html', {})
assert "<h1>Unit testing sphinx docs" in raw
示例3: test_two_builders_with_other_config_fmt
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_two_builders_with_other_config_fmt(self):
prj = self._prj()
base_yaml_conf_two_builders = """
docs:
docs:
builder: html
html_theme: default
html_short_title: testsub
dir: html_docs
pages:
builder: raw
"""
self._add(prj, "code_config.yaml", base_yaml_conf_two_builders)
self._add(prj, "html_docs/index.rst", base_index_rst)
self._add(prj, "html_docs/doc1.rst", base_document1_rst)
self._add(prj, "pages/index.html", self.html1)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.builders == ["docs", "pages"] # noqa Sorted alphabetically by default
raw_builder = sd.get_builder("pages")
doc = raw_builder.raw_content("index.html", {})
assert doc == self.html1
html_builder = sd.get_builder("docs")
assert not html_builder.template
raw = html_builder.raw_content("index.html", {})
assert "<h1>Unit testing sphinx docs" in raw
示例4: test_create_with_index_and_doc_and_two_builders
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc_and_two_builders(self):
prj = self._prj()
base_yaml_conf_two_builders = """
docs:
html:
dir: ''
builder: html
pickle:
dir: ''
builder: pickle
"""
self._add(prj, 'code_config.yaml', base_yaml_conf_two_builders)
self._add(prj, 'index.rst', base_index_rst)
self._add(prj, 'doc1.rst', base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.builders == ['html', 'pickle']
pickle_builder = sd.get_builder('pickle')
assert pickle_builder.template
doc = pickle_builder.template_data('', {})
assert doc['title'] == 'Unit testing sphinx docs'
html_builder = sd.get_builder('html')
assert not html_builder.template
raw = html_builder.raw_content('index.html', {})
assert "<h1>Unit testing sphinx docs" in raw
示例5: test_html_and_raw_builders_in_different_dirs
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_html_and_raw_builders_in_different_dirs(self):
prj = self._prj()
base_yaml_conf_two_builders = """
docs:
docs:
builder: html
html_short_title: testsub
dir: html_docs
html_theme: default
pages:
builder: raw
dir: pages
"""
self._add(prj, "code_config.yaml", base_yaml_conf_two_builders)
self._add(prj, "html_docs/index.rst", base_index_rst)
self._add(prj, "html_docs/doc1.rst", base_document1_rst)
self._add(prj, "pages/index.html", self.html1)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.builders == ["docs", "pages"]
raw_builder = sd.get_builder("pages")
doc = raw_builder.raw_content("index.html", {})
assert doc == self.html1
html_builder = sd.get_builder("docs")
assert not html_builder.template
raw = html_builder.raw_content("index.html", {})
assert "<h1>Unit testing sphinx docs" in raw
示例6: test_build_info
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_build_info(self):
prj = self._prj()
self._add(prj, 'docs/index.rst', base_index_rst)
self._add(prj, 'docs/doc1.rst', base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
bi = sd.last_build_info()
assert bi['status'] == 'success'
示例7: test_pages_no_docsdir
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_pages_no_docsdir(self):
prj = self._prj()
self._add(prj, "code_config.yaml", self.conf)
self._add(prj, "pagesNOT_THE_SAME/index.html", self.html1)
sd = SphinxDocs(prj.name)
sd.build_all()
assert sd.last_build_info()["status"] == "no_doc_dir_found"
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content("index.html", {}) is False
示例8: test_create_with_index_and_doc
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc(self):
prj = self._prj()
self._add(prj, 'docs/index.rst', base_index_rst)
self._add(prj, 'docs/doc1.rst', base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
builder = sd.get_builder()
doc = builder.template_data('', {})
assert doc['title'] == 'Unit testing sphinx docs'
示例9: test_build_info
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_build_info(self):
prj = self._prj()
self._add(prj, "code_config.yaml", base_yaml_conf)
self._add(prj, "index.rst", base_index_rst)
self._add(prj, "doc1.rst", base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
bi = sd.last_build_info()
assert bi["status"] == "success"
示例10: test_create_with_index_and_doc
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc(self):
prj = self._prj()
self._add(prj, "code_config.yaml", base_yaml_conf)
self._add(prj, "index.rst", base_index_rst)
self._add(prj, "doc1.rst", base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
builder = sd.get_builder("docs")
doc = builder.template_data("", {})
assert doc["title"] == "Unit testing sphinx docs"
示例11: test_use_autodoc_not_configured
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_use_autodoc_not_configured(self):
prj = self._prj()
self._add(prj, 'docs/conf.py', self.conf_py)
self._add(prj, 'docs/index.rst', self.index_rst)
self._add(prj, 'testapi.py', self.api_py)
sd = SphinxDocs(prj.name)
sd.build_all()
builder = sd.get_builder()
doc = builder.template_data('', {})
assert "Test C docstring" not in doc['body']
示例12: test_pages_mode
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_pages_mode(self):
prj = self._prj()
self._add(prj, "code_config.yaml", self.conf)
self._add(prj, "pages/index.html", self.html1)
sd = SphinxDocs(prj.name)
assert sd.builders == ["pages"]
assert sd.last_build_info() is None
sd.build_all()
assert sd.last_build_info()["status"] == "success"
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content("index.html", {}) == self.html1
示例13: test_create_with_index_and_doc_and_conf_py
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc_and_conf_py(self):
conf_content = """rst_epilog = 'Ahhhhhhhhhhhhhhhh la fin' """
prj = self._prj()
self._add(prj, 'docs/index.rst', base_index_rst)
self._add(prj, 'docs/doc1.rst', base_document1_rst)
self._add(prj, 'docs/conf.py', conf_content)
sd = SphinxDocs(prj.name)
sd.build_all()
builder = sd.get_builder()
doc = builder.template_data('', {})
assert 'Ahhhhhhhhhhhhhhhh' in doc['body']
示例14: test_pages_mode
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_pages_mode(self):
prj = self._prj()
self._add(prj, 'code_config.yaml', self.conf)
self._add(prj, 'pages/index.html', self.html1)
sd = SphinxDocs(prj.name)
assert sd.builders == [self.builder]
assert sd.last_build_info() is None
sd.build_all()
assert sd.last_build_info()['status'] == 'success'
builder = sd.get_builder(sd.builders[0])
assert builder.raw_content('index.html', {}) == self.html1
示例15: test_create_with_index_and_doc_and_get_again
# 需要导入模块: from vilya.models.sphinx_docs import SphinxDocs [as 别名]
# 或者: from vilya.models.sphinx_docs.SphinxDocs import build_all [as 别名]
def test_create_with_index_and_doc_and_get_again(self):
prj = self._prj()
self._add(prj, 'code_config.yaml', base_yaml_conf)
self._add(prj, 'index.rst', base_index_rst)
self._add(prj, 'doc1.rst', base_document1_rst)
sd = SphinxDocs(prj.name)
sd.build_all()
sd2 = SphinxDocs(prj.name)
builder = sd2.get_builder()
assert builder.template
doc = builder.template_data('', {})
assert doc['title'] == 'Unit testing sphinx docs'