pva2pva  1.4.1-dev
conf.py
1 # Configuration file for the Sphinx documentation builder.
2 #
3 # This file only contains a selection of the most common options. For a full
4 # list see the documentation:
5 # http://www.sphinx-doc.org/en/master/config
6 
7 # -- Path setup --------------------------------------------------------------
8 
9 # If extensions (or modules to document with autodoc) are in another directory,
10 # add these directories to sys.path here. If the directory is relative to the
11 # documentation root, use os.path.abspath to make it absolute, like shown here.
12 #
13 # import os
14 # import sys
15 # sys.path.insert(0, os.path.abspath('.'))
16 
17 
18 # -- Project information -----------------------------------------------------
19 
20 project = 'EPICS Documentation'
21 copyright = '2019, EPICS Controls.'
22 author = 'EPICS'
23 
24 
25 # -- General configuration ---------------------------------------------------
26 
27 # Add any Sphinx extension module names here, as strings. They can be
28 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29 # ones.
30 extensions = [
31  'sphinx.ext.intersphinx',
32 ]
33 
34 # Add any paths that contain templates here, relative to this directory.
35 templates_path = ['_templates']
36 
37 # List of patterns, relative to source directory, that match files and
38 # directories to ignore when looking for source files.
39 # This pattern also affects html_static_path and html_extra_path.
40 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
41 
42 # Intersphinx links to subprojects
43 intersphinx_mapping = {
44  'how-tos': ('https://docs.epics-controls.org/projects/how-tos/en/latest', None),
45 }
46 
47 
48 # -- Options for HTML output -------------------------------------------------
49 
50 # The theme to use for HTML and HTML Help pages. See the documentation for
51 # a list of builtin themes.
52 #
53 html_theme = 'sphinx_rtd_theme'
54 
55 
56 # Add any paths that contain custom static files (such as style sheets) here,
57 # relative to this directory. They are copied after the builtin static files,
58 # so a file named "default.css" will overwrite the builtin "default.css".
59 html_static_path = ['_static']
60 
61 html_css_files = [
62  'css/custom.css',
63 ]
64 
65 master_doc = 'index'
66 
67 html_theme_options = {
68  'logo_only': True,
69 }
70 html_logo = "images/EPICS_white_logo_v02.png"
71 
72 html_extra_path = ['../html']
73 
74 
75 # -- Run Doxygen ------------------------------------------------------------
76 
77 import subprocess
78 subprocess.call('cd ..; mkdir -p html/doxygen; doxygen', shell=True)
79 
80 
81 
82 
83 
86 
87 
88 #
89 # The following code was added during an automated build on readthedocs.org
90 # It is auto created and injected for every build. The result is based on the
91 # conf.py.tmpl file found in the readthedocs.org codebase:
92 # https://github.com/rtfd/readthedocs.org/blob/main/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
93 #
94 # Note: this file shouldn't rely on extra dependencies.
95 
96 import importlib
97 import sys
98 import os.path
99 
100 # Borrowed from six.
101 PY3 = sys.version_info[0] == 3
102 string_types = str if PY3 else basestring
103 
104 from sphinx import version_info
105 
106 # Get suffix for proper linking to GitHub
107 # This is deprecated in Sphinx 1.3+,
108 # as each page can have its own suffix
109 if globals().get('source_suffix', False):
110  if isinstance(source_suffix, string_types):
111  SUFFIX = source_suffix
112  elif isinstance(source_suffix, (list, tuple)):
113  # Sphinx >= 1.3 supports list/tuple to define multiple suffixes
114  SUFFIX = source_suffix[0]
115  elif isinstance(source_suffix, dict):
116  # Sphinx >= 1.8 supports a mapping dictionary for multiple suffixes
117  SUFFIX = list(source_suffix.keys())[0] # make a ``list()`` for py2/py3 compatibility
118  else:
119  # default to .rst
120  SUFFIX = '.rst'
121 else:
122  SUFFIX = '.rst'
123 
124 # Add RTD Static Path. Add to the end because it overwrites previous files.
125 if not 'html_static_path' in globals():
126  html_static_path = []
127 if os.path.exists('_static'):
128  html_static_path.append('_static')
129 
130 # Define this variable in case it's not defined by the user.
131 # It defaults to `alabaster` which is the default from Sphinx.
132 # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_theme
133 html_theme = globals().get('html_theme', 'alabaster')
134 
135 #Add project information to the template context.
136 context = {
137  'html_theme': html_theme,
138  'current_version': "latest",
139  'version_slug': "latest",
140  'MEDIA_URL': "https://media.readthedocs.org/",
141  'STATIC_URL': "https://assets.readthedocs.org/static/",
142  'PRODUCTION_DOMAIN': "readthedocs.org",
143  'proxied_static_path': "/_/static/",
144  'versions': [
145  ("latest", "/en/latest/"),
146  ("3.15", "/en/3.15/"),
147  ("r7.0.4.1", "/en/r7.0.4.1/"),
148  ("r7.0.4", "/en/r7.0.4/"),
149  ("r7.0.3.1", "/en/r7.0.3.1/"),
150  ("r7.0.3", "/en/r7.0.3/"),
151  ("r7.0.2.1", "/en/r7.0.2.1/"),
152  ("r7.0.2", "/en/r7.0.2/"),
153  ("r7.0.1.1", "/en/r7.0.1.1/"),
154  ("r7.0.1", "/en/r7.0.1/"),
155  ],
156  'downloads': [
157  ("pdf", "//docs.epics-controls.org/_/downloads/base/en/latest/pdf/"),
158  ("html", "//docs.epics-controls.org/_/downloads/base/en/latest/htmlzip/"),
159  ("epub", "//docs.epics-controls.org/_/downloads/base/en/latest/epub/"),
160  ],
161  'subprojects': [
162  ],
163  'slug': 'epics-base',
164  'name': u'epics-base',
165  'rtd_language': u'en',
166  'programming_language': u'c',
167  'canonical_url': '',
168  'analytics_code': 'None',
169  'single_version': False,
170  'conf_py_path': '/modules/pva2pva/documentation/',
171  'api_host': 'https://readthedocs.org',
172  'github_user': 'epics-base',
173  'proxied_api_host': '/_',
174  'github_repo': 'epics-base',
175  'github_version': '7.0',
176  'display_github': True,
177  'bitbucket_user': 'None',
178  'bitbucket_repo': 'None',
179  'bitbucket_version': '7.0',
180  'display_bitbucket': False,
181  'gitlab_user': 'None',
182  'gitlab_repo': 'None',
183  'gitlab_version': '7.0',
184  'display_gitlab': False,
185  'READTHEDOCS': True,
186  'using_theme': (html_theme == "default"),
187  'new_theme': (html_theme == "sphinx_rtd_theme"),
188  'source_suffix': SUFFIX,
189  'ad_free': False,
190  'docsearch_disabled': False,
191  'user_analytics_code': '',
192  'global_analytics_code': 'UA-17997319-1',
193  'commit': '88ea1507',
194 }
195 
196 # For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
197 # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
198 if version_info >= (1, 8):
199  if not globals().get('html_baseurl'):
200  html_baseurl = context['canonical_url']
201  context['canonical_url'] = None
202 
203 
204 
205 
206 
207 if 'html_context' in globals():
208  for key in context:
209  if key not in html_context:
210  html_context[key] = context[key]
211 else:
212  html_context = context
213 
214 # Add custom RTD extension
215 if 'extensions' in globals():
216  # Insert at the beginning because it can interfere
217  # with other extensions.
218  # See https://github.com/rtfd/readthedocs.org/pull/4054
219  extensions.insert(0, "readthedocs_ext.readthedocs")
220 else:
221  extensions = ["readthedocs_ext.readthedocs"]
222 
223 # Add External version warning banner to the external version documentation
224 if 'branch' == 'external':
225  extensions.insert(1, "readthedocs_ext.external_version_warning")
226  readthedocs_vcs_url = 'None'
227  readthedocs_build_url = 'https://readthedocs.org/projects/epics-base/builds/22012338/'
228 
229 project_language = 'en'
230 
231 # User's Sphinx configurations
232 language_user = globals().get('language', None)
233 latex_engine_user = globals().get('latex_engine', None)
234 latex_elements_user = globals().get('latex_elements', None)
235 
236 # Remove this once xindy gets installed in Docker image and XINDYOPS
237 # env variable is supported
238 # https://github.com/rtfd/readthedocs-docker-images/pull/98
239 latex_use_xindy = False
240 
241 chinese = any([
242  language_user in ('zh_CN', 'zh_TW'),
243  project_language in ('zh_CN', 'zh_TW'),
244 ])
245 
246 japanese = any([
247  language_user == 'ja',
248  project_language == 'ja',
249 ])
250 
251 if chinese:
252  latex_engine = latex_engine_user or 'xelatex'
253 
254  latex_elements_rtd = {
255  'preamble': '\\usepackage[UTF8]{ctex}\n',
256  }
257  latex_elements = latex_elements_user or latex_elements_rtd
258 elif japanese:
259  latex_engine = latex_engine_user or 'platex'
260 
261 # Make sure our build directory is always excluded
262 exclude_patterns = globals().get('exclude_patterns', [])
263 exclude_patterns.extend(['_build'])