]>
Commit | Line | Data |
---|---|---|
7ef486ae DM |
1 | #!/usr/bin/env python3 |
2 | # -*- coding: utf-8 -*- | |
3 | # | |
4 | # Proxmox Backup documentation build configuration file, originally | |
5 | # created by sphinx-quickstart on Tue Feb 26 16:54:35 2019. | |
6 | # | |
7 | # This file is execfile()d with the current directory set to its | |
8 | # containing dir. | |
9 | # | |
10 | # Note that not all possible configuration values are present in this | |
11 | # autogenerated file. | |
12 | # | |
13 | # All configuration values have a default; values that are commented out | |
14 | # serve to show the default. | |
15 | ||
16 | # If extensions (or modules to document with autodoc) are in another directory, | |
17 | # add these directories to sys.path here. If the directory is relative to the | |
18 | # documentation root, use os.path.abspath to make it absolute, like shown here. | |
19 | # | |
1f6a4f58 | 20 | import os |
49df8ac1 | 21 | import sys |
7ef486ae DM |
22 | # sys.path.insert(0, os.path.abspath('.')) |
23 | ||
49df8ac1 OB |
24 | # custom extensions |
25 | sys.path.append(os.path.abspath("./_ext")) | |
26 | ||
bca294a1 DM |
27 | # -- Implement custom formatter for code-blocks --------------------------- |
28 | # | |
29 | # * use smaller font | |
30 | # * avoid space between lines to nicely format utf8 tables | |
31 | ||
32 | from sphinx.highlighting import PygmentsBridge | |
33 | from pygments.formatters.latex import LatexFormatter | |
34 | ||
35 | class CustomLatexFormatter(LatexFormatter): | |
36 | def __init__(self, **options): | |
37 | super(CustomLatexFormatter, self).__init__(**options) | |
38 | self.verboptions = r"formatcom=\footnotesize\relax\let\strut\empty" | |
39 | ||
40 | PygmentsBridge.latex_formatter = CustomLatexFormatter | |
41 | ||
7ef486ae DM |
42 | # -- General configuration ------------------------------------------------ |
43 | ||
44 | # If your documentation needs a minimal Sphinx version, state it here. | |
45 | # | |
46 | # needs_sphinx = '1.0' | |
47 | ||
48 | # Add any Sphinx extension module names here, as strings. They can be | |
49 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | |
50 | # ones. | |
d87b193b | 51 | |
f3c867a0 | 52 | extensions = ["sphinx.ext.graphviz", 'sphinx.ext.mathjax', "sphinx.ext.todo", "proxmox-scanrefs"] |
7ef486ae | 53 | |
d87b193b TL |
54 | todo_link_only = True |
55 | ||
7ef486ae DM |
56 | # Add any paths that contain templates here, relative to this directory. |
57 | templates_path = ['_templates'] | |
58 | ||
59 | # The suffix(es) of source filenames. | |
60 | # You can specify multiple suffix as a list of string: | |
61 | # | |
62 | # source_suffix = ['.rst', '.md'] | |
63 | source_suffix = '.rst' | |
64 | ||
65 | # The encoding of source files. | |
66 | # | |
67 | # source_encoding = 'utf-8-sig' | |
68 | ||
69 | # The master toctree document. | |
70 | master_doc = 'index' | |
71 | ||
3147e56a DM |
72 | epilog_file = open('epilog.rst', 'r') |
73 | rst_epilog = epilog_file.read() | |
74 | ||
7ef486ae DM |
75 | # General information about the project. |
76 | project = 'Proxmox Backup' | |
04cec92e | 77 | copyright = '2019-2021, Proxmox Server Solutions GmbH' |
7ef486ae DM |
78 | author = 'Proxmox Support Team' |
79 | ||
80 | # The version info for the project you're documenting, acts as replacement for | |
81 | # |version| and |release|, also used in various other places throughout the | |
82 | # built documents. | |
83 | # | |
84 | # The short X.Y version. | |
1f6a4f58 TL |
85 | vstr = lambda s: '<devbuild>' if s is None else str(s) |
86 | ||
87 | version = vstr(os.getenv('DEB_VERSION_UPSTREAM')) | |
7ef486ae | 88 | # The full version, including alpha/beta/rc tags. |
1f6a4f58 | 89 | release = vstr(os.getenv('DEB_VERSION')) |
7ef486ae DM |
90 | |
91 | # The language for content autogenerated by Sphinx. Refer to documentation | |
92 | # for a list of supported languages. | |
93 | # | |
94 | # This is also used if you do content translation via gettext catalogs. | |
95 | # Usually you set "language" from the command line for these cases. | |
96 | language = None | |
97 | ||
98 | # There are two options for replacing |today|: either, you set today to some | |
99 | # non-false value, then it is used: | |
7ef486ae DM |
100 | # today = '' |
101 | # | |
102 | # Else, today_fmt is used as the format for a strftime call. | |
796480a3 | 103 | today_fmt = '%A, %d %B %Y' |
7ef486ae DM |
104 | |
105 | # List of patterns, relative to source directory, that match files and | |
106 | # directories to ignore when looking for source files. | |
107 | # This patterns also effect to html_static_path and html_extra_path | |
f13c36c8 DM |
108 | exclude_patterns = [ |
109 | '_build', 'Thumbs.db', '.DS_Store', | |
8d1a1b29 DM |
110 | '*/man1.rst', |
111 | 'config/*/man5.rst', | |
3147e56a | 112 | 'epilog.rst', |
f13c36c8 | 113 | 'pbs-copyright.rst', |
24406ebc | 114 | 'local-zfs.rst' |
861f8b8f | 115 | 'package-repositories.rst', |
f13c36c8 | 116 | ] |
7ef486ae DM |
117 | |
118 | # The reST default role (used for this markup: `text`) to use for all | |
119 | # documents. | |
120 | # | |
121 | # default_role = None | |
122 | ||
123 | # If true, '()' will be appended to :func: etc. cross-reference text. | |
124 | # | |
125 | # add_function_parentheses = True | |
126 | ||
127 | # If true, the current module name will be prepended to all description | |
128 | # unit titles (such as .. function::). | |
129 | # | |
130 | # add_module_names = True | |
131 | ||
132 | # If true, sectionauthor and moduleauthor directives will be shown in the | |
133 | # output. They are ignored by default. | |
134 | # | |
135 | # show_authors = False | |
136 | ||
137 | # The name of the Pygments (syntax highlighting) style to use. | |
138 | pygments_style = 'sphinx' | |
139 | ||
140 | # A list of ignored prefixes for module index sorting. | |
141 | # modindex_common_prefix = [] | |
142 | ||
143 | # If true, keep warnings as "system message" paragraphs in the built documents. | |
144 | # keep_warnings = False | |
145 | ||
146 | # If true, `todo` and `todoList` produce output, else they produce nothing. | |
8cce5113 | 147 | todo_include_todos = not tags.has('release') |
7ef486ae DM |
148 | |
149 | ||
150 | # -- Options for HTML output ---------------------------------------------- | |
151 | ||
152 | # The theme to use for HTML and HTML Help pages. See the documentation for | |
153 | # a list of builtin themes. | |
154 | # | |
05c16a6e | 155 | html_theme = 'alabaster' |
7ef486ae DM |
156 | |
157 | # Theme options are theme-specific and customize the look and feel of a theme | |
158 | # further. For a list of options available for each theme, see the | |
159 | # documentation. | |
160 | # | |
05c16a6e TL |
161 | html_theme_options = { |
162 | 'fixed_sidebar': True, | |
fd6a54df TL |
163 | 'sidebar_includehidden': False, |
164 | 'sidebar_collapse': False, | |
165 | 'globaltoc_collapse': False, | |
166 | 'show_relbar_bottom': True, | |
05c16a6e TL |
167 | 'show_powered_by': False, |
168 | ||
fd6a54df TL |
169 | 'extra_nav_links': { |
170 | 'Proxmox Homepage': 'https://proxmox.com', | |
171 | 'PDF': 'proxmox-backup.pdf', | |
1adbc7c1 | 172 | 'API Viewer' : 'api-viewer/index.html', |
3323798b | 173 | 'Prune Simulator' : 'prune-simulator/index.html', |
4a227b54 | 174 | 'LTO Barcode Generator' : 'lto-barcode/index.html', |
fd6a54df | 175 | }, |
05c16a6e | 176 | |
fd6a54df TL |
177 | 'sidebar_width': '320px', |
178 | 'page_width': '1320px', | |
05c16a6e TL |
179 | # font styles |
180 | 'head_font_family': 'Lato, sans-serif', | |
181 | 'caption_font_family': 'Lato, sans-serif', | |
182 | 'caption_font_size': '20px', | |
183 | 'font_family': 'Open Sans, sans-serif', | |
184 | } | |
7ef486ae | 185 | |
a76934ad TL |
186 | # Alabaster theme recommends setting this fixed. |
187 | # If you switch theme this needs to removed, probably. | |
188 | html_sidebars = { | |
189 | '**': [ | |
190 | 'sidebar-header.html', | |
191 | 'searchbox.html', | |
192 | 'navigation.html', | |
193 | 'relations.html', | |
194 | ], | |
195 | ||
196 | 'index': [ | |
197 | 'sidebar-header.html', | |
198 | 'searchbox.html', | |
199 | 'index-sidebar.html', | |
200 | ] | |
201 | } | |
202 | ||
203 | ||
7ef486ae DM |
204 | # Add any paths that contain custom themes here, relative to this directory. |
205 | # html_theme_path = [] | |
206 | ||
207 | # The name for this set of Sphinx documents. | |
208 | # "<project> v<release> documentation" by default. | |
209 | # | |
210 | # html_title = 'Proxmox Backup v1.0-1' | |
211 | ||
212 | # A shorter title for the navigation bar. Default is the same as html_title. | |
213 | # | |
214 | # html_short_title = None | |
215 | ||
216 | # The name of an image file (relative to this directory) to place at the top | |
217 | # of the sidebar. | |
218 | # | |
05c16a6e | 219 | #html_logo = 'images/proxmox-logo.svg' # replaced by html_theme_options.logo |
7ef486ae DM |
220 | |
221 | # The name of an image file (relative to this directory) to use as a favicon of | |
222 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 | |
223 | # pixels large. | |
224 | # | |
225 | html_favicon = 'images/favicon.ico' | |
226 | ||
227 | # Add any paths that contain custom static files (such as style sheets) here, | |
228 | # relative to this directory. They are copied after the builtin static files, | |
229 | # so a file named "default.css" will overwrite the builtin "default.css". | |
230 | html_static_path = ['_static'] | |
231 | ||
8a40e226 TL |
232 | html_js_files = [ |
233 | 'custom.js', | |
234 | ] | |
235 | ||
7ef486ae DM |
236 | # Add any extra paths that contain custom files (such as robots.txt or |
237 | # .htaccess) here, relative to this directory. These files are copied | |
238 | # directly to the root of the documentation. | |
239 | # | |
240 | # html_extra_path = [] | |
241 | ||
242 | # If not None, a 'Last updated on:' timestamp is inserted at every page | |
243 | # bottom, using the given strftime format. | |
244 | # The empty string is equivalent to '%b %d, %Y'. | |
245 | # | |
246 | # html_last_updated_fmt = None | |
247 | ||
b22a9c14 DM |
248 | # We need to disable smatquotes, else Option Lists do not display long options |
249 | smartquotes = False | |
7ef486ae | 250 | |
7ef486ae DM |
251 | # Additional templates that should be rendered to pages, maps page names to |
252 | # template names. | |
253 | # | |
254 | # html_additional_pages = {} | |
255 | ||
256 | # If false, no module index is generated. | |
257 | # | |
258 | # html_domain_indices = True | |
259 | ||
260 | # If false, no index is generated. | |
261 | # | |
262 | # html_use_index = True | |
263 | ||
264 | # If true, the index is split into individual pages for each letter. | |
265 | # | |
266 | # html_split_index = False | |
267 | ||
268 | # If true, links to the reST sources are added to the pages. | |
269 | # | |
05c16a6e | 270 | html_show_sourcelink = False |
7ef486ae DM |
271 | |
272 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. | |
273 | # | |
274 | # html_show_sphinx = True | |
275 | ||
276 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. | |
277 | # | |
278 | # html_show_copyright = True | |
279 | ||
280 | # If true, an OpenSearch description file will be output, and all pages will | |
281 | # contain a <link> tag referring to it. The value of this option must be the | |
282 | # base URL from which the finished HTML is served. | |
283 | # | |
284 | # html_use_opensearch = '' | |
285 | ||
286 | # This is the file name suffix for HTML files (e.g. ".xhtml"). | |
287 | # html_file_suffix = None | |
288 | ||
289 | # Language to be used for generating the HTML full-text search index. | |
290 | # Sphinx supports the following languages: | |
291 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' | |
292 | # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh' | |
293 | # | |
294 | # html_search_language = 'en' | |
295 | ||
296 | # A dictionary with options for the search language support, empty by default. | |
297 | # 'ja' uses this config value. | |
298 | # 'zh' user can custom change `jieba` dictionary path. | |
299 | # | |
300 | # html_search_options = {'type': 'default'} | |
301 | ||
302 | # The name of a javascript file (relative to the configuration directory) that | |
303 | # implements a search results scorer. If empty, the default will be used. | |
304 | # | |
305 | # html_search_scorer = 'scorer.js' | |
306 | ||
307 | # Output file base name for HTML help builder. | |
308 | htmlhelp_basename = 'ProxmoxBackupdoc' | |
309 | ||
f3c867a0 TL |
310 | # use local mathjax package, symlink comes from debian/proxmox-backup-docs.links |
311 | mathjax_path = "mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML" | |
312 | ||
7ef486ae DM |
313 | # -- Options for LaTeX output --------------------------------------------- |
314 | ||
15d74eaa DM |
315 | latex_engine = 'xelatex' |
316 | ||
7ef486ae | 317 | latex_elements = { |
15d74eaa DM |
318 | 'fontenc': '\\usepackage{fontspec}', |
319 | ||
7ef486ae DM |
320 | # The paper size ('letterpaper' or 'a4paper'). |
321 | # | |
322 | 'papersize': 'a4paper', | |
323 | ||
324 | # The font size ('10pt', '11pt' or '12pt'). | |
325 | # | |
15d74eaa DM |
326 | 'pointsize': '10pt', |
327 | ||
328 | 'fontpkg': r''' | |
25cf0906 | 329 | \setmainfont{Open Sans} |
fc598cdb | 330 | \setsansfont{Lato} |
bca294a1 | 331 | \setmonofont{DejaVu Sans Mono} |
15d74eaa | 332 | ''', |
7ef486ae DM |
333 | |
334 | # Additional stuff for the LaTeX preamble. | |
335 | # | |
bca294a1 | 336 | # 'preamble': '', |
7ef486ae DM |
337 | |
338 | # Latex figure (float) alignment | |
339 | # | |
340 | # 'figure_align': 'htbp', | |
341 | } | |
342 | ||
343 | # Grouping the document tree into LaTeX files. List of tuples | |
344 | # (source start file, target name, title, | |
345 | # author, documentclass [howto, manual, or own class]). | |
346 | latex_documents = [ | |
347 | (master_doc, 'ProxmoxBackup.tex', 'Proxmox Backup Documentation', | |
348 | 'Proxmox Support Team', 'manual'), | |
349 | ] | |
350 | ||
351 | # The name of an image file (relative to this directory) to place at the top of | |
352 | # the title page. | |
353 | # | |
354 | # | |
355 | # Note: newer sphinx 1.6 should be able to convert .svg to .png | |
356 | # automatically using sphinx.ext.imgconverter | |
357 | latex_logo = "images/proxmox-logo.png" | |
358 | ||
359 | # For "manual" documents, if this is true, then toplevel headings are parts, | |
360 | # not chapters. | |
361 | # | |
362 | # latex_use_parts = False | |
363 | ||
364 | # If true, show page references after internal links. | |
365 | # | |
366 | # latex_show_pagerefs = False | |
367 | ||
368 | # If true, show URL addresses after external links. | |
369 | # | |
370 | # latex_show_urls = False | |
371 | ||
372 | # Documents to append as an appendix to all manuals. | |
373 | # | |
374 | # latex_appendices = [] | |
375 | ||
376 | # It false, will not define \strong, \code, itleref, \crossref ... but only | |
377 | # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added | |
378 | # packages. | |
379 | # | |
380 | # latex_keep_old_macro_names = True | |
381 | ||
382 | # If false, no module index is generated. | |
383 | # | |
384 | # latex_domain_indices = True | |
385 | ||
386 | ||
387 | # -- Options for Epub output ---------------------------------------------- | |
388 | ||
389 | # Bibliographic Dublin Core info. | |
390 | epub_title = project | |
391 | epub_author = author | |
392 | epub_publisher = author | |
393 | epub_copyright = copyright | |
394 | ||
395 | # The basename for the epub file. It defaults to the project name. | |
396 | # epub_basename = project | |
397 | ||
398 | # The HTML theme for the epub output. Since the default themes are not | |
399 | # optimized for small screen space, using the same theme for HTML and epub | |
400 | # output is usually not wise. This defaults to 'epub', a theme designed to save | |
401 | # visual space. | |
402 | # | |
403 | # epub_theme = 'epub' | |
404 | ||
405 | # The language of the text. It defaults to the language option | |
406 | # or 'en' if the language is not set. | |
407 | # | |
408 | # epub_language = '' | |
409 | ||
410 | # The scheme of the identifier. Typical schemes are ISBN or URL. | |
411 | # epub_scheme = '' | |
412 | ||
413 | # The unique identifier of the text. This can be a ISBN number | |
414 | # or the project homepage. | |
415 | # | |
416 | # epub_identifier = '' | |
417 | ||
418 | # A unique identification for the text. | |
419 | # | |
420 | # epub_uid = '' | |
421 | ||
422 | # A tuple containing the cover image and cover page html template filenames. | |
423 | # | |
424 | # epub_cover = () | |
425 | ||
426 | # A sequence of (type, uri, title) tuples for the guide element of content.opf. | |
427 | # | |
428 | # epub_guide = () | |
429 | ||
430 | # HTML files that should be inserted before the pages created by sphinx. | |
431 | # The format is a list of tuples containing the path and title. | |
432 | # | |
433 | # epub_pre_files = [] | |
434 | ||
435 | # HTML files that should be inserted after the pages created by sphinx. | |
436 | # The format is a list of tuples containing the path and title. | |
437 | # | |
438 | # epub_post_files = [] | |
439 | ||
440 | # A list of files that should not be packed into the epub file. | |
441 | epub_exclude_files = ['search.html'] | |
442 | ||
443 | # The depth of the table of contents in toc.ncx. | |
444 | # | |
445 | # epub_tocdepth = 3 | |
446 | ||
447 | # Allow duplicate toc entries. | |
448 | # | |
449 | # epub_tocdup = True | |
450 | ||
451 | # Choose between 'default' and 'includehidden'. | |
452 | # | |
453 | # epub_tocscope = 'default' | |
454 | ||
455 | # Fix unsupported image types using the Pillow. | |
456 | # | |
457 | # epub_fix_images = False | |
458 | ||
459 | # Scale large images. | |
460 | # | |
461 | # epub_max_image_width = 0 | |
462 | ||
463 | # How to display URL addresses: 'footnote', 'no', or 'inline'. | |
464 | # | |
465 | # epub_show_urls = 'inline' | |
466 | ||
467 | # If false, no index is generated. | |
468 | # | |
469 | # epub_use_index = True |