| 1 | """Configuration file for the Sphinx documentation builder.""" |
| 2 | # This file only contains a selection of the most common options. For a full |
| 3 | # list see the documentation: |
| 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 | |
| 6 | import sys |
| 7 | from importlib.metadata import version as meta_version |
| 8 | from pathlib import Path |
| 9 | |
| 10 | import sphinx_rtd_theme # noqa: F401 |
| 11 | |
| 12 | # -- Path setup -------------------------------------------------------------- |
| 13 | |
| 14 | # If extensions (or modules to document with autodoc) are in another directory, |
| 15 | # add these directories to sys.path here. If the directory is relative to the |
| 16 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 17 | # |
| 18 | # import os |
| 19 | # import sys |
| 20 | # sys.path.insert(0, os.path.abspath('.')) |
| 21 | |
| 22 | sys.path.insert(0, Path(__file__).resolve().parent.parent) |
| 23 | |
| 24 | # -- Project information ----------------------------------------------------- |
| 25 | |
| 26 | project = 'gjson' |
| 27 | title = f'{project} Documentation' |
| 28 | copyright = '2022, Riccardo Coccioli' |
| 29 | author = 'Riccardo Coccioli' |
| 30 | |
| 31 | # The version info for the project you're documenting, acts as replacement for |
| 32 | # |version| and |release|, also used in various other places throughout the |
| 33 | # built documents. |
| 34 | # |
| 35 | # The full version, including alpha/beta/rc tags. |
| 36 | release = meta_version('gjson') |
| 37 | # The short X.Y version. |
| 38 | version = release |
| 39 | |
| 40 | # -- General configuration --------------------------------------------------- |
| 41 | |
| 42 | # Add any Sphinx extension module names here, as strings. They can be |
| 43 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 44 | # ones. |
| 45 | extensions = [ |
| 46 | 'sphinx.ext.autodoc', |
| 47 | 'sphinx.ext.napoleon', |
| 48 | 'sphinx.ext.intersphinx', |
| 49 | 'sphinx.ext.todo', |
| 50 | 'sphinx.ext.coverage', |
| 51 | 'sphinx.ext.viewcode', |
| 52 | 'sphinxarg.ext', |
| 53 | 'sphinx_autodoc_typehints', |
| 54 | ] |
| 55 | |
| 56 | # Add any paths that contain templates here, relative to this directory. |
| 57 | templates_path = ['_templates'] |
| 58 | |
| 59 | # List of patterns, relative to source directory, that match files and |
| 60 | # directories to ignore when looking for source files. |
| 61 | # This pattern also affects html_static_path and html_extra_path. |
| 62 | exclude_patterns = [] |
| 63 | |
| 64 | # -- Options for manual page output --------------------------------------- |
| 65 | |
| 66 | # One entry per manual page. List of tuples |
| 67 | # (source start file, name, description, authors, manual section). |
| 68 | man_pages = [ |
| 69 | ('cli', 'gjson', 'filter and extract data from JSON-like files', [author], 1), |
| 70 | ] |
| 71 | |
| 72 | # -- Options for HTML output ------------------------------------------------- |
| 73 | |
| 74 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 75 | # a list of builtin themes. |
| 76 | # |
| 77 | html_theme = 'sphinx_rtd_theme' |
| 78 | |
| 79 | # Add any paths that contain custom static files (such as style sheets) here, |
| 80 | # relative to this directory. They are copied after the builtin static files, |
| 81 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 82 | html_static_path = [] |
| 83 | |
| 84 | intersphinx_mapping = { |
| 85 | 'python': ('https://docs.python.org/3/', None), |
| 86 | } |
| 87 | |
| 88 | # Napoleon settings |
| 89 | napoleon_google_docstring = True |
| 90 | napoleon_numpy_docstring = False |
| 91 | napoleon_include_init_with_doc = False |
| 92 | napoleon_include_private_with_doc = False |
| 93 | napoleon_include_special_with_doc = False |
| 94 | napoleon_use_admonition_for_examples = False |
| 95 | napoleon_use_admonition_for_notes = False |
| 96 | napoleon_use_admonition_for_references = False |
| 97 | napoleon_use_ivar = False |
| 98 | napoleon_use_param = True |
| 99 | napoleon_use_keyword = True |
| 100 | napoleon_use_rtype = True |
| 101 | napoleon_type_aliases = None |
| 102 | napoleon_attr_annotations = True |
| 103 | |
| 104 | |
| 105 | # Autodoc settings |
| 106 | autodoc_default_options = { |
| 107 | # Using None as value instead of True to support the version of Sphinx used in Buster |
| 108 | 'members': None, |
| 109 | 'member-order': 'bysource', |
| 110 | 'show-inheritance': None, |
| 111 | 'special-members': '__str__,__version__,__call__', |
| 112 | } |
| 113 | autoclass_content = 'both' |
| 114 |