-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.py
195 lines (165 loc) · 5.43 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
project = 'ALSEP'
author = 'Matt Harasymczuk'
email = 'matt@astronaut.center'
language = 'pl'
# html_theme = 'sphinx_rtd_theme'
html_theme = 'thesis'
todo_emit_warnings = False
todo_include_todos = False
extensions = [
'sphinx.ext.autosectionlabel',
'sphinx.ext.duration',
'sphinx.ext.extlinks',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinxcontrib.bibtex',
]
numfig_format = {
'section': 'Rozdz. %s.',
'figure': 'Ryc. %s.',
'table': 'Tab. %s.',
'code-block': 'List. %s.',
}
exclude_patterns = [
'_not_used',
'LICENSE.rst',
'zakonczenie/podsumowanie.rst',
'zakonczenie/weryfikacja-celu.rst',
'zakonczenie/wnioski.rst',
]
suppress_warnings = [
'autosectionlabel.*',
]
html_context = {
'university': 'Analog Astronaut Training Center',
'faculty': 'Astro Tech and Bioastronautics',
'thesis': 'Geofizyka Stosowana',
'thesis_title': 'Badania geofizyczne w trakcie załogowej eksploracji Księżyca w ramach programu Apollo.',
'thesis_author': 'Mateusz Matt Harasymczuk',
'thesis_supervisor': '',
'city': 'Kraków',
'year': '2019',
'isbn': '978-83-957186-1-8'
}
if 'sphinxcontrib.bibtex' in extensions:
bibtex_bibfiles = [
'_references/bibliography.bib',
'_references/images.bib',
'_references/video.bib']
bibtex_bibliography_header = ".. rubric:: References"
bibtex_footbibliography_header = bibtex_bibliography_header
bibtex_default_style = 'alpha'
# article - for articles in scientific journals, presentations, short reports, program documentation, invitations, ...
# proc - a class for proceedings based on the article class.
# minimal - is as small as it can get. It only sets a page size and a base font. It is mainly used for debugging purposes.
# report - for longer reports containing several chapters, small books, thesis, ...
# book - for real books
# slides - for slides. The class uses big sans serif letters.
# memoir - for changing sensibly the output of the document. It is based on the book class, but you can create any kind of document with it (1)
# letter - For writing letters.
# beamer - For writing presentations (see LaTeX/Presentations).
latex_documentclass = 'report'
# -- Standard book config -----------------------------------------------------
import os
import re
import subprocess
import sys
from datetime import date
needs_sphinx = '2.4'
imgmath_image_format = 'png'
imgmath_latex = 'latex'
# mathjax_path = '_static/mathjax.js'
mathjax_path = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
mathjax_config = {
'extensions': ['tex2jax.js'],
'jax': ['input/TeX', 'output/HTML-CSS'],
}
exclude_patterns += [
'.*',
'venv*',
'virtualenv*',
'_build',
'_extensions',
'_img',
'_data',
'_slides',
'_i18n',
'_static',
'_themes',
'_tmp',
'**/contrib/*',
'**/solution/*',
'**/solutions/*',
'**/_template.rst',
'**.ipynb_checkpoints',
'README.rst',
'TODO.rst',
'**/_TODO.rst',
'Thumbs.db',
'.DS_Store',
]
master_doc = 'index'
templates_path = ['_templates']
highlight_language = 'python3'
pygments_style = 'borland'
autodoc_typehints = "description"
autosectionlabel_maxdepth = 4
sys.path.insert(0, os.path.abspath('_extensions'))
extlinks = {'isbn': ('https://e-isbn.pl/IsbnWeb/start/search.html?szukaj_fraza=%s', 'ISBN: ')}
# 0 - sequence number of image in whole document
# 1 - sequence number of image in header level 1 (only if :numbered: option is present at toctree directive)
# 2 - sequence number of image in header level 2
# will use x.1, x.2, … if located directly under a header level 1,
# will use 1, 2, … if at the document level
numfig_secnum_depth = 1
numfig = True
smartquotes = False
project_slug = re.sub(r'[\W]+', '', project)
sha1 = subprocess.run('git log -1 --format="%h"', stdout=subprocess.PIPE, shell=True, encoding='utf-8').stdout.strip()
year = date.today().year
today = date.today().strftime('%Y-%m-%d')
version = f'#{sha1}, {today}'
release = f'#{sha1}, {today}'
copyright = f'{year}, CC-BY-SA-4.0, {author} <{email}>, version: #{sha1}, last update: {today}'
html_show_sphinx = False
html_use_smartypants = False
html_search_language = language
html_add_permalinks = '¶'
html_theme_path = ['_themes']
html_secnumber_suffix = '. '
html_title = project
html_favicon = '_static/favicon.png'
html_static_path = ['_static']
if html_theme == 'sphinx_rtd_theme':
html_context.update({
'css_files': ['_static/screen.css', '_static/print.css'],
'script_files': ['_static/jquery.min.js', '_static/onload.js', mathjax_path],
})
if html_theme == 'thesis':
html_context.update({
'css_files': ['_static/theme-overrides.css'],
'script_files': [mathjax_path],
})
latex_documents = [('index', f'{project_slug}.tex', project, author, latex_documentclass)]
latex_elements = {
'papersize': 'a4paper',
'pointsize': '10pt',
'figure_align': 'H', # 'htbp',
# Fix for: LaTeX Backend Fails with Citations In Figure Captions
'preamble': r"""
\usepackage{float}
\usepackage{etoolbox}
\AtBeginEnvironment{figure}{\renewcommand{\phantomsection}{}}
"""
}
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
epub_exclude_files = ['search.html']
man_pages = [
(master_doc, project_slug, project, [author], 1)
]
texinfo_documents = [
(master_doc, project_slug, project, author, project, '', 'Miscellaneous'),
]