|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# This file contains an opinionated list of extensions and configuration options |
| 4 | +# used by the PyBaMM documentation. |
| 5 | +# |
| 6 | +# For a full list, see the Sphinx documentation for configuration options at |
| 7 | +# https://www.sphinx-doc.org/en/master/config |
| 8 | +# |
| 9 | +# More information about the configuration options used here can be found in the |
| 10 | +# configuration file for the PyBaMM documentation at |
| 11 | +# https://github.com/pybamm-team/PyBaMM/blob/develop/docs/conf.py |
| 12 | +# |
| 13 | +# The configuration options to adjust the PyData Sphinx Theme with can be found at |
| 14 | +# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/index.html |
| 15 | + |
| 16 | + |
| 17 | +import os |
| 18 | +import sys |
1 | 19 | import importlib.metadata |
2 | 20 |
|
| 21 | + |
| 22 | +# ---- Project information ------------------------------------------------------------ |
| 23 | + |
3 | 24 | project = "{{ cookiecutter.project_name }}" |
4 | 25 | copyright = "{{ cookiecutter.__year }}, {{ cookiecutter.full_name }}" |
5 | 26 | author = "{{ cookiecutter.full_name }}" |
6 | 27 | version = release = importlib.metadata.version("{{ cookiecutter.__project_slug }}") |
7 | 28 |
|
| 29 | +# ---- Path configuration ------------------------------------------------------------- |
| 30 | + |
| 31 | +# Path for repository root |
| 32 | +sys.path.insert(0, os.path.abspath("../")) |
| 33 | + |
| 34 | +# Path for local Sphinx extensions |
| 35 | +sys.path.append(os.path.abspath("./sphinxext/")) |
| 36 | + |
| 37 | +# ---- General configuration ---------------------------------------------------------- |
| 38 | + |
| 39 | +# If your documentation needs a minimal Sphinx version, state it here. |
| 40 | + |
| 41 | +# needs_sphinx = '1.0' |
| 42 | + |
| 43 | +# The suffix(es) of source filenames. You may specify multiple suffixes as |
| 44 | +# a list of strings. |
| 45 | +source_suffix = [".rst", ".md"] |
| 46 | + |
| 47 | +# List of patterns relative to the source directory that match files and |
| 48 | +# directories to ignore when looking for source files. This pattern also |
| 49 | +# affects the html_static_path and html_extra_path configuration options. |
| 50 | +exclude_patterns = [ |
| 51 | + "_build", |
| 52 | + "**.ipynb_checkpoints", |
| 53 | + "Thumbs.db", |
| 54 | + ".DS_Store", |
| 55 | +] |
| 56 | + |
| 57 | +html_theme = "pydata_sphinx_theme" |
| 58 | +html_title = "%s v%s Manual" % (project, version) |
| 59 | +html_last_updated_fmt = "%Y-%m-%d" |
| 60 | +html_static_path = ["_static"] |
| 61 | +html_file_suffix = ".html" |
| 62 | + |
| 63 | +# Add any logos and favicons for your hosted documentation here. The logo and the favicon |
| 64 | +# should be placed in the html_static_path directory listed above. |
| 65 | +# html_logo = "_static/logo.png" |
| 66 | +# html_favicon = "_static/favicon.png" |
| 67 | + |
| 68 | +# Add any paths that contain custom static files (such as style sheets or JavaScript scripts) |
| 69 | +# in the html_static_path listed above. They are copied after the builtin static files, so a |
| 70 | +# file named "default.css" will overwrite the builtin "default.css". |
| 71 | +# html_css_files = ["custom.css"] |
| 72 | +# html_js_files = ["custom.js"] |
| 73 | + |
| 74 | +# Suppress any warnings generated by Sphinx and/or by Sphinx extensions as |
| 75 | +# a list of strings. The following warnings are suppressed by default: |
| 76 | +suppress_warnings = ["git.too_shallow"] |
| 77 | + |
| 78 | +# Add any paths that contain templates here, relative to this directory. |
| 79 | +templates_path = ["_templates"] |
| 80 | + |
| 81 | +# The language for content autogenerated by Sphinx. Refer to the Sphinx documentation |
| 82 | +# for a list of supported language codes according to the IETF BCP 47 standard. |
| 83 | +language = "en" |
| 84 | + |
| 85 | +# Add any Sphinx extension module names here in a list of strings. They can be |
| 86 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. The |
| 87 | +# custom ones must be placed under the path specified for local Sphinx extensions |
| 88 | +# in the system path configuration above. |
| 89 | + |
8 | 90 | extensions = [ |
9 | | - "myst_parser", |
| 91 | + # Sphinx extensions |
10 | 92 | "sphinx.ext.autodoc", |
11 | 93 | "sphinx.ext.intersphinx", |
12 | 94 | "sphinx.ext.mathjax", |
13 | 95 | "sphinx.ext.napoleon", |
| 96 | + # Local extensions under ./sphinxext/ |
| 97 | + # Third-party extensions |
| 98 | + "myst_parser", |
| 99 | + "sphinx_design", |
14 | 100 | "sphinx_copybutton", |
15 | 101 | "sphinx_inline_tabs", |
| 102 | + "sphinxcontrib.bibtex", |
| 103 | + "sphinx_last_updated_by_git", |
16 | 104 | "pydata_sphinx_theme", |
17 | | - "hoverxref.extension", |
18 | 105 | "nbsphinx", |
| 106 | + "IPython.sphinxext.ipython_console_highlighting", |
19 | 107 | ] |
20 | 108 |
|
21 | | -source_suffix = [".rst", ".md"] |
22 | | -exclude_patterns = [ |
23 | | - "_build", |
24 | | - "**.ipynb_checkpoints", |
25 | | - "Thumbs.db", |
26 | | - ".DS_Store", |
27 | | - ".env", |
28 | | - ".venv", |
29 | | -] |
| 109 | +# ---- Options for EPUB output -------------------------------------------------------- |
30 | 110 |
|
31 | | -html_theme = "pydata_sphinx_theme" |
| 111 | +# Bibliographic Dublin Core information |
| 112 | +epub_title = project |
| 113 | + |
| 114 | +# The unique identifier of the text. This can be a ISBN number or the project homepage |
| 115 | +# epub_identifier = '' |
| 116 | + |
| 117 | +# A unique identification for the text |
| 118 | +# epub_uid = '' |
| 119 | + |
| 120 | +# A list of files that should not be packed into the EPUB file |
| 121 | +epub_exclude_files = ["search.html"] |
| 122 | + |
| 123 | +# ---- HTML theme configuration ------------------------------------------------------- |
| 124 | + |
| 125 | +# Theme options are theme-specific and customize the look and feel of a theme further. |
| 126 | +# For a list of options available for each theme, see the documentation for the theme. |
| 127 | + |
| 128 | +# For a list of options available for the PyData Sphinx Theme, see the documentation at |
| 129 | +# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/index.html |
| 130 | + |
| 131 | +html_theme_options = { |
| 132 | + # "logo": { |
| 133 | + # "image_light": "logo.png", |
| 134 | + # "image_dark": "logo.png", |
| 135 | + # }, |
| 136 | + "icon_links": [ |
| 137 | + { |
| 138 | +{%- if cookiecutter.platform == "github" %} |
| 139 | + "name": "GitHub", |
| 140 | + "icon": "fa-brands fa-square-github", |
| 141 | +{%- elif cookiecutter.platform == "gitlab" %} |
| 142 | + "name": "GitLab", |
| 143 | + "icon": "fa-brands fa-square-gitlab", |
| 144 | +{%- endif %} |
| 145 | + "url": "{{ cookiecutter.url }}", |
| 146 | + }, |
| 147 | + { |
| 148 | + "name": "PyPI", |
| 149 | + "url": "https://pypi.org/project/{{ cookiecutter.project_name }}/", |
| 150 | + "icon": "fa-solid fa-box", |
| 151 | + }, |
| 152 | + ], |
| 153 | + "collapse_navigation": True, |
| 154 | + "navbar_end": ["theme-switcher", "navbar-icon-links"], |
| 155 | + "use_edit_page_button": True, |
| 156 | + "pygment_light_style": "xcode", |
| 157 | + "pygment_dark_style": "monokai", |
| 158 | + "footer_start": [ |
| 159 | + "copyright", |
| 160 | + "sphinx-version", |
| 161 | + ], |
| 162 | + "footer_end": [ |
| 163 | + "theme-version", |
| 164 | + "last-updated", |
| 165 | + ], |
| 166 | +} |
| 167 | + |
| 168 | +# ---- Extension configuration -------------------------------------------------------- |
| 169 | + |
| 170 | +# Add any configuration options for Sphinx extensions here as per the documentation for |
| 171 | +# each extension. See the PyBaMM documentation at |
| 172 | +# https://github.com/pybamm-team/PyBaMM/blob/develop/docs/conf.py for examples of how |
| 173 | +# to configure Sphinx extensions for your project. |
32 | 174 |
|
33 | 175 | myst_enable_extensions = [ |
34 | 176 | "colon_fence", |
|
43 | 185 | } |
44 | 186 |
|
45 | 187 | always_document_param_types = True |
| 188 | +napoleon_use_rtype = True |
| 189 | +napoleon_google_docstring = False |
0 commit comments