TAS
TCP Acceleration as an OS Service
conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # Configuration file for the Sphinx documentation builder.
4 #
5 # This file does only contain a selection of the most common options. For a
6 # full list see the documentation:
7 # http://www.sphinx-doc.org/en/master/config
8 
9 
10 # -- Path setup --------------------------------------------------------------
11 
12 # If extensions (or modules to document with autodoc) are in another directory,
13 # add these directories to sys.path here. If the directory is relative to the
14 # documentation root, use os.path.abspath to make it absolute, like shown here.
15 #
16 # import os
17 # import sys
18 # sys.path.insert(0, os.path.abspath('.'))
19 
20 
21 # -- Project information -----------------------------------------------------
22 
23 project = 'TAS'
24 copyright = '2020, University of Washington, ' + \
25  'Max Planck Institute for Software Systems, ' + \
26  'and The University of Texas at Austin'
27 
28 author = 'Antoine Kaufmann'
29 
30 # The short X.Y version
31 version = ''
32 # The full version, including alpha/beta/rc tags
33 release = ''
34 
35 
36 # -- General configuration ---------------------------------------------------
37 
38 # If your documentation needs a minimal Sphinx version, state it here.
39 #
40 # needs_sphinx = '1.0'
41 
42 # Add any Sphinx extension module names here, as strings. They can be
43 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
44 # ones.
45 extensions = [
46  'breathe',
47 ]
48 
49 # Add any paths that contain templates here, relative to this directory.
50 templates_path = ['_templates']
51 
52 # The suffix(es) of source filenames.
53 # You can specify multiple suffix as a list of string:
54 #
55 # source_suffix = ['.rst', '.md']
56 source_suffix = '.rst'
57 
58 # The master toctree document.
59 master_doc = 'index'
60 
61 # The language for content autogenerated by Sphinx. Refer to documentation
62 # for a list of supported languages.
63 #
64 # This is also used if you do content translation via gettext catalogs.
65 # Usually you set "language" from the command line for these cases.
66 language = None
67 
68 # List of patterns, relative to source directory, that match files and
69 # directories to ignore when looking for source files.
70 # This pattern also affects html_static_path and html_extra_path.
71 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
72 
73 # The name of the Pygments (syntax highlighting) style to use.
74 pygments_style = None
75 
76 
77 # -- Options for HTML output -------------------------------------------------
78 
79 # The theme to use for HTML and HTML Help pages. See the documentation for
80 # a list of builtin themes.
81 #
82 html_theme = 'sphinx_rtd_theme'
83 
84 # Theme options are theme-specific and customize the look and feel of a theme
85 # further. For a list of options available for each theme, see the
86 # documentation.
87 #
88 # html_theme_options = {}
89 
90 # Add any paths that contain custom static files (such as style sheets) here,
91 # relative to this directory. They are copied after the builtin static files,
92 # so a file named "default.css" will overwrite the builtin "default.css".
93 html_static_path = ['_static']
94 
95 # Custom sidebar templates, must be a dictionary that maps document names
96 # to template names.
97 #
98 # The default sidebars (for documents that don't match any pattern) are
99 # defined by theme itself. Builtin themes are using these templates by
100 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
101 # 'searchbox.html']``.
102 #
103 # html_sidebars = {}
104 
105 
106 # -- Options for HTMLHelp output ---------------------------------------------
107 
108 # Output file base name for HTML help builder.
109 htmlhelp_basename = 'TASdoc'
110 
111 
112 # -- Options for LaTeX output ------------------------------------------------
113 
114 latex_elements = {
115  # The paper size ('letterpaper' or 'a4paper').
116  #
117  # 'papersize': 'letterpaper',
118 
119  # The font size ('10pt', '11pt' or '12pt').
120  #
121  # 'pointsize': '10pt',
122 
123  # Additional stuff for the LaTeX preamble.
124  #
125  # 'preamble': '',
126 
127  # Latex figure (float) alignment
128  #
129  # 'figure_align': 'htbp',
130 }
131 
132 # Grouping the document tree into LaTeX files. List of tuples
133 # (source start file, target name, title,
134 # author, documentclass [howto, manual, or own class]).
135 latex_documents = [
136  (master_doc, 'TAS.tex', 'TAS Documentation',
137  'Antoine Kaufmann', 'manual'),
138 ]
139 
140 
141 # -- Options for manual page output ------------------------------------------
142 
143 # One entry per manual page. List of tuples
144 # (source start file, name, description, authors, manual section).
145 man_pages = [
146  (master_doc, 'tas', 'TAS Documentation',
147  [author], 1)
148 ]
149 
150 
151 # -- Options for Texinfo output ----------------------------------------------
152 
153 # Grouping the document tree into Texinfo files. List of tuples
154 # (source start file, target name, title, author,
155 # dir menu entry, description, category)
156 texinfo_documents = [
157  (master_doc, 'TAS', 'TAS Documentation',
158  author, 'TAS', 'One line description of project.',
159  'Miscellaneous'),
160 ]
161 
162 
163 # -- Options for Epub output -------------------------------------------------
164 
165 # Bibliographic Dublin Core info.
166 epub_title = project
167 
168 # The unique identifier of the text. This can be a ISBN number
169 # or the project homepage.
170 #
171 # epub_identifier = ''
172 
173 # A unique identification for the text.
174 #
175 # epub_uid = ''
176 
177 # A list of files that should not be packed into the epub file.
178 epub_exclude_files = ['search.html']
179 
180 breathe_projects = { 'TAS': 'xml/' }
181 breathe_default_project = 'TAS'
182 
183 
184 
186 import subprocess, os
187 
188 # Check if we're running on Read the Docs' servers
189 read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
190 
191 if read_the_docs_build:
192  subprocess.call('cd .. && doxygen doc/Doxyfile', shell=True)
193  subprocess.call('cp -r html _static/doxygen', shell=True)
194 
195 
196 
197 
198 
201 
202 
203 #
204 # The following code was added during an automated build on readthedocs.org
205 # It is auto created and injected for every build. The result is based on the
206 # conf.py.tmpl file found in the readthedocs.org codebase:
207 # https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
208 #
209 
210 
211 import importlib
212 import sys
213 import os.path
214 from six import string_types
215 
216 from sphinx import version_info
217 
218 # Get suffix for proper linking to GitHub
219 # This is deprecated in Sphinx 1.3+,
220 # as each page can have its own suffix
221 if globals().get('source_suffix', False):
222  if isinstance(source_suffix, string_types):
223  SUFFIX = source_suffix
224  elif isinstance(source_suffix, (list, tuple)):
225  # Sphinx >= 1.3 supports list/tuple to define multiple suffixes
226  SUFFIX = source_suffix[0]
227  elif isinstance(source_suffix, dict):
228  # Sphinx >= 1.8 supports a mapping dictionary for multiple suffixes
229  SUFFIX = list(source_suffix.keys())[0] # make a ``list()`` for py2/py3 compatibility
230  else:
231  # default to .rst
232  SUFFIX = '.rst'
233 else:
234  SUFFIX = '.rst'
235 
236 # Add RTD Static Path. Add to the end because it overwrites previous files.
237 if not 'html_static_path' in globals():
238  html_static_path = []
239 if os.path.exists('_static'):
240  html_static_path.append('_static')
241 
242 # Add RTD Theme only if they aren't overriding it already
243 using_rtd_theme = (
244  (
245  'html_theme' in globals() and
246  html_theme in ['default'] and
247  # Allow people to bail with a hack of having an html_style
248  'html_style' not in globals()
249  ) or 'html_theme' not in globals()
250 )
251 if using_rtd_theme:
252  theme = importlib.import_module('sphinx_rtd_theme')
253  html_theme = 'sphinx_rtd_theme'
254  html_style = None
255  html_theme_options = {}
256  if 'html_theme_path' in globals():
257  html_theme_path.append(theme.get_html_theme_path())
258  else:
259  html_theme_path = [theme.get_html_theme_path()]
260 
261 if globals().get('websupport2_base_url', False):
262  websupport2_base_url = 'https://readthedocs.org/websupport'
263  websupport2_static_url = 'https://assets.readthedocs.org/static/'
264 
265 
266 #Add project information to the template context.
267 context = {
268  'using_theme': using_rtd_theme,
269  'html_theme': html_theme,
270  'current_version': "latest",
271  'version_slug': "latest",
272  'MEDIA_URL': "https://media.readthedocs.org/",
273  'STATIC_URL': "https://assets.readthedocs.org/static/",
274  'PRODUCTION_DOMAIN': "readthedocs.org",
275  'versions': [
276  ("latest", "/en/latest/"),
277  ],
278  'downloads': [
279  ("pdf", "//tas.readthedocs.io/_/downloads/en/latest/pdf/"),
280  ("html", "//tas.readthedocs.io/_/downloads/en/latest/htmlzip/"),
281  ("epub", "//tas.readthedocs.io/_/downloads/en/latest/epub/"),
282  ],
283  'subprojects': [
284  ],
285  'slug': 'tas',
286  'name': u'tas',
287  'rtd_language': u'en',
288  'programming_language': u'c',
289  'canonical_url': 'https://tas.readthedocs.io/en/latest/',
290  'analytics_code': 'None',
291  'single_version': False,
292  'conf_py_path': '/doc/',
293  'api_host': 'https://readthedocs.org',
294  'github_user': 'tcp-acceleration-service',
295  'proxied_api_host': '/_',
296  'github_repo': 'tas',
297  'github_version': 'master',
298  'display_github': True,
299  'bitbucket_user': 'None',
300  'bitbucket_repo': 'None',
301  'bitbucket_version': 'master',
302  'display_bitbucket': False,
303  'gitlab_user': 'None',
304  'gitlab_repo': 'None',
305  'gitlab_version': 'master',
306  'display_gitlab': False,
307  'READTHEDOCS': True,
308  'using_theme': (html_theme == "default"),
309  'new_theme': (html_theme == "sphinx_rtd_theme"),
310  'source_suffix': SUFFIX,
311  'ad_free': False,
312  'docsearch_disabled': False,
313  'user_analytics_code': '',
314  'global_analytics_code': 'UA-17997319-1',
315  'commit': 'd3926baf',
316 }
317 
318 
319 
320 
321 if 'html_context' in globals():
322 
323  html_context.update(context)
324 
325 else:
326  html_context = context
327 
328 # Add custom RTD extension
329 if 'extensions' in globals():
330  # Insert at the beginning because it can interfere
331  # with other extensions.
332  # See https://github.com/rtfd/readthedocs.org/pull/4054
333  extensions.insert(0, "readthedocs_ext.readthedocs")
334 else:
335  extensions = ["readthedocs_ext.readthedocs"]
336 
337 # Add External version warning banner to the external version documentation
338 if 'branch' == 'external':
339  extensions.insert(1, "readthedocs_ext.external_version_warning")
340 
341 project_language = 'en'
342 
343 # User's Sphinx configurations
344 language_user = globals().get('language', None)
345 latex_engine_user = globals().get('latex_engine', None)
346 latex_elements_user = globals().get('latex_elements', None)
347 
348 # Remove this once xindy gets installed in Docker image and XINDYOPS
349 # env variable is supported
350 # https://github.com/rtfd/readthedocs-docker-images/pull/98
351 latex_use_xindy = False
352 
353 chinese = any([
354  language_user in ('zh_CN', 'zh_TW'),
355  project_language in ('zh_CN', 'zh_TW'),
356 ])
357 
358 japanese = any([
359  language_user == 'ja',
360  project_language == 'ja',
361 ])
362 
363 if chinese:
364  latex_engine = latex_engine_user or 'xelatex'
365 
366  latex_elements_rtd = {
367  'preamble': '\\usepackage[UTF8]{ctex}\n',
368  }
369  latex_elements = latex_elements_user or latex_elements_rtd
370 elif japanese:
371  latex_engine = latex_engine_user or 'platex'
372 
373 # Make sure our build directory is always excluded
374 exclude_patterns = globals().get('exclude_patterns', [])
375 exclude_patterns.extend(['_build'])