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