14 from __future__
import annotations
20 from pathlib
import Path
22 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
159 html_static_path = [
"_static"]
226 htmlhelp_basename =
"pybind11doc"
230 latex_engine =
"pdflatex"
241 "classoptions":
",openany,oneside",
243 \usepackage{fontawesome}
244 \usepackage{textgreek}
245 \DeclareUnicodeCharacter{00A0}{}
246 \DeclareUnicodeCharacter{2194}{\faArrowsH}
247 \DeclareUnicodeCharacter{1F382}{\faBirthdayCake}
248 \DeclareUnicodeCharacter{1F355}{\faAdjust}
249 \DeclareUnicodeCharacter{0301}{'}
250 \DeclareUnicodeCharacter{03C0}{\textpi}
261 (master_doc,
"pybind11.tex",
"pybind11 Documentation",
"Wenzel Jakob",
"manual"),
289 man_pages = [(master_doc,
"pybind11",
"pybind11 Documentation", [author], 1)]
300 texinfo_documents = [
304 "pybind11 Documentation",
307 "One line description of project.",
324 primary_domain =
"cpp"
325 highlight_language =
"cpp"
329 build_dir = os.path.join(app.confdir,
".build")
330 if not os.path.exists(build_dir):
334 subprocess.call([
"doxygen",
"--version"])
335 retcode = subprocess.call([
"doxygen"], cwd=app.confdir)
337 sys.stderr.write(f
"doxygen error code: {-retcode}\n")
339 sys.stderr.write(f
"doxygen execution failed: {e}\n")
343 with open(DIR.parent /
"README.rst")
as f:
346 if app.builder.name ==
"latex":
348 contents = contents[contents.find(
r".. start") :]
351 contents = re.sub(
r"^(.*)\n[-~]{3,}$",
r"**\1**", contents, flags=re.MULTILINE)
353 with open(DIR /
"readme.rst",
"w")
as f:
358 (DIR /
"readme.rst").unlink()
363 app.connect(
"builder-inited", generate_doxygen_xml)
366 app.connect(
"builder-inited", prepare)
369 app.connect(
"build-finished", clean_up)