|
| 1 | +# -*- coding: utf-8 -*- |
| 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 | + |
| 9 | +# -- Path setup -------------------------------------------------------------- |
| 10 | + |
| 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 | + |
| 15 | +import os |
| 16 | +import sys |
| 17 | + |
| 18 | +sys.path.insert(0, os.path.abspath('..')) |
| 19 | + |
| 20 | + |
| 21 | +# -- Project information ----------------------------------------------------- |
| 22 | + |
| 23 | +def _get_project_meta(): |
| 24 | + import tomlkit # noqa: WPS433 |
| 25 | + |
| 26 | + with open('../pyproject.toml') as pyproject: |
| 27 | + file_contents = pyproject.read() |
| 28 | + |
| 29 | + return tomlkit.parse(file_contents)['tool']['poetry'] |
| 30 | + |
| 31 | + |
| 32 | +pkg_meta = _get_project_meta() |
| 33 | +project = pkg_meta['name'] |
| 34 | +copyright = '2019, dry-python team' # noqa: A001 |
| 35 | +author = 'dry-python team' |
| 36 | + |
| 37 | +# The short X.Y version |
| 38 | +version = pkg_meta['version'] |
| 39 | +# The full version, including alpha/beta/rc tags |
| 40 | +release = version |
| 41 | + |
| 42 | + |
| 43 | +# -- General configuration --------------------------------------------------- |
| 44 | + |
| 45 | +# Add any Sphinx extension module names here, as strings. They can be |
| 46 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 47 | +# ones. |
| 48 | +extensions = [ |
| 49 | + 'sphinx.ext.autodoc', |
| 50 | + 'sphinx.ext.doctest', |
| 51 | + 'sphinx.ext.todo', |
| 52 | + 'sphinx.ext.coverage', |
| 53 | + 'sphinx.ext.viewcode', |
| 54 | + 'sphinx.ext.autosummary', |
| 55 | + 'sphinx.ext.napoleon', |
| 56 | + |
| 57 | + # Used to include .md files: |
| 58 | + 'm2r', |
| 59 | + |
| 60 | + # Used to insert typehints into the final docs: |
| 61 | + 'sphinx_autodoc_typehints', |
| 62 | + |
| 63 | + # Used to build graphs: |
| 64 | + 'sphinxcontrib.mermaid', |
| 65 | +] |
| 66 | + |
| 67 | +autoclass_content = 'class' |
| 68 | +autodoc_member_order = 'bysource' |
| 69 | + |
| 70 | +autodoc_member_order = 'bysource' |
| 71 | +autodoc_default_flags = { |
| 72 | + 'members': '', |
| 73 | + 'undoc-members': 'code,error_template', |
| 74 | + 'exclude-members': '__dict__,__weakref__', |
| 75 | +} |
| 76 | + |
| 77 | +# Set `typing.TYPE_CHECKING` to `True`: |
| 78 | +# https://pypi.org/project/sphinx-autodoc-typehints/ |
| 79 | +set_type_checking_flag = False |
| 80 | + |
| 81 | +# Add any paths that contain templates here, relative to this directory. |
| 82 | +templates_path = ['_templates'] |
| 83 | + |
| 84 | +# The suffix(es) of source filenames. |
| 85 | +# You can specify multiple suffix as a list of string: |
| 86 | + |
| 87 | +source_suffix = ['.rst', '.md'] |
| 88 | + |
| 89 | +# The master toctree document. |
| 90 | +master_doc = 'index' |
| 91 | + |
| 92 | +# The language for content autogenerated by Sphinx. Refer to documentation |
| 93 | +# for a list of supported languages. |
| 94 | +# |
| 95 | +# This is also used if you do content translation via gettext catalogs. |
| 96 | +# Usually you set "language" from the command line for these cases. |
| 97 | +language = None |
| 98 | + |
| 99 | +# List of patterns, relative to source directory, that match files and |
| 100 | +# directories to ignore when looking for source files. |
| 101 | +# This pattern also affects html_static_path and html_extra_path . |
| 102 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 103 | + |
| 104 | +# The name of the Pygments (syntax highlighting) style to use. |
| 105 | +pygments_style = 'sphinx' |
| 106 | + |
| 107 | +add_module_names = False |
| 108 | + |
| 109 | +autodoc_default_options = { |
| 110 | + 'show-inheritance': True, |
| 111 | +} |
| 112 | + |
| 113 | + |
| 114 | +# -- Options for HTML output ------------------------------------------------- |
| 115 | + |
| 116 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 117 | +# a list of builtin themes. |
| 118 | +# |
| 119 | +html_theme = 'sphinx_typlog_theme' |
| 120 | + |
| 121 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 122 | +# further. For a list of options available for each theme, see the |
| 123 | +# documentation. |
| 124 | +html_theme_options = { |
| 125 | + 'logo_name': 'classes', |
| 126 | + 'description': ( |
| 127 | + 'Make your functions return something meaningful, typed, and safe!' |
| 128 | + ), |
| 129 | + 'github_user': 'dry-python', |
| 130 | + 'github_repo': 'classes', |
| 131 | +} |
| 132 | + |
| 133 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 134 | +# relative to this directory. They are copied after the builtin static files, |
| 135 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 136 | +html_static_path = ['_static'] |
| 137 | + |
| 138 | +# Custom sidebar templates, must be a dictionary that maps document names |
| 139 | +# to template names. |
| 140 | +html_sidebars = { |
| 141 | + '**': [ |
| 142 | + 'logo.html', |
| 143 | + 'globaltoc.html', |
| 144 | + 'github.html', |
| 145 | + 'searchbox.html', |
| 146 | + 'moreinfo.html', |
| 147 | + ], |
| 148 | +} |
| 149 | + |
| 150 | + |
| 151 | +# -- Extension configuration ------------------------------------------------- |
| 152 | + |
| 153 | +napoleon_numpy_docstring = False |
| 154 | + |
| 155 | +# -- Options for todo extension ---------------------------------------------- |
| 156 | + |
| 157 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
| 158 | +todo_include_todos = True |
0 commit comments