20 from pathlib
import Path
23 DIR = Path(__file__).parent.resolve()
40 "sphinxcontrib.rsvgconverter",
41 "sphinxcontrib.moderncmakedomain",
44 breathe_projects = {
"pybind11":
".build/doxygenxml/"}
45 breathe_default_project =
"pybind11"
46 breathe_domain_by_extension = {
"h":
"cpp"}
49 templates_path = [
".templates"]
54 source_suffix =
".rst"
64 copyright =
"2017, Wenzel Jakob"
65 author =
"Wenzel Jakob"
72 with open(
"../pybind11/_version.py")
as f:
73 code = compile(f.read(),
"../pybind11/_version.py",
"exec")
78 version = loc[
"__version__"]
95 exclude_patterns = [
".build",
"release.rst"]
122 todo_include_todos =
False
130 on_rtd = os.environ.get(
"READTHEDOCS",
None) ==
"True"
133 import sphinx_rtd_theme
135 html_theme =
"sphinx_rtd_theme"
136 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
138 html_context = {
"css_files": [
"_static/theme_overrides.css"]}
142 "//media.readthedocs.org/css/sphinx_rtd_theme.css",
143 "//media.readthedocs.org/css/readthedocs-doc-embed.css",
144 "_static/theme_overrides.css",
175 html_static_path = [
"_static"]
238 htmlhelp_basename =
"pybind11doc"
242 latex_engine =
"pdflatex"
253 "classoptions":
",openany,oneside",
255 \usepackage{fontawesome}
256 \usepackage{textgreek}
257 \DeclareUnicodeCharacter{00A0}{}
258 \DeclareUnicodeCharacter{2194}{\faArrowsH}
259 \DeclareUnicodeCharacter{1F382}{\faBirthdayCake}
260 \DeclareUnicodeCharacter{1F355}{\faAdjust}
261 \DeclareUnicodeCharacter{0301}{'}
262 \DeclareUnicodeCharacter{03C0}{\textpi}
273 (master_doc,
"pybind11.tex",
"pybind11 Documentation",
"Wenzel Jakob",
"manual"),
301 man_pages = [(master_doc,
"pybind11",
"pybind11 Documentation", [author], 1)]
312 texinfo_documents = [
316 "pybind11 Documentation",
319 "One line description of project.",
336 primary_domain =
"cpp"
337 highlight_language =
"cpp"
341 build_dir = os.path.join(app.confdir,
".build")
342 if not os.path.exists(build_dir):
346 subprocess.call([
"doxygen",
"--version"])
347 retcode = subprocess.call([
"doxygen"], cwd=app.confdir)
349 sys.stderr.write(
"doxygen error code: {}\n".format(-retcode))
351 sys.stderr.write(
"doxygen execution failed: {}\n".format(e))
355 with open(DIR.parent /
"README.rst")
as f:
358 if app.builder.name ==
"latex":
360 contents = contents[contents.find(
r".. start") :]
363 contents = re.sub(
r"^(.*)\n[-~]{3,}$",
r"**\1**", contents, flags=re.MULTILINE)
365 with open(DIR /
"readme.rst",
"w")
as f:
370 (DIR /
"readme.rst").unlink()
376 app.connect(
"builder-inited", generate_doxygen_xml)
379 app.connect(
"builder-inited", prepare)
382 app.connect(
"build-finished", clean_up)