|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# This file only contains a selection of the most common options. For a full |
| 4 | +# list see the documentation: |
| 5 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 | + |
| 7 | +# -- Path setup -------------------------------------------------------------- |
| 8 | + |
| 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 | + |
| 16 | +sys.path.insert(0, os.path.abspath('.')) |
| 17 | + |
| 18 | + |
| 19 | +# -- Project information ----------------------------------------------------- |
| 20 | + |
| 21 | +def _get_project_meta(): |
| 22 | + import tomlkit # noqa: WPS433 |
| 23 | + |
| 24 | + with open('../pyproject.toml') as pyproject: |
| 25 | + file_contents = pyproject.read() |
| 26 | + |
| 27 | + return tomlkit.parse(file_contents)['tool']['poetry'] |
| 28 | + |
| 29 | + |
| 30 | +pkg_meta = _get_project_meta() |
| 31 | +project = 'lambdas' |
| 32 | +copyright = '2021, dry-python team' |
| 33 | +author = 'dry-python team' |
| 34 | + |
| 35 | +# The short X.Y version |
| 36 | +version = str(pkg_meta['version']) |
| 37 | +# The full version, including alpha/beta/rc tags |
| 38 | +release = version |
| 39 | + |
| 40 | + |
| 41 | +# -- General configuration --------------------------------------------------- |
| 42 | + |
| 43 | +# Add any Sphinx extension module names here, as strings. They can be |
| 44 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 45 | +# ones. |
| 46 | +extensions = [ |
| 47 | + 'sphinx.ext.autodoc', |
| 48 | + 'sphinx.ext.doctest', |
| 49 | + 'sphinx.ext.todo', |
| 50 | + 'sphinx.ext.coverage', |
| 51 | + 'sphinx.ext.viewcode', |
| 52 | + 'sphinx.ext.autosummary', |
| 53 | + 'sphinx.ext.napoleon', |
| 54 | + |
| 55 | + # Used to include .md files: |
| 56 | + 'm2r2', |
| 57 | + |
| 58 | + # Used to insert typehints into the final docs: |
| 59 | + 'sphinx_autodoc_typehints', |
| 60 | +] |
| 61 | + |
| 62 | +autoclass_content = 'class' |
| 63 | +autodoc_member_order = 'bysource' |
| 64 | + |
| 65 | +autodoc_default_options = { |
| 66 | + 'members': True, |
| 67 | + 'show-inheritance': True, |
| 68 | +} |
| 69 | + |
| 70 | +# Set `typing.TYPE_CHECKING` to `True`: |
| 71 | +# https://pypi.org/project/sphinx-autodoc-typehints/ |
| 72 | +set_type_checking_flag = False |
| 73 | +always_document_param_types = True |
| 74 | + |
| 75 | +# Add any paths that contain templates here, relative to this directory. |
| 76 | +templates_path = ['_templates'] |
| 77 | + |
| 78 | +# The suffix(es) of source filenames. |
| 79 | +# You can specify multiple suffix as a list of string: |
| 80 | +source_suffix = ['.rst', '.md'] |
| 81 | + |
| 82 | +# List of patterns, relative to source directory, that match files and |
| 83 | +# directories to ignore when looking for source files. |
| 84 | +# This pattern also affects html_static_path and html_extra_path. |
| 85 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 86 | + |
| 87 | +# The name of the Pygments (syntax highlighting) style to use. |
| 88 | +pygments_style = 'sphinx' |
| 89 | + |
| 90 | +add_module_names = False |
| 91 | + |
| 92 | +# -- Options for HTML output ------------------------------------------------- |
| 93 | + |
| 94 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 95 | +# a list of builtin themes. |
| 96 | +html_theme = 'sphinx_typlog_theme' |
| 97 | + |
| 98 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 99 | +# further. For a list of options available for each theme, see the |
| 100 | +# documentation. |
| 101 | +html_theme_options = { |
| 102 | + 'logo_name': 'lambdas', |
| 103 | + 'description': ( |
| 104 | + 'Write short and fully-typed lambdas where you need them.' |
| 105 | + ), |
| 106 | + 'github_user': 'dry-python', |
| 107 | + 'github_repo': 'lambdas', |
| 108 | + 'color': '#E8371A', |
| 109 | +} |
| 110 | + |
| 111 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 112 | +# relative to this directory. They are copied after the builtin static files, |
| 113 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 114 | +html_static_path = ['_static'] |
| 115 | + |
| 116 | +# Custom sidebar templates, must be a dictionary that maps document names |
| 117 | +# to template names. |
| 118 | +html_sidebars = { |
| 119 | + '**': [ |
| 120 | + 'logo.html', |
| 121 | + 'globaltoc.html', |
| 122 | + 'github.html', |
| 123 | + 'searchbox.html', |
| 124 | + 'moreinfo.html', |
| 125 | + ], |
| 126 | +} |
| 127 | + |
| 128 | +# -- Extension configuration ------------------------------------------------- |
| 129 | + |
| 130 | +napoleon_numpy_docstring = False |
| 131 | + |
| 132 | +# -- Options for todo extension ---------------------------------------------- |
| 133 | + |
| 134 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
| 135 | +todo_include_todos = True |
0 commit comments