|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# For the full list of built-in configuration values, see the documentation: |
| 4 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 | + |
| 6 | +import importlib.metadata as importlib_metadata |
| 7 | +import time |
| 8 | + |
| 9 | +# -- Project information ----------------------------------------------------- |
| 10 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 11 | + |
| 12 | +distribution = importlib_metadata.distribution("causica") |
| 13 | + |
| 14 | +project = distribution.metadata["Name"] |
| 15 | +author = distribution.metadata["Author"] or "Microsoft Research - Causica" |
| 16 | +copyright = f"{time.strftime('%Y')}, {author} and contributors" # pylint: disable=redefined-builtin |
| 17 | + |
| 18 | +# The version info for the project you"re documenting, acts as replacement for |
| 19 | +# |version| and |release|, also used in various other places throughout the |
| 20 | +# built documents. |
| 21 | +# |
| 22 | +# The short X.Y version. |
| 23 | +version = distribution.version |
| 24 | +# The full version, including alpha/beta/rc tags. |
| 25 | +release = version |
| 26 | + |
| 27 | +# -- General configuration --------------------------------------------------- |
| 28 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 29 | +# this helped: |
| 30 | +# https://stackoverflow.com/questions/2701998/automatically-document-all-modules-recursively-with-sphinx-autodoc |
| 31 | +extensions = [ |
| 32 | + "sphinx.ext.autodoc", |
| 33 | + "sphinx.ext.coverage", |
| 34 | + "sphinx.ext.githubpages", |
| 35 | + "sphinx.ext.mathjax", |
| 36 | + "sphinx.ext.napoleon", |
| 37 | + "sphinx.ext.viewcode", |
| 38 | + "autoapi.extension", |
| 39 | + "myst_parser", |
| 40 | + "numpydoc", |
| 41 | + "sphinx_immaterial", |
| 42 | +] |
| 43 | + |
| 44 | +templates_path = ["templates"] |
| 45 | +exclude_patterns = ["Thumbs.db", ".DS_Store"] |
| 46 | +autoapi_dirs = ["../../src/causica/"] |
| 47 | +autoapi_template_dir = "templates/autoapi" |
| 48 | + |
| 49 | +# Napoleon settings |
| 50 | +napoleon_google_docstring = True |
| 51 | +napoleon_numpy_docstring = True |
| 52 | +napoleon_include_init_with_doc = True |
| 53 | +napoleon_include_private_with_doc = True |
| 54 | +napoleon_include_special_with_doc = True |
| 55 | +napoleon_use_admonition_for_examples = False |
| 56 | +napoleon_use_admonition_for_notes = False |
| 57 | +napoleon_use_admonition_for_references = False |
| 58 | +napoleon_use_ivar = False |
| 59 | +napoleon_use_param = True |
| 60 | +napoleon_use_rtype = True |
| 61 | + |
| 62 | +# The name of the Pygments (syntax highlighting) style to use. |
| 63 | +pygments_style = "sphinx" |
| 64 | + |
| 65 | +# -- Options for HTML output ------------------------------------------------- |
| 66 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 67 | + |
| 68 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 69 | +# a list of builtin themes. |
| 70 | +html_theme = "sphinx_immaterial" |
| 71 | +html_static_path = ["static"] |
| 72 | + |
| 73 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 74 | +# further. For a list of options available for each theme, see the |
| 75 | +# documentation. |
| 76 | +html_theme_options = { |
| 77 | + "features": [ |
| 78 | + "navigation.sections", |
| 79 | + "navigation.instant", |
| 80 | + "navigation.path", |
| 81 | + "navigation.prune", |
| 82 | + ], |
| 83 | + "globaltoc_collapse": False, |
| 84 | + "repo_url": "https://github.com/microsoft/causica", |
| 85 | + "repo_name": "causica", |
| 86 | + "edit_uri": "edit/master/doc", |
| 87 | + "palette": [ |
| 88 | + { |
| 89 | + "media": "(prefers-color-scheme: light)", |
| 90 | + "scheme": "default", |
| 91 | + "primary": "red", |
| 92 | + "accent": "light-blue", |
| 93 | + "toggle": { |
| 94 | + "icon": "material/lightbulb-outline", |
| 95 | + "name": "Switch to dark mode", |
| 96 | + }, |
| 97 | + }, |
| 98 | + { |
| 99 | + "media": "(prefers-color-scheme: dark)", |
| 100 | + "scheme": "slate", |
| 101 | + "primary": "red", |
| 102 | + "accent": "orange", |
| 103 | + "toggle": { |
| 104 | + "icon": "material/lightbulb", |
| 105 | + "name": "Switch to light mode", |
| 106 | + }, |
| 107 | + }, |
| 108 | + ], |
| 109 | + "toc_title_is_page_title": True, |
| 110 | + "version_dropdown": True, |
| 111 | + "version_json": "../im_versions.json", |
| 112 | +} |
| 113 | + |
| 114 | +# The master toctree document. |
| 115 | +master_doc = "index" |
0 commit comments