1# -*- coding: utf-8 -*-
2#
3# documentation build configuration file, created by
4# sphinx-quickstart on Sat Sep 10 18:18:25 2011.
5#
6# This file is execfile()d with the current directory set to its containing dir.
7#
8# Note that not all possible configuration values are present in this
9# autogenerated file.
10#
11# All configuration values have a default; values that are commented out
12# serve to show the default.
13
14# If extensions (or modules to document with autodoc) are in another directory,
15# add these directories to sys.path here. If the directory is relative to the
16# documentation root, use os.path.abspath to make it absolute, like shown here.
17import sys, os
18sys.path.insert(0, os.path.abspath('../src'))
19
20from borg import __version__ as sw_version
21
22# -- General configuration -----------------------------------------------------
23
24# If your documentation needs a minimal Sphinx version, state it here.
25#needs_sphinx = '1.0'
26
27# Add any Sphinx extension module names here, as strings. They can be extensions
28# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29extensions = []
30
31# Add any paths that contain templates here, relative to this directory.
32templates_path = ['_templates']
33
34# The suffix of source filenames.
35source_suffix = '.rst'
36
37# The encoding of source files.
38#source_encoding = 'utf-8-sig'
39
40# The master toctree document.
41master_doc = 'index'
42
43# General information about the project.
44project = 'Borg - Deduplicating Archiver'
45copyright = u'2010-2014 Jonas Borgström, 2015-2021 The Borg Collective (see AUTHORS file)'
46
47# The version info for the project you're documenting, acts as replacement for
48# |version| and |release|, also used in various other places throughout the
49# built documents.
50#
51# The short X.Y version.
52split_char = '+' if '+' in sw_version else '-'
53version = sw_version.split(split_char)[0]
54# The full version, including alpha/beta/rc tags.
55release = version
56
57suppress_warnings = ['image.nonlocal_uri']
58
59# The language for content autogenerated by Sphinx. Refer to documentation
60# for a list of supported languages.
61#language = None
62
63# There are two options for replacing |today|: either, you set today to some
64# non-false value, then it is used:
65#today = ''
66# Else, today_fmt is used as the format for a strftime call.
67today_fmt = '%Y-%m-%d'
68
69# List of patterns, relative to source directory, that match files and
70# directories to ignore when looking for source files.
71exclude_patterns = ['_build']
72
73# The reST default role (used for this markup: `text`) to use for all documents.
74#default_role = None
75
76# The Borg docs contain no or very little Python docs.
77# Thus, the primary domain is rst.
78primary_domain = 'rst'
79
80# If true, '()' will be appended to :func: etc. cross-reference text.
81#add_function_parentheses = True
82
83# If true, the current module name will be prepended to all description
84# unit titles (such as .. function::).
85#add_module_names = True
86
87# If true, sectionauthor and moduleauthor directives will be shown in the
88# output. They are ignored by default.
89#show_authors = False
90
91# The name of the Pygments (syntax highlighting) style to use.
92pygments_style = 'sphinx'
93
94# A list of ignored prefixes for module index sorting.
95#modindex_common_prefix = []
96
97
98# -- Options for HTML output ---------------------------------------------------
99
100# The theme to use for HTML and HTML Help pages.  See the documentation for
101# a list of builtin themes.
102import guzzle_sphinx_theme
103
104html_theme_path = guzzle_sphinx_theme.html_theme_path()
105html_theme = 'guzzle_sphinx_theme'
106
107
108def set_rst_settings(app):
109    app.env.settings.update({
110        'field_name_limit': 0,
111        'option_limit': 0,
112    })
113
114
115def setup(app):
116    app.add_css_file('css/borg.css')
117    app.connect('builder-inited', set_rst_settings)
118
119# Theme options are theme-specific and customize the look and feel of a theme
120# further.  For a list of options available for each theme, see the
121# documentation.
122html_theme_options = {
123    'project_nav_name': 'Borg %s' % version,
124}
125
126# Add any paths that contain custom themes here, relative to this directory.
127#html_theme_path = ['_themes']
128
129# The name for this set of Sphinx documents.  If None, it defaults to
130# "<project> v<release> documentation".
131#html_title = None
132
133# A shorter title for the navigation bar.  Default is the same as html_title.
134#html_short_title = None
135
136# The name of an image file (relative to this directory) to place at the top
137# of the sidebar.
138html_logo = '_static/logo.svg'
139
140# The name of an image file (within the static path) to use as favicon of the
141# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
142# pixels large.
143html_favicon = '_static/favicon.ico'
144
145# Add any paths that contain custom static files (such as style sheets) here,
146# relative to this directory. They are copied after the builtin static files,
147# so a file named "default.css" will overwrite the builtin "default.css".
148html_static_path = ['borg_theme']
149
150html_extra_path = ['../src/borg/paperkey.html']
151
152# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
153# using the given strftime format.
154html_last_updated_fmt = '%Y-%m-%d'
155
156# If true, SmartyPants will be used to convert quotes and dashes to
157# typographically correct entities.
158html_use_smartypants = True
159
160# Custom sidebar templates, maps document names to template names.
161html_sidebars = {
162    '**': ['logo-text.html', 'searchbox.html', 'globaltoc.html'],
163}
164
165# Additional templates that should be rendered to pages, maps page names to
166# template names.
167#html_additional_pages = {}
168
169# If false, no module index is generated.
170#html_domain_indices = True
171
172# If false, no index is generated.
173html_use_index = False
174
175# If true, the index is split into individual pages for each letter.
176#html_split_index = False
177
178# If true, links to the reST sources are added to the pages.
179html_show_sourcelink = False
180
181# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
182html_show_sphinx = False
183
184# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
185html_show_copyright = False
186
187# If true, an OpenSearch description file will be output, and all pages will
188# contain a <link> tag referring to it.  The value of this option must be the
189# base URL from which the finished HTML is served.
190#html_use_opensearch = ''
191
192# This is the file name suffix for HTML files (e.g. ".xhtml").
193#html_file_suffix = None
194
195# Output file base name for HTML help builder.
196htmlhelp_basename = 'borgdoc'
197
198
199# -- Options for LaTeX output --------------------------------------------------
200
201# Grouping the document tree into LaTeX files. List of tuples
202# (source start file, target name, title, author, documentclass [howto/manual]).
203latex_documents = [
204  ('book', 'Borg.tex', 'Borg Documentation',
205   'The Borg Collective', 'manual'),
206]
207
208# The name of an image file (relative to this directory) to place at the top of
209# the title page.
210latex_logo = '_static/logo.pdf'
211
212latex_elements = {
213    'papersize': 'a4paper',
214    'pointsize': '10pt',
215    'figure_align': 'H',
216}
217
218# For "manual" documents, if this is true, then toplevel headings are parts,
219# not chapters.
220#latex_use_parts = False
221
222# If true, show page references after internal links.
223#latex_show_pagerefs = False
224
225# If true, show URL addresses after external links.
226latex_show_urls = 'footnote'
227
228# Additional stuff for the LaTeX preamble.
229#latex_preamble = ''
230
231# Documents to append as an appendix to all manuals.
232latex_appendices = [
233    'support',
234    'resources',
235    'changes',
236    'authors',
237]
238
239# If false, no module index is generated.
240#latex_domain_indices = True
241
242
243# -- Options for manual page output --------------------------------------------
244
245# One entry per manual page. List of tuples
246# (source start file, name, description, authors, manual section).
247man_pages = [
248        ('usage', 'borg',
249         'BorgBackup is a deduplicating backup program with optional compression and authenticated encryption.',
250         ['The Borg Collective (see AUTHORS file)'],
251         1),
252]
253
254extensions = [
255    'sphinx.ext.extlinks',
256    'sphinx.ext.autodoc',
257    'sphinx.ext.todo',
258    'sphinx.ext.coverage',
259    'sphinx.ext.viewcode',
260]
261
262extlinks = {
263    'issue': ('https://github.com/borgbackup/borg/issues/%s', '#'),
264    'targz_url': ('https://pypi.python.org/packages/source/b/borgbackup/%%s-%s.tar.gz' % version, None),
265}
266