xref: /oneTBB/doc/conf.py (revision 229b63ee)
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# -- Path setup --------------------------------------------------------------
10
11# If extensions (or modules to document with autodoc) are in another directory,
12# add these directories to sys.path here. If the directory is relative to the
13# documentation root, use os.path.abspath to make it absolute, like shown here.
14#
15import os
16# import sys
17# sys.path.insert(0, os.path.abspath('.'))
18
19SOURCE_DIR = os.path.dirname(__file__)
20LATEX_DIR = os.path.join(SOURCE_DIR, '_latex')
21PREAMBLE_FILE = os.path.join(LATEX_DIR, 'preamble.tex')
22TITLE_PAGE_FILE = os.path.join(LATEX_DIR, 'title_page.tex')
23
24BUILD_TYPE = os.getenv("BUILD_TYPE")
25
26# -- Project information -----------------------------------------------------
27
28if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
29    project = u'Intel® oneAPI Threading Building Blocks (oneTBB)'
30else:
31    project = u'oneTBB'
32copyright = u'2023, Intel Corporation'
33author = u'Intel'
34
35# The short X.Y version
36version = u''
37# The full version, including alpha/beta/rc tags
38release = u''
39
40
41# -- General configuration ---------------------------------------------------
42
43# If your documentation needs a minimal Sphinx version, state it here.
44#
45# needs_sphinx = '1.0'
46
47# Add any Sphinx extension module names here, as strings. They can be
48# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
49# ones.
50extensions = [
51    'sphinx.ext.autodoc',
52    'sphinx.ext.doctest',
53    'sphinx.ext.intersphinx',
54    'sphinx.ext.todo',
55    'sphinx.ext.coverage',
56    'sphinx.ext.imgmath',
57    'sphinx.ext.ifconfig',
58    'sphinx.ext.viewcode',
59    'sphinx.ext.githubpages',
60    'sphinx_tabs.tabs'
61]
62
63# Add any paths that contain templates here, relative to this directory.
64templates_path = ['main/_templates']
65
66# The suffix(es) of source filenames.
67# You can specify multiple suffix as a list of string:
68#
69# source_suffix = ['.rst', '.md']
70source_suffix = '.rst'
71
72# The master toctree document.
73#master_doc = 'main/title_main'
74master_doc = 'index'
75
76# The language for content autogenerated by Sphinx. Refer to documentation
77# for a list of supported languages.
78#
79# This is also used if you do content translation via gettext catalogs.
80# Usually you set "language" from the command line for these cases.
81language = 'en'
82
83# List of patterns, relative to source directory, that match files and
84# directories to ignore when looking for source files.
85# This pattern also affects html_static_path and html_extra_path.
86exclude_patterns = []
87
88# The name of the Pygments (syntax highlighting) style to use.
89pygments_style = None
90
91# Syntax highlighting for the :: directive
92highlight_language = 'cpp'
93
94if BUILD_TYPE == 'oneapi' or BUILD_TYPE == 'dita':
95    rst_prolog = """
96.. |full_name| replace:: Intel\ |reg|\  oneAPI Threading Building Blocks (oneTBB)
97.. |short_name| replace:: oneTBB
98.. |product| replace:: oneTBB
99.. |reg| unicode:: U+000AE
100.. |copy| unicode:: U+000A9
101.. |base_tk| replace:: Intel\ |reg|\  oneAPI Base Toolkit
102.. |dpcpp| replace:: Intel\ |reg|\  oneAPI DPC++/C++ Compiler
103    """
104else:
105    rst_prolog = """
106.. |full_name| replace:: oneAPI Threading Building Blocks (oneTBB)
107.. |short_name| replace:: oneTBB
108.. |product| replace:: oneTBB
109.. |reg| unicode:: U+000AE
110.. |copy| unicode:: U+000A9
111.. |base_tk| replace:: Intel\ |reg|\  oneAPI Base Toolkit
112.. |dpcpp| replace:: Intel\ |reg|\  oneAPI DPC++/C++ Compiler
113    """
114
115# -- Options for HTML output -------------------------------------------------
116
117# The theme to use for HTML and HTML Help pages.  See the documentation for
118# a list of builtin themes.
119#
120# Theme options are theme-specific and customize the look and feel of a theme
121# further.  For a list of options available for each theme, see the
122# documentation.
123#
124
125html_theme = 'sphinx_book_theme'
126
127if BUILD_TYPE == 'dita':
128    html_theme_options = {
129        'repository_url': 'https://github.com/oneapi-src/oneTBB',
130        'path_to_docs': 'doc',
131        'repository_branch': 'master'
132    }
133else:
134    html_theme_options = {
135        'repository_url': 'https://github.com/oneapi-src/oneTBB',
136        'path_to_docs': 'doc',
137        'use_issues_button': True,
138        'use_edit_page_button': True,
139        'repository_branch': 'master',
140        'extra_footer': '<p align="right"><a href="https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html">Cookies</a></p>'
141    }
142
143
144# Add any paths that contain custom static files (such as style sheets) here,
145# relative to this directory. They are copied after the builtin static files,
146# so a file named "default.css" will overwrite the builtin "default.css".
147html_static_path = ['_static']
148
149if BUILD_TYPE == 'oneapi'  or BUILD_TYPE == 'dita':
150    html_context = {
151        'css_files': [
152            '_static/theme_overrides.css',  # override wide tables in RTD theme
153        ],
154    }
155else:
156    html_js_files = ['custom.js']
157
158html_theme_options = {
159    "logo": {
160        "text": "oneTBB Documentation",
161    }
162}
163
164html_logo = '_static/oneAPI-rgb-rev-100.png'
165html_favicon = '_static/favicons.png'
166
167
168# Custom sidebar templates, must be a dictionary that maps document names
169# to template names.
170#
171# The default sidebars (for documents that don't match any pattern) are
172# defined by theme itself.  Builtin themes are using these templates by
173# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
174# 'searchbox.html']``.
175#
176# html_sidebars = {}
177
178
179# -- Options for HTMLHelp output ---------------------------------------------
180
181# Output file base name for HTML help builder.
182htmlhelp_basename = 'sphinx-infodevdoc'
183
184
185# -- Options for LaTeX output ------------------------------------------------
186
187#latex_engine = 'xelatex'
188#PDF_TITLE = 'Information Development Template'
189#
190#with open(PREAMBLE_FILE, 'r', encoding='utf-8') as f:
191#    PREAMBLE = f.read()
192#
193#with open(TITLE_PAGE_FILE, 'r', encoding='utf-8') as f:
194#    TITLE_PAGE = f.read().replace('<PDF_TITLE>', PDF_TITLE)
195#
196#
197#latex_elements = {
198#    # The paper size ('letterpaper' or 'a4paper').
199#    #
200#    'extraclassoptions': 'openany,oneside',
201#    'babel' : '\\usepackage[english]{babel}',
202#    'papersize': 'a4paper',
203#    'releasename':" ",
204#    # Sonny, Lenny, Glenn, Conny, Rejne, Bjarne and Bjornstrup
205#    # 'fncychap': '\\usepackage[Lenny]{fncychap}',
206#    'fncychap':  '',
207#    #'fontpkg': '\\usepackage{amsmath,amsfonts,amssymb,amsthm}',
208#
209#    'figure_align':'htbp',
210#    # The font size ('10pt', '11pt' or '12pt').
211#    #
212#    'pointsize': '12pt',
213#
214#    # Additional stuff for the LaTeX preamble.
215#    #
216#    'preamble': PREAMBLE,
217#
218#    'maketitle': TITLE_PAGE,
219#    # Latex figure (float) alignment
220#    #
221#    # 'figure_align': 'htbp',
222#    'sphinxsetup': \
223#        'hmargin={0.7in,0.7in}, vmargin={1in,1in}, \
224#        verbatimwithframe=true, \
225#        TitleColor={rgb}{0,0.686,0.941}, \
226#        HeaderFamily=\\rmfamily\\bfseries, \
227#        InnerLinkColor={rgb}{0,0.686,0.941}, \
228#        OuterLinkColor={rgb}{0,0.686,0.941}',
229#
230#    'tableofcontents':' '
231#}
232#
233#latex_logo = '_latex/intel_logo.png'
234## Grouping the document tree into LaTeX files. List of tuples
235## (source start file, target name, title,
236##  author, documentclass [howto, manual, or own class]).
237#latex_documents = [
238#    (master_doc, 'sphinx-infodev.tex', u'sphinx-infodev Documentation',
239#     u'Intel', 'manual'),
240#]
241
242#breathe_projects = {                                       #todd-mod
243#    project: "../doxygen/xml"
244#}
245#breathe_default_project = project
246
247# Setup the exhale extension
248#exhale_args = {                                            #todd-mod
249#    # These arguments are required
250#    "containmentFolder":     "./api",
251#    "rootFileName":          "library_root.rst",
252#    "rootFileTitle":         "Library API",
253#    "doxygenStripFromPath":  "..",
254#    "fullApiSubSectionTitle": 'Full API'
255#}
256
257
258# -- Options for manual page output ------------------------------------------
259
260# One entry per manual page. List of tuples
261# (source start file, name, description, authors, manual section).
262man_pages = [
263    (master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
264     [author], 1)
265]
266
267
268# -- Options for Texinfo output ----------------------------------------------
269
270# Grouping the document tree into Texinfo files. List of tuples
271# (source start file, target name, title, author,
272#  dir menu entry, description, category)
273texinfo_documents = [
274    (master_doc, 'sphinx-infodev', u'sphinx-infodev Documentation',
275     author, 'sphinx-infodev', 'One line description of project.',
276     'Miscellaneous'),
277]
278
279
280# -- Options for Epub output -------------------------------------------------
281
282# Bibliographic Dublin Core info.
283epub_title = project
284
285# The unique identifier of the text. This can be a ISBN number
286# or the project homepage.
287#
288# epub_identifier = ''
289
290# A unique identification for the text.
291#
292# epub_uid = ''
293
294# A list of files that should not be packed into the epub file.
295epub_exclude_files = ['search.html']
296
297
298# -- Extension configuration -------------------------------------------------
299
300# -- Options for intersphinx extension ---------------------------------------
301
302# Example configuration for intersphinx: refer to the Python standard library.
303intersphinx_mapping = {'https://docs.python.org/': None}
304
305# -- Options for todo extension ----------------------------------------------
306
307# If true, `todo` and `todoList` produce output, else they produce nothing.
308todo_include_todos = True
309