2
0

conf.py 8.2 KB

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