conf.py 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. # -*- coding: utf-8 -*-
  2. """
  3. libpqxx documentation build configuration file, created by
  4. sphinx-quickstart on Sun Dec 3 00:43:33 2017.
  5. This file is execfile()d with the current directory set to its containing dir.
  6. All configuration values have a default; values that are commented out serve
  7. to show the default.
  8. """
  9. import codecs
  10. import os
  11. from subprocess import check_call
  12. # If extensions (or modules to document with autodoc) are in another directory,
  13. # add these directories to sys.path here. If the directory is relative to the
  14. # documentation root, use os.path.abspath to make it absolute, like shown here.
  15. #
  16. # import sys
  17. # sys.path.insert(0, os.path.abspath(os.path.curdir))
  18. read_the_docs_build = os.environ.get('READTHEDOCS') == 'True'
  19. if read_the_docs_build:
  20. check_call(
  21. [os.path.join(os.path.curdir, 'configure'), 'CXXFLAGS=-std=c++17 -O0'],
  22. cwd=os.path.pardir)
  23. check_call('doxygen', cwd=os.path.join(os.path.pardir, 'doc'))
  24. # -- General configuration ------------------------------------------------
  25. # If your documentation needs a minimal Sphinx version, state it here.
  26. #
  27. # needs_sphinx = '1.0'
  28. # Add any Sphinx extension module names here, as strings. They can be
  29. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  30. # ones.
  31. extensions = [
  32. 'sphinx.ext.autodoc',
  33. 'sphinx.ext.doctest',
  34. ]
  35. # Add any paths that contain templates here, relative to this directory.
  36. templates_path = ['_templates']
  37. # The suffix(es) of source filenames.
  38. # You can specify multiple suffix as a list of string:
  39. #
  40. # source_suffix = ['.rst', '.md']
  41. source_suffix = '.rst'
  42. # The master toctree document.
  43. master_doc = 'index'
  44. # General information about the project.
  45. project = u'libpqxx'
  46. copyright = u'2000-2022, Jeroen T. Vermeulen'
  47. author = u'Jeroen T. Vermeulen'
  48. def read_version():
  49. """Return version number as specified in the VERSION file."""
  50. version_file = os.path.join(
  51. os.path.dirname(__file__), os.path.pardir, 'VERSION')
  52. with codecs.open(version_file, encoding='ascii') as stream:
  53. return stream.read().strip()
  54. # The version info for the project you're documenting, acts as replacement for
  55. # |version| and |release|, also used in various other places throughout the
  56. # built documents.
  57. #
  58. # The full version, including alpha/beta/rc tags.
  59. release = read_version()
  60. # The short X.Y version.
  61. version = '.'.join(release.split('.')[:2])
  62. html_title = "libpqxx %s" % release
  63. html_short_title = "libpqxx"
  64. # The language for content autogenerated by Sphinx. Refer to documentation
  65. # for a list of supported languages.
  66. #
  67. # This is also used if you do content translation via gettext catalogs.
  68. # Usually you set "language" from the command line for these cases.
  69. language = None
  70. # List of patterns, relative to source directory, that match files and
  71. # directories to ignore when looking for source files.
  72. # This patterns also effect to html_static_path and html_extra_path
  73. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  74. # The name of the Pygments (syntax highlighting) style to use.
  75. pygments_style = 'sphinx'
  76. # If true, `todo` and `todoList` produce output, else they produce nothing.
  77. todo_include_todos = False
  78. # -- Options for HTML output ----------------------------------------------
  79. # The theme to use for HTML and HTML Help pages. See the documentation for
  80. # a list of builtin themes.
  81. #
  82. html_theme = 'alabaster'
  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. #
  87. # html_theme_options = {}
  88. # Add any paths that contain custom static files (such as style sheets) here,
  89. # relative to this directory. They are copied after the builtin static files,
  90. # so a file named "default.css" will overwrite the builtin "default.css".
  91. html_static_path = ['_static']
  92. # Custom sidebar templates, must be a dictionary that maps document names
  93. # to template names.
  94. #
  95. # This is required for the alabaster theme
  96. # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
  97. html_sidebars = {
  98. '**': [
  99. 'relations.html', # needs 'show_related': True theme option to display
  100. 'searchbox.html',
  101. ]
  102. }
  103. # Looks like the setup is that our build generates the HTML itself, and then
  104. # has readthedocs copy the full generated HTML tree to the output directory.
  105. #
  106. # Problem is, that doesn't seem to be working now. This needs debugging.
  107. html_extra_path = ["html"]
  108. # -- Options for HTMLHelp output ------------------------------------------
  109. # Output file base name for HTML help builder.
  110. htmlhelp_basename = 'libpqxxdoc'
  111. # -- Options for LaTeX output ---------------------------------------------
  112. latex_elements = {
  113. # The paper size ('letterpaper' or 'a4paper').
  114. #
  115. # 'papersize': 'letterpaper',
  116. # The font size ('10pt', '11pt' or '12pt').
  117. #
  118. # 'pointsize': '10pt',
  119. # Additional stuff for the LaTeX preamble.
  120. #
  121. # 'preamble': '',
  122. # Latex figure (float) alignment
  123. #
  124. # 'figure_align': 'htbp',
  125. }
  126. # Grouping the document tree into LaTeX files. List of tuples
  127. # (source start file, target name, title,
  128. # author, documentclass [howto, manual, or own class]).
  129. latex_documents = [
  130. (
  131. master_doc,
  132. 'libpqxx.tex',
  133. u'libpqxx Documentation',
  134. u'Jeroen T. Vermeulen',
  135. 'manual',
  136. ),
  137. ]
  138. # -- Options for manual page output ---------------------------------------
  139. # One entry per manual page. List of tuples
  140. # (source start file, name, description, authors, manual section).
  141. man_pages = [
  142. (master_doc, 'libpqxx', u'libpqxx Documentation', [author], 1)
  143. ]
  144. # -- Options for Texinfo output -------------------------------------------
  145. # Grouping the document tree into Texinfo files. List of tuples
  146. # (source start file, target name, title, author,
  147. # dir menu entry, description, category)
  148. texinfo_documents = [
  149. (master_doc, 'libpqxx', u'libpqxx Documentation',
  150. author, 'libpqxx', "C++ client API for PostgreSQL.",
  151. 'Miscellaneous'),
  152. ]