pva2pva  1.4.0
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 # Add RTD Theme only if they aren't overriding it already
131 using_rtd_theme = (
132  (
133  'html_theme' in globals() and
134  html_theme in ['default'] and
135  # Allow people to bail with a hack of having an html_style
136  'html_style' not in globals()
137  ) or 'html_theme' not in globals()
138 )
139 if using_rtd_theme:
140  theme = importlib.import_module('sphinx_rtd_theme')
141  html_theme = 'sphinx_rtd_theme'
142  html_style = None
143  html_theme_options = {}
144  if 'html_theme_path' in globals():
145  html_theme_path.append(theme.get_html_theme_path())
146  else:
147  html_theme_path = [theme.get_html_theme_path()]
148 
149 if globals().get('websupport2_base_url', False):
150  websupport2_base_url = 'https://readthedocs.org/websupport'
151  websupport2_static_url = 'https://assets.readthedocs.org/static/'
152 
153 
154 #Add project information to the template context.
155 context = {
156  'using_theme': using_rtd_theme,
157  'html_theme': html_theme,
158  'current_version': "stable",
159  'version_slug': "stable",
160  'MEDIA_URL': "https://media.readthedocs.org/",
161  'STATIC_URL': "https://assets.readthedocs.org/static/",
162  'PRODUCTION_DOMAIN': "readthedocs.org",
163  'proxied_static_path': "/_/static/",
164  'versions': [
165  ("latest", "/en/latest/"),
166  ("stable", "/en/stable/"),
167  ],
168  'downloads': [
169  ("pdf", "//docs.epics-controls.org/_/downloads/pva2pva/en/stable/pdf/"),
170  ("html", "//docs.epics-controls.org/_/downloads/pva2pva/en/stable/htmlzip/"),
171  ("epub", "//docs.epics-controls.org/_/downloads/pva2pva/en/stable/epub/"),
172  ],
173  'subprojects': [
174  ],
175  'slug': 'pva2pva',
176  'name': u'pva2pva',
177  'rtd_language': u'en',
178  'programming_language': u'cpp',
179  'canonical_url': 'https://docs.epics-controls.org/projects/pva2pva/en/latest/',
180  'analytics_code': 'None',
181  'single_version': False,
182  'conf_py_path': '/documentation/',
183  'api_host': 'https://readthedocs.org',
184  'github_user': 'epics-base',
185  'proxied_api_host': '/_',
186  'github_repo': 'pva2pva',
187  'github_version': 'cdee0b36f3b34ce08faeaf71d05d782125ed8e20',
188  'display_github': True,
189  'bitbucket_user': 'None',
190  'bitbucket_repo': 'None',
191  'bitbucket_version': 'cdee0b36f3b34ce08faeaf71d05d782125ed8e20',
192  'display_bitbucket': False,
193  'gitlab_user': 'None',
194  'gitlab_repo': 'None',
195  'gitlab_version': 'cdee0b36f3b34ce08faeaf71d05d782125ed8e20',
196  'display_gitlab': False,
197  'READTHEDOCS': True,
198  'using_theme': (html_theme == "default"),
199  'new_theme': (html_theme == "sphinx_rtd_theme"),
200  'source_suffix': SUFFIX,
201  'ad_free': False,
202  'docsearch_disabled': False,
203  'user_analytics_code': '',
204  'global_analytics_code': 'UA-17997319-1',
205  'commit': 'cdee0b36',
206 }
207 
208 # For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
209 # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
210 if version_info >= (1, 8):
211  if not globals().get('html_baseurl'):
212  html_baseurl = context['canonical_url']
213  context['canonical_url'] = None
214 
215 
216 
217 
218 
219 if 'html_context' in globals():
220 
221  html_context.update(context)
222 
223 else:
224  html_context = context
225 
226 # Add custom RTD extension
227 if 'extensions' in globals():
228  # Insert at the beginning because it can interfere
229  # with other extensions.
230  # See https://github.com/rtfd/readthedocs.org/pull/4054
231  extensions.insert(0, "readthedocs_ext.readthedocs")
232 else:
233  extensions = ["readthedocs_ext.readthedocs"]
234 
235 # Add External version warning banner to the external version documentation
236 if 'tag' == 'external':
237  extensions.insert(1, "readthedocs_ext.external_version_warning")
238  readthedocs_vcs_url = 'None'
239  readthedocs_build_url = 'https://readthedocs.org/projects/pva2pva/builds/18011679/'
240 
241 project_language = 'en'
242 
243 # User's Sphinx configurations
244 language_user = globals().get('language', None)
245 latex_engine_user = globals().get('latex_engine', None)
246 latex_elements_user = globals().get('latex_elements', None)
247 
248 # Remove this once xindy gets installed in Docker image and XINDYOPS
249 # env variable is supported
250 # https://github.com/rtfd/readthedocs-docker-images/pull/98
251 latex_use_xindy = False
252 
253 chinese = any([
254  language_user in ('zh_CN', 'zh_TW'),
255  project_language in ('zh_CN', 'zh_TW'),
256 ])
257 
258 japanese = any([
259  language_user == 'ja',
260  project_language == 'ja',
261 ])
262 
263 if chinese:
264  latex_engine = latex_engine_user or 'xelatex'
265 
266  latex_elements_rtd = {
267  'preamble': '\\usepackage[UTF8]{ctex}\n',
268  }
269  latex_elements = latex_elements_user or latex_elements_rtd
270 elif japanese:
271  latex_engine = latex_engine_user or 'platex'
272 
273 # Make sure our build directory is always excluded
274 exclude_patterns = globals().get('exclude_patterns', [])
275 exclude_patterns.extend(['_build'])