conf.py 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. # -*- coding: utf-8 -*-
  2. # Protocol Buffers - Google's data interchange format
  3. # Copyright 2019 Google LLC. All rights reserved.
  4. # https://developers.google.com/protocol-buffers/
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are
  8. # met:
  9. #
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. # * Redistributions in binary form must reproduce the above
  13. # copyright notice, this list of conditions and the following disclaimer
  14. # in the documentation and/or other materials provided with the
  15. # distribution.
  16. # * Neither the name of Google Inc. nor the names of its
  17. # contributors may be used to endorse or promote products derived from
  18. # this software without specific prior written permission.
  19. #
  20. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. # Configuration file for the Sphinx documentation builder.
  32. #
  33. # This file does only contain a selection of the most common options. For a
  34. # full list see the documentation:
  35. # http://www.sphinx-doc.org/en/master/config
  36. # -- Path setup --------------------------------------------------------------
  37. # If extensions (or modules to document with autodoc) are in another directory,
  38. # add these directories to sys.path here. If the directory is relative to the
  39. # documentation root, use os.path.abspath to make it absolute, like shown here.
  40. #
  41. import os
  42. # import sys
  43. # sys.path.insert(0, os.path.abspath('.'))
  44. import google.protobuf
  45. # -- Project information -----------------------------------------------------
  46. project = u"Protocol Buffers"
  47. copyright = u"2008, Google LLC"
  48. author = u"Google LLC"
  49. # The short X.Y version
  50. version = u""
  51. # The full version, including alpha/beta/rc tags
  52. release = google.protobuf.__version__
  53. # -- General configuration ---------------------------------------------------
  54. # If your documentation needs a minimal Sphinx version, state it here.
  55. #
  56. # needs_sphinx = '1.0'
  57. # Add any Sphinx extension module names here, as strings. They can be
  58. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  59. # ones.
  60. extensions = [
  61. "sphinx.ext.autosummary",
  62. "sphinx.ext.ifconfig",
  63. "sphinx.ext.intersphinx",
  64. "sphinx.ext.napoleon",
  65. ]
  66. # Add any paths that contain templates here, relative to this directory.
  67. templates_path = ["_templates"]
  68. # The suffix(es) of source filenames.
  69. # You can specify multiple suffix as a list of string:
  70. #
  71. # source_suffix = ['.rst', '.md']
  72. source_suffix = ".rst"
  73. # The master toctree document.
  74. master_doc = "index"
  75. # The language for content autogenerated by Sphinx. Refer to documentation
  76. # for a list of supported languages.
  77. #
  78. # This is also used if you do content translation via gettext catalogs.
  79. # Usually you set "language" from the command line for these cases.
  80. language = None
  81. # List of patterns, relative to source directory, that match files and
  82. # directories to ignore when looking for source files.
  83. # This pattern also affects html_static_path and html_extra_path.
  84. exclude_patterns = [u"_build", "Thumbs.db", ".DS_Store"]
  85. # The name of the Pygments (syntax highlighting) style to use.
  86. pygments_style = None
  87. # -- Options for HTML output -------------------------------------------------
  88. # The theme to use for HTML and HTML Help pages. See the documentation for
  89. # a list of builtin themes.
  90. #
  91. html_theme = "alabaster"
  92. # Remove JavaScript.
  93. html_js_files = []
  94. # Theme options are theme-specific and customize the look and feel of a theme
  95. # further. For a list of options available for each theme, see the
  96. # documentation.
  97. #
  98. # html_theme_options = {}
  99. # Add any paths that contain custom static files (such as style sheets) here,
  100. # relative to this directory. They are copied after the builtin static files,
  101. # so a file named "default.css" will overwrite the builtin "default.css".
  102. html_static_path = ["_static"]
  103. html_show_sourcelink = True
  104. # Custom sidebar templates, must be a dictionary that maps document names
  105. # to template names.
  106. #
  107. # The default sidebars (for documents that don't match any pattern) are
  108. # defined by theme itself. Builtin themes are using these templates by
  109. # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
  110. # 'searchbox.html']``.
  111. # Remove searchbox.html to avoid embedded JavaScript.
  112. html_sidebars = {
  113. "**": [
  114. "globaltoc.html", "localtoc.html", "relations.html", "sourcelink.html",
  115. ],
  116. }
  117. # -- Options for HTMLHelp output ---------------------------------------------
  118. # Output file base name for HTML help builder.
  119. htmlhelp_basename = "ProtocolBuffersdoc"
  120. # -- Options for LaTeX output ------------------------------------------------
  121. latex_elements = {
  122. # The paper size ('letterpaper' or 'a4paper').
  123. #
  124. # 'papersize': 'letterpaper',
  125. # The font size ('10pt', '11pt' or '12pt').
  126. #
  127. # 'pointsize': '10pt',
  128. # Additional stuff for the LaTeX preamble.
  129. #
  130. # 'preamble': '',
  131. # Latex figure (float) alignment
  132. #
  133. # 'figure_align': 'htbp',
  134. }
  135. # Grouping the document tree into LaTeX files. List of tuples
  136. # (source start file, target name, title,
  137. # author, documentclass [howto, manual, or own class]).
  138. latex_documents = [
  139. (
  140. master_doc,
  141. "ProtocolBuffers.tex",
  142. "Protocol Buffers Documentation",
  143. "Google LLC",
  144. "manual",
  145. )
  146. ]
  147. # -- Options for manual page output ------------------------------------------
  148. # One entry per manual page. List of tuples
  149. # (source start file, name, description, authors, manual section).
  150. man_pages = [
  151. (
  152. master_doc, # source start file
  153. "protocolbuffers", # name
  154. "Protocol Buffers Documentation", # description
  155. [author], # authors
  156. 1, # manual section
  157. )
  158. ]
  159. # -- Options for Texinfo output ----------------------------------------------
  160. # Grouping the document tree into Texinfo files. List of tuples
  161. # (source start file, target name, title, author,
  162. # dir menu entry, description, category)
  163. texinfo_documents = [
  164. (
  165. master_doc,
  166. "ProtocolBuffers",
  167. u"Protocol Buffers Documentation",
  168. author,
  169. "ProtocolBuffers",
  170. "One line description of project.",
  171. "Miscellaneous",
  172. )
  173. ]
  174. # -- Options for Epub output -------------------------------------------------
  175. # Bibliographic Dublin Core info.
  176. epub_title = project
  177. # The unique identifier of the text. This can be a ISBN number
  178. # or the project homepage.
  179. #
  180. # epub_identifier = ''
  181. # A unique identification for the text.
  182. #
  183. # epub_uid = ''
  184. # A list of files that should not be packed into the epub file.
  185. epub_exclude_files = ["search.html"]
  186. # -- Extension configuration -------------------------------------------------
  187. # -- Options for autosummary extension ---------------------------------------
  188. autosummary_generate = True
  189. # -- Options for intersphinx extension ---------------------------------------
  190. # Example configuration for intersphinx: refer to the Python standard library.
  191. intersphinx_mapping = {"https://docs.python.org/": None}
  192. # -- Config values -----------------------------------------------------------
  193. # The setup() function is needed to add configuration values to the Sphinx
  194. # builder. We use this to show a banner when built on Read the Docs.
  195. # https://www.sphinx-doc.org/en/master/usage/extensions/ifconfig.html
  196. def setup(app):
  197. app.add_config_value(
  198. "build_env",
  199. # Read the Docs sets a READTHEDOCS environment during builds.
  200. # https://docs.readthedocs.io/en/stable/builds.html#build-environment
  201. "readthedocs" if os.getenv("READTHEDOCS") else "",
  202. "env"
  203. )