-
Notifications
You must be signed in to change notification settings - Fork 62
/
conf.py
394 lines (322 loc) · 13 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.append(os.path.abspath('_sphinxext'))
# -- Imports
import sphinx_rtd_theme
import sphinx
import releases_hack
# -- Project information -----------------------------------------------------
project = 'galgebra'
copyright = '2014-2019, Alan Bromborsky and GAlgebra team'
author = 'Alan Bromborsky'
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx',
'nbsphinx_link',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
'sphinx_markdown_tables',
'releases',
'sphinxcontrib.bibtex',
'sphinx_rtd_theme',
'sphinx_mdinclude'
]
# This is not actually used as we have a template overload to render this with
# latex. Leaving it here in case we change theme.
html_logo = "images/galgebra.svg"
bibtex_bibfiles = ['refs.bib']
# -- nbsphinx configuration ---------------------------------------------------
import galgebra
import nbsphinx
# nbsphinx_execute = 'always'
nbsphinx_execute = 'never'
nbsphinx_allow_errors=True
nbsphinx_kernel_name='python'
nbsphinx_timeout = 60
# This is processed by Jinja2 and inserted before each notebook
# Some change in dependencies made us need to replace `var` with
# `env.config.html_context['var']`.
nbsphinx_prolog = r"""
{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}
{% set git_ref = 'master' if not env.config.html_context['READTHEDOCS'] else
env.config.html_context['github_version']
if '.' not in env.config.html_context['current_version'] else
'v' + env.config.release %}
.. raw:: html
<div class="admonition note">
<p>This page was generated from
<a class="reference external" href="https://github.com/pygae/galgebra/blob/{{ git_ref|e }}/{{ docname|e }}">{{ docname|e }}</a>.
<!--
This does not work yet due to nbsphinx-link
Interactive online version:
<a href="https://mybinder.org/v2/gh/pygae/galgebra/{{ git_ref|e }}?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>.
-->
</p>
<script>
if (document.location.host) {
var p = document.currentScript.previousSibling.previousSibling;
var a = document.createElement('a');
a.innerHTML = 'View in <em>nbviewer</em>';
a.href = `https://nbviewer.jupyter.org/url${
(window.location.protocol == 'https:' ? 's/' : '/') +
window.location.host +
window.location.pathname.slice(0, -4) }ipynb`;
a.classList.add('reference');
a.classList.add('external');
p.appendChild(a);
p.appendChild(document.createTextNode('.'));
}
</script>
</div>
.. raw:: latex
\nbsphinxstartnotebook{\scriptsize\noindent\strut
\textcolor{gray}{The following section was generated from
\sphinxcode{\sphinxupquote{\strut {{ docname | escape_latex }}}} \dotfill}}
"""
# This is processed by Jinja2 and inserted after each notebook
nbsphinx_epilog = r"""
{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}
.. raw:: latex
\nbsphinxstopnotebook{\scriptsize\noindent\strut
\textcolor{gray}{\dotfill\ \sphinxcode{\sphinxupquote{\strut
{{ docname | escape_latex }}}} ends here.}}
"""
# -- latex configuration ---------------------------------------------------
galgebra_latex_macros = R"""
\newcommand{\bm}[1]{\boldsymbol{#1}}
\newcommand{\ubh}{\bm{\hat{u}}}
\newcommand{\ebh}{\bm{\hat{e}}}
\newcommand{\ebf}{\bm{e}}
\newcommand{\mat}[1]{\left [ {#1} \right ]}
\newcommand{\bra}[1]{{#1}_{\mathcal{G}}}
\newcommand{\ket}[1]{{#1}_{\mathcal{D}}}
\newcommand{\ds}{\displaystyle}
\newcommand{\bfrac}[2]{\displaystyle\frac{#1}{#2}}
\newcommand{\lp}{\left (}
\newcommand{\rp}{\right )}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\llt}{\left <}
\newcommand{\rgt}{\right >}
\newcommand{\abs}[1]{\left |{#1}\right |}
\newcommand{\pdiff}[2]{\bfrac{\partial {#1}}{\partial {#2}}}
\newcommand{\pdifftwo}[3]{\bfrac{\partial^{2} {#1}}{\partial {#2}\partial {#3}}}
\newcommand{\lbrc}{\left \{}
\newcommand{\rbrc}{\right \}}
\newcommand{\set}[1]{\lbrc {#1} \rbrc}
\newcommand{\W}{\wedge}
\newcommand{\R}{\dagger}
\newcommand{\lbrk}{\left [}
\newcommand{\rbrk}{\right ]}
\newcommand{\com}[1]{\lbrk {#1} \rbrk}
\newcommand{\proj}[2]{\llt {#1} \rgt_{#2}}
%\newcommand{\bm}{\boldsymbol}
\newcommand{\braces}[1]{\left \{ {#1} \right \}}
\newcommand{\grade}[1]{\left < {#1} \right >}
\newcommand{\f}[2]{{#1}\lp {#2} \rp }
\newcommand{\paren}[1]{\lp {#1} \rp }
\newcommand{\eval}[2]{\left . {#1} \right |_{#2}}
\newcommand{\prm}[1]{{#1}'}
\newcommand{\ddt}[1]{\bfrac{d{#1}}{dt}}
\newcommand{\deriv}[3]{\bfrac{d^{#3}#1}{d{#2}^{#3}}}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\eb}{\bm{e}}
\newcommand{\ehb}{\bm{\hat{e}}}
\newcommand{\Tn}[2]{\f{\mathcal{T}_{#2}}{#1}}
\newcommand{\tr}{\mbox{tr}}
\newcommand{\T}[1]{\texttt{#1}}
\newcommand{\grd}{\bm{\nabla}}
\newcommand{\indices}[1]{#1}
\newcommand{\xRightarrow}[1]{\overset{#1}{\Rightarrow}}
"""
# https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax
# mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
# # enable autonumbering
# mathjax_config = dict(TeX=dict(
# equationNumbers=dict(autoNumber="AMS"),
# extensions=["[Contrib]/preamble/preamble.js", "color.js"],
# preamble=[galgebra_latex_macros]
# ))
# https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax
# https://docs.mathjax.org/en/latest/input/tex/extensions/autoload.html#autoload-options
# https://docs.mathjax.org/en/latest/input/tex/eqnumbers.html
# mathjax3_config = dict(
# tex=dict(
# tags='ams'
# )
# )
# -- other extension configuration --------------------------------------------
napoleon_include_init_with_doc= False
autoclass_content = "both" # include both class docstring and __init__
autodoc_default_options = {
# Make sure that any autodoc declarations show the right members
"members": True,
# do not show inherited, as this pull in all the sympy members
# "inherited-members": True,
"member-order": "bysource",
# "undoc-members": True,
# "special-members": True,
# "private-members": True,
"show-inheritance": True,
}
#autodoc_default_flags='members'
# you have to list all files with automodule here due to bug in sphinx and nbsphinx
# https://github.com/spatialaudio/nbsphinx/issues/14
autosummary_generate=['api']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# from recommonmark.parser import CommonMarkParser
# source_parsers = {
# '.md': CommonMarkParser,
# }
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst']
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
'_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store',
# these are here for users, not for Sphinx
'books', 'old_installation.md', 'old_introduction.md',
# this is converted into ipynb elsewhere
'galgebra.md',
]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If your project is hosted on Github, set the releases_github_path setting instead,
# to e.g. account/project. Releases will then use an appropriate Github URL for both
# releases and issues.
releases_github_path = "pygae/galgebra"
releases_release_uri = releases_hack.release_uri(releases_github_path)
# You may optionally set releases_debug = True to see debug output while building your docs.
releases_debug = True
# If your changelog includes “simple” pre-1.0 releases derived from a single branch
# (i.e. without stable release lines & semantic versioning) you may want to set
# releases_unstable_prehistory = True.
releases_unstable_prehistory = True
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = dict(
logo_only=True,
)
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_context = {
# 'css_files': [
# '_static/css/theme.css',
# '_static/theme_overrides.css', # override wide tables in RTD theme
# ],
# }
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'galgebradoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
'preamble': galgebra_latex_macros,
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'galgebra.tex', 'galgebra Documentation',
'Alan Bromborsky', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'galgebra', 'galgebra Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'galgebra', 'galgebra Documentation',
author, 'galgebra', 'One line description of project.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'sympy': ('https://docs.sympy.org/latest', None),
}