conf.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # pylint: skip-file
  2. #
  3. # Configuration file for the Sphinx documentation builder.
  4. #
  5. # This file does only contain a selection of the most common options. For a
  6. # full list see the documentation:
  7. # http://www.sphinx-doc.org/en/master/config
  8. # -- Path setup --------------------------------------------------------------
  9. # If extensions (or modules to document with autodoc) are in another directory,
  10. # add these directories to sys.path here. If the directory is relative to the
  11. # documentation root, use os.path.abspath to make it absolute, like shown here.
  12. #
  13. # import os
  14. # import sys
  15. # sys.path.insert(0, os.path.abspath('.'))
  16. import collections
  17. import pathlib
  18. import subprocess
  19. import recommonmark.parser
  20. # -- Project information -----------------------------------------------------
  21. project = 'Graphene'
  22. copyright = '2019, Graphene Contributors'
  23. author = 'Graphene Contributors'
  24. # The short X.Y version
  25. version = ''
  26. # The full version, including alpha/beta/rc tags
  27. release = ''
  28. # -- General configuration ---------------------------------------------------
  29. # If your documentation needs a minimal Sphinx version, state it here.
  30. #
  31. # needs_sphinx = '1.0'
  32. # Add any Sphinx extension module names here, as strings. They can be
  33. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  34. # ones.
  35. extensions = [
  36. 'sphinx.ext.autodoc',
  37. 'sphinx.ext.todo',
  38. 'breathe',
  39. 'recommonmark',
  40. 'sphinx_rtd_theme',
  41. ]
  42. # Add any paths that contain templates here, relative to this directory.
  43. templates_path = ['_templates']
  44. # The suffix(es) of source filenames.
  45. source_suffix = {
  46. '.rst': 'restructuredtext',
  47. '.md': 'markdown',
  48. '.markdown': 'markdown',
  49. }
  50. # The master toctree document.
  51. master_doc = 'index'
  52. # The language for content autogenerated by Sphinx. Refer to documentation
  53. # for a list of supported languages.
  54. #
  55. # This is also used if you do content translation via gettext catalogs.
  56. # Usually you set "language" from the command line for these cases.
  57. language = None
  58. # List of patterns, relative to source directory, that match files and
  59. # directories to ignore when looking for source files.
  60. # This pattern also affects html_static_path and html_extra_path.
  61. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  62. # The name of the Pygments (syntax highlighting) style to use.
  63. pygments_style = None
  64. rst_prolog = '''
  65. .. |nbsp| unicode:: 0xa0
  66. :trim:
  67. '''
  68. breathe_default_project = 'graphene'
  69. breathe_projects = {breathe_default_project: '_build/doxygen/xml'}
  70. def generate_doxygen(app):
  71. subprocess.check_call(['doxygen', 'Doxyfile'])
  72. def setup(app):
  73. app.connect('builder-inited', generate_doxygen)
  74. todo_include_todos = True
  75. # -- Options for HTML output -------------------------------------------------
  76. # The theme to use for HTML and HTML Help pages. See the documentation for
  77. # a list of builtin themes.
  78. #
  79. html_theme = 'sphinx_rtd_theme'
  80. # Theme options are theme-specific and customize the look and feel of a theme
  81. # further. For a list of options available for each theme, see the
  82. # documentation.
  83. #
  84. # html_theme_options = {}
  85. # Add any paths that contain custom static files (such as style sheets) here,
  86. # relative to this directory. They are copied after the builtin static files,
  87. # so a file named "default.css" will overwrite the builtin "default.css".
  88. html_static_path = ['_static']
  89. # Custom sidebar templates, must be a dictionary that maps document names
  90. # to template names.
  91. #
  92. # The default sidebars (for documents that don't match any pattern) are
  93. # defined by theme itself. Builtin themes are using these templates by
  94. # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
  95. # 'searchbox.html']``.
  96. #
  97. # html_sidebars = {}
  98. # -- Options for manual page output ------------------------------------------
  99. # One entry per manual page. List of tuples
  100. # (source start file, name, description, authors, manual section).
  101. man_pages = [
  102. ('manpages/pal_loader', 'pal_loader', 'FIXME Loader', [author], 1),
  103. ]
  104. # barf if a page is not included
  105. assert (collections.Counter(str(p.with_suffix(''))
  106. for p in pathlib.Path().glob('manpages/*.rst')
  107. if not p.stem == 'index')
  108. == collections.Counter(source
  109. for source, *_ in man_pages))