conf.py 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. # -*- coding: utf-8 -*-
  2. # This file is dual licensed under the terms of the Apache License, Version
  3. # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  4. # for complete details.
  5. #
  6. # Cryptography documentation build configuration file, created by
  7. # sphinx-quickstart on Tue Aug 6 19:19:14 2013.
  8. #
  9. # This file is execfile()d with the current directory set to its containing dir
  10. #
  11. # Note that not all possible configuration values are present in this
  12. # autogenerated file.
  13. #
  14. # All configuration values have a default; values that are commented out
  15. # serve to show the default.
  16. from __future__ import absolute_import, division, print_function
  17. import os
  18. import sys
  19. try:
  20. import sphinx_rtd_theme
  21. except ImportError:
  22. sphinx_rtd_theme = None
  23. try:
  24. from sphinxcontrib import spelling
  25. except ImportError:
  26. spelling = None
  27. # If extensions (or modules to document with autodoc) are in another directory,
  28. # add these directories to sys.path here. If the directory is relative to the
  29. # documentation root, use os.path.abspath to make it absolute, like shown here.
  30. sys.path.insert(0, os.path.abspath("."))
  31. # -- General configuration ----------------------------------------------------
  32. # If your documentation needs a minimal Sphinx version, state it here.
  33. # needs_sphinx = '1.0'
  34. # Add any Sphinx extension module names here, as strings. They can be
  35. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  36. extensions = [
  37. "sphinx.ext.autodoc",
  38. "sphinx.ext.doctest",
  39. "sphinx.ext.intersphinx",
  40. "sphinx.ext.viewcode",
  41. "cryptography-docs",
  42. ]
  43. if spelling is not None:
  44. extensions.append("sphinxcontrib.spelling")
  45. # Add any paths that contain templates here, relative to this directory.
  46. templates_path = ["_templates"]
  47. nitpicky = True
  48. # The suffix of source filenames.
  49. source_suffix = ".rst"
  50. # The encoding of source files.
  51. # source_encoding = 'utf-8-sig'
  52. # The master toctree document.
  53. master_doc = "index"
  54. # General information about the project.
  55. project = "Cryptography"
  56. copyright = "2013-2021, Individual Contributors"
  57. # The version info for the project you're documenting, acts as replacement for
  58. # |version| and |release|, also used in various other places throughout the
  59. # built documents.
  60. #
  61. base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
  62. about = {}
  63. with open(os.path.join(base_dir, "src", "cryptography", "__about__.py")) as f:
  64. exec (f.read(), about)
  65. version = release = about["__version__"]
  66. # The language for content autogenerated by Sphinx. Refer to documentation
  67. # for a list of supported languages.
  68. # language = None
  69. # There are two options for replacing |today|: either, you set today to some
  70. # non-false value, then it is used:
  71. # today = ''
  72. # Else, today_fmt is used as the format for a strftime call.
  73. # today_fmt = '%B %d, %Y'
  74. # List of patterns, relative to source directory, that match files and
  75. # directories to ignore when looking for source files.
  76. exclude_patterns = ["_build"]
  77. # The reST default role (used for this markup: `text`) to use for all documents
  78. # default_role = None
  79. # If true, '()' will be appended to :func: etc. cross-reference text.
  80. # add_function_parentheses = True
  81. # If true, the current module name will be prepended to all description
  82. # unit titles (such as .. function::).
  83. # add_module_names = True
  84. # If true, sectionauthor and moduleauthor directives will be shown in the
  85. # output. They are ignored by default.
  86. # show_authors = False
  87. # The name of the Pygments (syntax highlighting) style to use.
  88. pygments_style = "sphinx"
  89. # -- Options for HTML output --------------------------------------------------
  90. # The theme to use for HTML and HTML Help pages. See the documentation for
  91. # a list of builtin themes.
  92. if sphinx_rtd_theme:
  93. html_theme = "sphinx_rtd_theme"
  94. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  95. else:
  96. html_theme = "default"
  97. # Add any paths that contain custom static files (such as style sheets) here,
  98. # relative to this directory. They are copied after the builtin static files,
  99. # so a file named "default.css" will overwrite the builtin "default.css".
  100. html_static_path = ["_static"]
  101. # Output file base name for HTML help builder.
  102. htmlhelp_basename = "Cryptographydoc"
  103. # -- Options for LaTeX output -------------------------------------------------
  104. latex_elements = {}
  105. # Grouping the document tree into LaTeX files. List of tuples
  106. # (source start file, target name, title, author, documentclass [howto/manual])
  107. latex_documents = [
  108. (
  109. "index",
  110. "Cryptography.tex",
  111. "Cryptography Documentation",
  112. "Individual Contributors",
  113. "manual",
  114. ),
  115. ]
  116. # -- Options for manual page output -------------------------------------------
  117. # One entry per manual page. List of tuples
  118. # (source start file, name, description, authors, manual section).
  119. man_pages = [
  120. (
  121. "index",
  122. "cryptography",
  123. "Cryptography Documentation",
  124. ["Individual Contributors"],
  125. 1,
  126. )
  127. ]
  128. # -- Options for Texinfo output -----------------------------------------------
  129. # Grouping the document tree into Texinfo files. List of tuples
  130. # (source start file, target name, title, author,
  131. # dir menu entry, description, category)
  132. texinfo_documents = [
  133. (
  134. "index",
  135. "Cryptography",
  136. "Cryptography Documentation",
  137. "Individual Contributors",
  138. "Cryptography",
  139. "One line description of project.",
  140. "Miscellaneous",
  141. ),
  142. ]
  143. # Example configuration for intersphinx: refer to the Python standard library.
  144. intersphinx_mapping = {"https://docs.python.org/3": None}
  145. epub_theme = "epub"
  146. # Retry requests in the linkcheck builder so that we're resillient against
  147. # transient network errors.
  148. linkcheck_retries = 10
  149. linkcheck_timeout = 5
  150. linkcheck_ignore = [
  151. # Small DH key results in a TLS failure on modern OpenSSL
  152. r"https://info.isl.ntt.co.jp/crypt/eng/camellia/",
  153. # Inconsistent small DH params they seem incapable of fixing
  154. r"https://www.secg.org/sec1-v2.pdf",
  155. ]