|
| 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 os |
| 7 | +import shutil |
| 8 | + |
| 9 | +import setuptools_scm |
| 10 | + |
| 11 | +# -- Copy over changelog ------------------------------------------------------ |
| 12 | +# Path to the project's root CHANGELOG.md |
| 13 | +changelog_src = os.path.abspath("../../CHANGELOG.md") |
| 14 | +changelog_dst = os.path.abspath("./changelog.md") |
| 15 | + |
| 16 | +# Copy CHANGELOG.md into the docs folder |
| 17 | +if os.path.exists(changelog_src): |
| 18 | + shutil.copy(changelog_src, changelog_dst) |
| 19 | + |
| 20 | +# -- Project information ----------------------------------------------------- |
| 21 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 22 | + |
| 23 | +project = 'hermes-client' |
| 24 | +copyright = '2025, multiple' |
| 25 | +author = 'multiple' |
| 26 | +version = setuptools_scm.get_version(root='../..', |
| 27 | + relative_to=__file__) |
| 28 | +release = setuptools_scm.get_version(root='../..', |
| 29 | + relative_to=__file__, |
| 30 | + version_scheme="python-simplified-semver", |
| 31 | + local_scheme="no-local-version") |
| 32 | + |
| 33 | +# -- General configuration --------------------------------------------------- |
| 34 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 35 | + |
| 36 | +extensions = [ |
| 37 | + 'myst_parser', |
| 38 | + 'sphinx.ext.autosectionlabel', |
| 39 | + 'sphinx.ext.autodoc', |
| 40 | + 'sphinx.ext.autosummary', |
| 41 | + 'sphinx.ext.intersphinx', |
| 42 | + 'sphinx.ext.napoleon' |
| 43 | +] |
| 44 | +myst_enable_extensions = ["dollarmath", "amsmath"] |
| 45 | +myst_dmath_allow_labels = True |
| 46 | +autosectionlabel_prefix_document = True |
| 47 | + |
| 48 | +templates_path = ['_templates'] |
| 49 | +exclude_patterns = [] |
| 50 | +napoleon_custom_sections = [('Returns', 'params_style')] |
| 51 | + |
| 52 | +# allows to link to other projects :class:`pandas.DataFrame` |
| 53 | +intersphinx_mapping = { |
| 54 | + "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), |
| 55 | +} |
| 56 | + |
| 57 | +autosummary_context = { # this is available in the template |
| 58 | + 'skip_inheritance': [ |
| 59 | + # 'Catalog', |
| 60 | + # 'ForecastCatalog', |
| 61 | + # 'GRRateGrid', |
| 62 | + # 'ForecastGRRateGrid', |
| 63 | + # 'CoordinateTransformer' |
| 64 | + ] |
| 65 | +} |
| 66 | +autosummary_generate = True |
| 67 | +autosummary_generate_overwrite = True |
| 68 | +autodoc_default_options = {} |
| 69 | + |
| 70 | +# -- Options for HTML output ------------------------------------------------- |
| 71 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 72 | + |
| 73 | + |
| 74 | +html_theme = 'pydata_sphinx_theme' |
| 75 | +html_static_path = ['_static'] |
| 76 | +html_theme_options = { |
| 77 | + "use_edit_page_button": False, |
| 78 | + "icon_links": [ |
| 79 | + { |
| 80 | + "name": "GitHub", |
| 81 | + "url": |
| 82 | + "https://github.com/swiss-seismological-service/hermes-client", |
| 83 | + "icon": "fa-brands fa-square-github", |
| 84 | + "type": "fontawesome", |
| 85 | + } |
| 86 | + ], |
| 87 | + # "navigation_depth": 3, |
| 88 | +} |
| 89 | +html_show_sourcelink = False |
| 90 | +navigation_with_keys = True |
| 91 | +html_context = { |
| 92 | + "default_mode": "light", |
| 93 | +} |
| 94 | + |
| 95 | + |
| 96 | +suppress_warnings = ['autosectionlabel.*', |
| 97 | + 'myst.header', |
| 98 | + 'config.cache'] |
0 commit comments