Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
conf.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file conf.py
1 # Configuration file for the Sphinx documentation builder.
2 
3 import os
4 import sys
5 import subprocess
6 from pathlib import Path
7 import shutil
8 import datetime
9 
10 # check if we are running on readthedocs.org
11 on_readthedocs = os.environ.get("READTHEDOCS", None) == "True"
12 
13 # -- Project information ------------------------------------------------------
14 
15 project = "Acts"
16 author = "The Acts authors"
17 copyright = (
18  f"2014–{datetime.date.today().year} CERN for the benefit of the Acts project"
19 )
20 # version = '@PROJECT_VERSION@'
21 # release = '@PROJECT_VERSION@'
22 
23 # -- General ------------------------------------------------------------------
24 
25 sys.path.insert(0, str(Path(__file__).parent / "_extensions"))
26 
27 extensions = [
28  "breathe",
29  "myst_parser",
30  "sphinx.ext.mathjax",
31  "warnings_filter",
32 ]
33 
34 warnings_filter_config = str(Path(__file__).parent / "known-warnings.txt")
35 warnings_filter_silent = True
36 
37 source_suffix = {
38  ".rst": "restructuredtext",
39  ".md": "markdown",
40 }
41 master_doc = "index"
42 # ensure the in-source build directory is ignored
43 exclude_patterns = ["_build", "api/api_stub.rst", "api/api_index.rst"]
44 # cpp as default language
45 primary_domain = "cpp"
46 highlight_language = "cpp"
47 smartquotes = True
48 numfig = True
49 
50 myst_enable_extensions = ["dollarmath", "colon_fence", "amsmath"]
51 myst_heading_anchors = 3
52 
53 linkcheck_retries = 5
54 linkcheck_ignore = [
55  r"https://doi.org/.*",
56  r"https://cernvm.cern.ch/.*",
57  r"https://tavianator.com/.*",
58  r"http://eigen.tuxfamily.org.*",
59  r"https://pythia.org.*",
60 ]
61 
62 # -- Options for HTML output --------------------------------------------------
63 
64 html_theme = "sphinx_rtd_theme"
65 extensions.append("sphinx_rtd_theme")
66 
67 html_theme_options = {
68  "collapse_navigation": False,
69  "navigation_depth": 4,
70  "prev_next_buttons_location": None, # no prev/next links
71  "style_external_links": True,
72 }
73 html_logo = "figures/acts_logo_white.svg"
74 html_static_path = [
75  "_static",
76 ]
77 html_css_files = [
78  "custom.css",
79 ]
80 html_copy_source = False
81 html_show_sourcelink = False
82 html_show_sphinx = False
83 
84 # -- Doxygen integration with Breathe -----------------------------------------
85 
86 breathe_projects = {
87  "Acts": "_build/doxygen-xml",
88 }
89 breathe_default_project = "Acts"
90 breathe_domain_by_extension = {
91  "cpp": "cpp",
92  "hpp": "cpp",
93  "ipp": "cpp",
94 }
95 breathe_default_members = (
96  "members",
97  "undoc-members",
98 )
99 
100 # -- Automatic API documentation ---------------------------------------------
101 
102 env = os.environ.copy()
103 env["DOXYGEN_WARN_AS_ERROR"] = "NO"
104 cwd = Path(__file__).parent
105 
106 if on_readthedocs or tags.has("run_doxygen"):
107  # if we are running on RTD Doxygen must be run as part of the build
108  print("Executing doxygen in", cwd)
109  print(
110  "Doxygen version:",
111  subprocess.check_output(["doxygen", "--version"], encoding="utf-8"),
112  )
113  sys.stdout.flush()
114  subprocess.check_call(
115  ["doxygen", "Doxyfile"], stdout=subprocess.PIPE, cwd=cwd, env=env
116  )
117 
118 api_index_target = cwd / "api/api.rst"
119 
120 if on_readthedocs or tags.has("run_apidoc"):
121  print("Executing breathe apidoc in", cwd)
122  subprocess.check_call(
123  [sys.executable, "-m", "breathe.apidoc", "_build/doxygen-xml", "-o", "api"],
124  stdout=subprocess.DEVNULL,
125  cwd=cwd,
126  env=env,
127  )
128  if not api_index_target.exists():
129  shutil.copyfile(cwd / "api/api_index.rst", api_index_target)
130  print("breathe apidoc completed")
131 else:
132  if not api_index_target.exists():
133  shutil.copyfile(cwd / "api/api_stub.rst", api_index_target)
134 
135 # -- Markdown bridge setup hook (must come last, not sure why) ----------------
136 
137 
138 def setup(app):
139  pass