EIC 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 
5 from m2r import MdInclude
6 from recommonmark.transform import AutoStructify
7 
8 # check if we are running on readthedocs.org
9 on_readthedocs = os.environ.get("READTHEDOCS", None) == "True"
10 
11 # -- Project information ------------------------------------------------------
12 
13 project = "Acts"
14 author = "The Acts authors"
15 copyright = "2014–2020 CERN for the benefit of the Acts project"
16 # version = '@PROJECT_VERSION@'
17 # release = '@PROJECT_VERSION@'
18 
19 # -- General ------------------------------------------------------------------
20 
21 extensions = [
22  "breathe",
23  "recommonmark",
24  "sphinx.ext.mathjax",
25  "sphinx_markdown_tables",
26 ]
27 source_suffix = {
28  ".rst": "restructuredtext",
29  ".md": "markdown",
30 }
31 master_doc = "index"
32 # ensure the in-source build directory is ignored
33 exclude_patterns = [
34  "_build",
35 ]
36 # cpp as default language
37 primary_domain = "cpp"
38 highlight_language = "cpp"
39 smartquotes = True
40 numfig = True
41 
42 # -- Options for HTML output --------------------------------------------------
43 
44 # ensure we use the RTD them when building locally
45 if not on_readthedocs:
46  import sphinx_rtd_theme
47 
48  html_theme = "sphinx_rtd_theme"
49  html_theme_path = [
50  sphinx_rtd_theme.get_html_theme_path(),
51  ]
52 
53 html_theme_options = {
54  "collapse_navigation": False,
55  "navigation_depth": 2,
56  "prev_next_buttons_location": None, # no prev/next links
57  "style_external_links": True,
58 }
59 html_logo = "figures/acts_logo_white.svg"
60 html_static_path = [
61  "_static",
62 ]
63 html_css_files = [
64  "custom.css",
65 ]
66 html_copy_source = False
67 html_show_sourcelink = False
68 html_show_sphinx = False
69 
70 # -- Doxygen integration with Breathe -----------------------------------------
71 
72 breathe_projects = {
73  "Acts": "_build/doxygen-xml",
74 }
75 breathe_default_project = "Acts"
76 breathe_domain_by_extension = {
77  "cpp": "cpp",
78  "hpp": "cpp",
79  "ipp": "cpp",
80 }
81 breathe_default_members = [
82  "members",
83  "undoc-members",
84 ]
85 
86 # -- Automatic API documentation generation with Exhale -----------------------
87 
88 exhale_args = {
89  "containmentFolder": "api",
90  "rootFileName": "api.rst",
91  "rootFileTitle": "API",
92  "createTreeView": True,
93  "exhaleUseDoxyfile": True,
94  # note: OUTPUT_DIRECTORY in Doxyfile must match breathe default project path
95  # note: this must match STRIP_FROM_PATH in Doxyfile
96  "doxygenStripFromPath": "..",
97 }
98 
99 if on_readthedocs:
100  # if we are running on RTD Doxygen must be run as part of the build
101  # let exhale handle the doxygen execution
102  extensions.append("exhale")
103  exhale_args["exhaleExecutesDoxygen"] = True
104 elif tags.has("use_exhale"):
105  # if exhale is requested manually, we expect the Doxygen has been run for us
106  extensions.append("exhale")
107  exhale_args["exhaleExecutesDoxygen"] = False
108 
109 # -- Markdown bridge setup hook (must come last, not sure why) ----------------
110 
111 
112 def setup(app):
113  app.add_config_value(
114  "recommonmark_config",
115  {
116  "enable_math": True,
117  "enable_inline_math": True,
118  },
119  True,
120  )
121  app.add_transform(AutoStructify)
122 
123  app.add_config_value("no_underscore_emphasis", False, "env")
124  app.add_config_value("m2r_parse_relative_links", False, "env")
125  app.add_config_value("m2r_anonymous_references", False, "env")
126  app.add_config_value("m2r_disable_inline_math", False, "env")
127  app.add_directive("mdinclude", MdInclude)