Debian Codegraph @

docs/conf.py

raw
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 #
5 # The Mesa 3D Graphics Library documentation build configuration file, created by
6 # sphinx-quickstart on Wed Mar 29 14:08:51 2017.
7 #
8 # This file is execfile()d with the current directory set to its
9 # containing dir.
10 #
11 # Note that not all possible configuration values are present in this
12 # autogenerated file.
13 #
14 # All configuration values have a default; values that are commented out
15 # serve to show the default.
16
17 # If extensions (or modules to document with autodoc) are in another directory,
18 # add these directories to sys.path here. If the directory is relative to the
19 # documentation root, use os.path.abspath to make it absolute, like shown here.
20 #
21 import os
22 import sys
23
24 from hawkmoth.util import compiler
25
26 # If extensions (or modules to document with autodoc) are in another directory,
27 # add these directories to sys.path here. If the directory is relative to the
28 # documentation root, use os.path.abspath to make it absolute, like shown here.
29 sys.path.append(os.path.abspath('_exts'))
30
31
32 # -- General configuration ------------------------------------------------
33
34 # If your documentation needs a minimal Sphinx version, state it here.
35 #
36 # needs_sphinx = '1.0'
37
38 # Add any Sphinx extension module names here, as strings. They can be
39 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40 # ones.
41 extensions = [
42 'bootstrap',
43 'depfile',
44 'formatting',
45 'hawkmoth',
46 'nir',
47 'redirects',
48 'sphinx.ext.graphviz',
49 ]
50
51 # Add any paths that contain templates here, relative to this directory.
52 templates_path = ['_templates']
53
54 # The suffix(es) of source filenames.
55 # You can specify multiple suffix as a list of string:
56 #
57 # source_suffix = ['.rst', '.md']
58 source_suffix = '.rst'
59
60 # The master toctree document.
61 master_doc = 'index'
62
63 # General information about the project.
64 project = 'The Mesa 3D Graphics Library'
65 copyright = '1995-2018, Brian Paul'
66 author = 'Brian Paul'
67 html_show_copyright = False
68
69 html_theme_path = ['.']
70
71 # The version info for the project you're documenting, acts as replacement for
72 # |version| and |release|, also used in various other places throughout the
73 # built documents.
74 #
75 # The short X.Y version.
76 version = 'latest'
77 # The full version, including alpha/beta/rc tags.
78 release = 'latest'
79
80 # The language for content autogenerated by Sphinx. Refer to documentation
81 # for a list of supported languages.
82 #
83 # This is also used if you do content translation via gettext catalogs.
84 # Usually you set "language" from the command line for these cases.
85 language = 'en'
86
87 # List of patterns, relative to source directory, that match files and
88 # directories to ignore when looking for source files.
89 # This patterns also effect to html_static_path and html_extra_path
90 exclude_patterns = ['header-stubs']
91
92 # If true, `todo` and `todoList` produce output, else they produce nothing.
93 todo_include_todos = False
94
95 # Disable highlighting unless a language is specified, otherwise we'll get
96 # python keywords highlit in literal blocks.
97 highlight_language = 'none'
98
99 default_role = 'c:expr'
100
101 # -- Options for HTML output ----------------------------------------------
102
103 # The theme to use for HTML and HTML Help pages. See the documentation for
104 # a list of builtin themes.
105 #
106 html_theme = 'mesa3d_theme'
107
108 html_favicon = 'favicon.ico'
109
110 html_copy_source = False
111
112 # Add any paths that contain custom static files (such as style sheets) here,
113 # relative to this directory. They are copied after the builtin static files,
114 # so a file named "default.css" will overwrite the builtin "default.css".
115 html_static_path = []
116
117 html_extra_path = [
118 '_extra/',
119 'release-maintainers-keys.asc',
120 'features.txt',
121 'libGL.txt',
122 'README.UVD',
123 'README.VCE',
124 ]
125
126 html_redirects = [
127 ('webmaster', 'https://www.mesa3d.org/website/'),
128 ('developers', 'https://www.mesa3d.org/developers/'),
129 ('thanks', 'https://gitlab.freedesktop.org/mesa/mesa/-/blob/amber/docs/thanks.rst'),
130 ]
131
132
133 # -- Options for linkcheck ------------------------------------------------
134
135 linkcheck_ignore = [
136 r'specs/.*\.spec', # gets copied during the build process
137 r'news:.*', # seems linkcheck doesn't like the news: URI-scheme...
138 r'http://mesa-ci-results.jf.intel.com', # only available for Intel employees
139 r'https://gitlab.com/.*#.*', # needs JS eval
140 r'https://gitlab.freedesktop.org/.*#.*', # needs JS eval
141 r'https://github.com/.*#.*', # needs JS eval
142 r'https://www.intel.com/.*', # intel.com is blocking the linkcheck user-agent; maybe it can be customized to look like a browser?
143 r'https://sourceforge.net/.*', # blocking the linkcheck user-agent
144 r'https://.*\.sourceforge\.net/.*', # blocking the linkcheck user-agent
145 r'https://stackoverflow.com/.*', # blocking the linkcheck user-agent
146 r'https://(www|dev)\.vulkan\.org/.*', # blocking the linkcheck user-agent
147 r'https://crates.io/.*', # blocking the linkcheck user-agent
148 ]
149 linkcheck_exclude_documents = [r'relnotes/.*']
150
151 linkcheck_allowed_redirects = {
152 # Pages that forward the front-page to a wiki or some explore-page
153 'https://www.freedesktop.org': 'https://www.freedesktop.org/wiki/',
154 'https://x.org': 'https://x.org/wiki/',
155 'https://dri.freedesktop.org/': 'https://dri.freedesktop.org/wiki/',
156 'https://gitlab.freedesktop.org/': 'https://gitlab.freedesktop.org/explore/groups',
157 'https://www.sphinx-doc.org/': 'https://www.sphinx-doc.org/en/master/',
158
159 # Pages that requires authentication
160 'https://gitlab.freedesktop.org/admin/runners': 'https://gitlab.freedesktop.org/users/sign_in',
161 'https://gitlab.freedesktop.org/profile/personal_access_tokens': 'https://gitlab.freedesktop.org/users/sign_in',
162 'https://support.broadcom.com/group/ecx/free-downloads': 'https://support.broadcom.com/c/portal/login',
163 }
164
165
166 # -- Options for HTMLHelp output ------------------------------------------
167
168 # Output file base name for HTML help builder.
169 htmlhelp_basename = 'TheMesa3DGraphicsLibrarydoc'
170
171
172 # -- Options for LaTeX output ---------------------------------------------
173
174 latex_elements = {
175 # The paper size ('letterpaper' or 'a4paper').
176 #
177 # 'papersize': 'letterpaper',
178
179 # The font size ('10pt', '11pt' or '12pt').
180 #
181 # 'pointsize': '10pt',
182
183 # Additional stuff for the LaTeX preamble.
184 #
185 # 'preamble': '',
186
187 # Latex figure (float) alignment
188 #
189 # 'figure_align': 'htbp',
190 }
191
192 # Grouping the document tree into LaTeX files. List of tuples
193 # (source start file, target name, title,
194 # author, documentclass [howto, manual, or own class]).
195 latex_documents = [
196 (master_doc, 'TheMesa3DGraphicsLibrary.tex', 'The Mesa 3D Graphics Library Documentation',
197 'Brian Paul', 'manual'),
198 ]
199
200
201 # -- Options for manual page output ---------------------------------------
202
203 # One entry per manual page. List of tuples
204 # (source start file, name, description, authors, manual section).
205 man_pages = [
206 (master_doc, 'themesa3dgraphicslibrary', 'The Mesa 3D Graphics Library Documentation',
207 [author], 1)
208 ]
209
210
211 # -- Options for Texinfo output -------------------------------------------
212
213 # Grouping the document tree into Texinfo files. List of tuples
214 # (source start file, target name, title, author,
215 # dir menu entry, description, category)
216 texinfo_documents = [
217 (master_doc, 'TheMesa3DGraphicsLibrary', 'The Mesa 3D Graphics Library Documentation',
218 author, 'TheMesa3DGraphicsLibrary', 'One line description of project.',
219 'Miscellaneous'),
220 ]
221
222 # -- Options for Graphviz -------------------------------------------------
223
224 graphviz_output_format = 'svg'
225
226 # -- Options for hawkmoth -------------------------------------------------
227
228 hawkmoth_root = os.path.abspath(os.pardir)
229 mesa_root = os.path.join(os.path.dirname(__file__), os.pardir)
230 mesa_build_root = os.environ.get('MESA_BUILD_ROOT')
231 hawkmoth_clang = [
232 '-I{}/docs/header-stubs/'.format(mesa_root),
233 '-I{}/include/'.format(mesa_root),
234 '-I{}/src/'.format(mesa_root),
235 '-I{}/src/gallium/include/'.format(mesa_root),
236 '-I{}/src/intel/'.format(mesa_root),
237 '-I{}/src/mesa/'.format(mesa_root),
238 '-I{}/src/vulkan/util'.format(mesa_root),
239 '-I{}/src/'.format(mesa_build_root),
240 '-DHAVE_STRUCT_TIMESPEC',
241 '-DHAVE_PTHREAD',
242 '-DHAVE_ENDIAN_H',
243 ]
244 hawkmoth_clang.extend(compiler.get_include_args())
245
246 # helpers for definining parameter direction
247 rst_prolog = '''
248 .. |in| replace:: **[in]**
249 .. |out| replace:: **[out]**
250 .. |inout| replace:: **[inout]**
251 '''