/
conf.py
209 lines (165 loc) · 5.33 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
import datetime
import pkg_resources
import alabaster
import ablog
ablog_builder = 'dirhtml'
ablog_website = '_website'
project = 'PyGears'
this_year = datetime.date.today().year
copyright = f'{this_year}, Bogdan Vukobratovic'
author = 'Bogdan Vukobratović'
version = pkg_resources.get_distribution("pygears").version
release = version
extensions = [
'sphinx.ext.autodoc',
'sphinxarg.ext',
'sphinx_verboser.verboser',
'sphinx_urlinclude.urlinclude',
'sphinxcontrib.tikz',
'alabaster',
'ablog',
'sphinx_sitemap',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'bdp.sphinxext.bdpfigure',
]
intersphinx_mapping = {
'pygears': ('../', '/tools/home/pygears/docs/manual/_build/html/objects.inv')
}
# intersphinx_mapping = {'pygears': ('https://www.pygears.org', None)}
# intersphinx_timeout = 10
site_url = "https://www.pygears.org/blog/"
# Add any paths that contain templates here, relative to this directory.
source_suffix = '.rst'
master_doc = 'index'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'
html_theme = 'alabaster'
html_title = "PyGears - HW Design: A Functional Approach"
html_short_title = "PyGears"
html_static_path = ['_static', '../manual/_static']
html_use_index = True
html_baseurl = "https://www.pygears.org"
html_domain_indices = False
html_show_sourcelink = True
html_favicon = '../manual/_static/pygears.ico'
# ABLOG
templates_path = [ablog.get_html_templates_path(), '_templates']
def link_posts_within_category(posts):
"""Link posts after sorting them post by published date."""
from operator import attrgetter
posts = filter(attrgetter("order"), posts)
posts = sorted(posts)
for p in posts:
p.prev = p.next = None
for i in range(0, len(posts) - 1):
try:
succ = next(
p for p in posts[i + 1:] if p.category == posts[i].category)
posts[i].next = succ
succ.prev = posts[i]
except StopIteration:
posts[i].next = None
ablog.blog.link_posts = link_posts_within_category
blog_title = 'PyGears'
blog_baseurl = 'https://www.pygears.org/'
blog_languages = {
'en': ('English', None),
}
blog_default_language = 'en'
blog_authors = {
'Bogdan': (u'Bogdan Vukobratović', 'https://github.com/bogdanvuk'),
}
blog_feed_archives = True
blog_feed_fulltext = True
blog_feed_length = None
disqus_shortname = 'pygears'
disqus_pages = True
# fontawesome_css_file = 'css/font-awesome.css'
# blog_feed_titles = False
# blog_archive_titles = False
# post_auto_excerpt = 1
# THEME
html_style = 'alabaster.css'
html_theme = 'alabaster'
html_sidebars = {
'**': [
'custom_about.html', 'postcard.html', 'recentposts.html',
'tagcloud.html', 'categories.html', 'archives.html', 'searchbox.html'
]
}
html_theme_path = [alabaster.get_path()]
html_theme_options = {
'travis_button': False,
'github_user': 'bogdanvuk',
'github_repo': 'pygears',
'description': 'HW Design: A Functional Approach',
'logo': 'logo.png',
'sidebar_width': '230px'
}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'PyGearsdoc'
# -- 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': '',
# 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, 'PyGears.tex', 'PyGears Documentation', 'Bogdan Vukobratović',
'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, 'pygears', 'PyGears 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, 'PyGears', 'PyGears Documentation', author, 'PyGears',
'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']
tikz_latex_preamble = r'''
\newcommand{\gear}[7]{%
node {#7}
\foreach \i in {1,...,#1} {%
[rotate=(\i-1)*360/#1] (0:#2) arc (0:#4:#2) {[rounded corners=1.5pt]
-- (#4+#5:#3) arc (#4+#5:360/#1-#5:#3)} -- (360/#1:#2)
}}
\tikzset{
pics/mynode/.style args={#1}{
code={
\draw[thick] \gear{10}{2}{2.4}{14}{1}{prod}{#1};
}
}
}
'''
def setup(app):
app.add_stylesheet('custom.css')