20from pathlib
import Path
22DIR = Path(__file__).parent.resolve()
39 "sphinxcontrib.rsvgconverter",
40 "sphinxcontrib.moderncmakedomain",
43breathe_projects = {
"pybind11":
".build/doxygenxml/"}
44breathe_default_project =
"pybind11"
45breathe_domain_by_extension = {
"h":
"cpp"}
48templates_path = [
".templates"]
63copyright =
"2017, Wenzel Jakob"
64author =
"Wenzel Jakob"
71with open(
"../pybind11/_version.py")
as f:
72 code = compile(f.read(),
"../pybind11/_version.py",
"exec")
77version = loc[
"__version__"]
94exclude_patterns = [
".build",
"release.rst"]
121todo_include_todos =
False
129on_rtd = os.environ.get(
"READTHEDOCS",
None) ==
"True"
132 import sphinx_rtd_theme
134 html_theme =
"sphinx_rtd_theme"
135 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
137 html_context = {
"css_files": [
"_static/theme_overrides.css"]}
141 "//media.readthedocs.org/css/sphinx_rtd_theme.css",
142 "//media.readthedocs.org/css/readthedocs-doc-embed.css",
143 "_static/theme_overrides.css",
174html_static_path = [
"_static"]
237htmlhelp_basename =
"pybind11doc"
241latex_engine =
"pdflatex"
252 "classoptions":
",openany,oneside",
254\usepackage{fontawesome}
255\usepackage{textgreek}
256\DeclareUnicodeCharacter{00A0}{}
257\DeclareUnicodeCharacter{2194}{\faArrowsH}
258\DeclareUnicodeCharacter{1F382}{\faBirthdayCake}
259\DeclareUnicodeCharacter{1F355}{\faAdjust}
260\DeclareUnicodeCharacter{0301}{'}
261\DeclareUnicodeCharacter{03C0}{\textpi}
272 (master_doc,
"pybind11.tex",
"pybind11 Documentation",
"Wenzel Jakob",
"manual"),
300man_pages = [(master_doc,
"pybind11",
"pybind11 Documentation", [author], 1)]
315 "pybind11 Documentation",
318 "One line description of project.",
335primary_domain =
"cpp"
336highlight_language =
"cpp"
340 build_dir = os.path.join(app.confdir,
".build")
341 if not os.path.exists(build_dir):
345 subprocess.call([
"doxygen",
"--version"])
346 retcode = subprocess.call([
"doxygen"], cwd=app.confdir)
348 sys.stderr.write(
"doxygen error code: {}\n".format(-retcode))
350 sys.stderr.write(
"doxygen execution failed: {}\n".format(e))
354 with open(DIR.parent /
"README.rst")
as f:
357 if app.builder.name ==
"latex":
359 contents = contents[contents.find(
r".. start") :]
362 contents = re.sub(
r"^(.*)\n[-~]{3,}$",
r"**\1**", contents, flags=re.MULTILINE)
364 with open(DIR /
"readme.rst",
"w")
as f:
369 (DIR /
"readme.rst").unlink()
375 app.connect(
"builder-inited", generate_doxygen_xml)
378 app.connect(
"builder-inited", prepare)
381 app.connect(
"build-finished", clean_up)
def generate_doxygen_xml(app)
def clean_up(app, exception)
void exec(const str &expr, object global=globals(), object local=object())