|
| 1 | +""" |
| 2 | +Configuration file for the Sphinx documentation builder. |
| 3 | +
|
| 4 | +Created originally using sphinx-quickstart on 2022-02-21. |
| 5 | +""" |
| 6 | + |
| 7 | +from datetime import datetime |
| 8 | +from pathlib import Path |
| 9 | +import sys |
| 10 | + |
| 11 | +# -- Path setup -------------------------------------------------------------- |
| 12 | + |
| 13 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 14 | +# add these directories to sys.path here - **using absolute paths**. |
| 15 | + |
| 16 | +source_code_root = (Path(__file__).parents[2]).absolute() |
| 17 | +sys.path.append(str(source_code_root)) |
| 18 | + |
| 19 | + |
| 20 | +# -- Project information ----------------------------------------------------- |
| 21 | + |
| 22 | +from esmf_regrid import __version__ as esmf_r_version |
| 23 | + |
| 24 | +copyright_years = f"2020 - {datetime.now().year}" |
| 25 | + |
| 26 | +project = "iris-esmf-regrid" |
| 27 | +copyright = f"{copyright_years}, SciTools-incubator" |
| 28 | +author = "iris-esmf-regrid Contributors" |
| 29 | + |
| 30 | +# The full version, including alpha/beta/rc tags |
| 31 | +release = esmf_r_version |
| 32 | + |
| 33 | + |
| 34 | +# -- General configuration --------------------------------------------------- |
| 35 | + |
| 36 | +# Add any Sphinx extension module names here, as strings. They can be |
| 37 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 38 | +# ones. |
| 39 | +extensions = [ |
| 40 | + "sphinx.ext.autodoc", |
| 41 | + "sphinx_copybutton", |
| 42 | + "sphinx.ext.extlinks", |
| 43 | + "sphinx.ext.intersphinx", |
| 44 | + "sphinx.ext.napoleon", |
| 45 | + "sphinx.ext.todo", |
| 46 | + "sphinx.ext.viewcode", |
| 47 | + "sphinxcontrib.apidoc", |
| 48 | +] |
| 49 | + |
| 50 | +# Add any paths that contain templates here, relative to this directory. |
| 51 | +templates_path = ["_templates"] |
| 52 | + |
| 53 | +# List of patterns, relative to source directory, that match files and |
| 54 | +# directories to ignore when looking for source files. |
| 55 | +# This pattern also affects html_static_path and html_extra_path. |
| 56 | +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 57 | + |
| 58 | + |
| 59 | +# -- Options for HTML output ------------------------------------------------- |
| 60 | + |
| 61 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 62 | +# a list of builtin themes. |
| 63 | +# |
| 64 | +html_theme = "pydata_sphinx_theme" |
| 65 | + |
| 66 | +html_theme_options = { |
| 67 | + "github_url": "https://github.com/SciTools-incubator/iris-esmf-regrid", |
| 68 | + "show_prev_next": False, |
| 69 | + "icon_links": [ |
| 70 | + { |
| 71 | + "name": "Support", |
| 72 | + "url": "https://github.com/SciTools-incubator/iris-esmf-regrid/discussions", |
| 73 | + "icon": "fa fa-comments fa-fw", |
| 74 | + } |
| 75 | + ], |
| 76 | +} |
| 77 | + |
| 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 = ["_static"] |
| 83 | + |
| 84 | + |
| 85 | +# -- api generation configuration --------------------------------------------- |
| 86 | +autoclass_content = "both" |
| 87 | +autodoc_typehints = "none" |
| 88 | +modindex_common_prefix = ["esmf_regrid"] |
| 89 | + |
| 90 | + |
| 91 | +# -- copybutton extension ----------------------------------------------------- |
| 92 | +# See https://sphinx-copybutton.readthedocs.io/en/latest/ |
| 93 | +copybutton_prompt_text = r">>> |\.\.\. " |
| 94 | +copybutton_prompt_is_regexp = True |
| 95 | +copybutton_line_continuation_character = "\\" |
| 96 | + |
| 97 | + |
| 98 | +# -- extlinks extension ------------------------------------------------------- |
| 99 | +# See https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html |
| 100 | + |
| 101 | +extlinks = { |
| 102 | + "issue": ( |
| 103 | + "https://github.com/SciTools-incubator/iris-esmf-regrid/issues/%s", |
| 104 | + "Issue #", |
| 105 | + ), |
| 106 | + "pull": ("https://github.com/SciTools-incubator/iris-esmf-regrid/pull/%s", "PR #"), |
| 107 | +} |
| 108 | + |
| 109 | + |
| 110 | +# -- intersphinx extension ---------------------------------------------------- |
| 111 | +# See https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html |
| 112 | +intersphinx_mapping = { |
| 113 | + "iris": ("https://scitools-iris.readthedocs.io/en/latest/", None), |
| 114 | + "cartopy": ("https://scitools.org.uk/cartopy/docs/latest/", None), |
| 115 | + "numpy": ("https://numpy.org/doc/stable/", None), |
| 116 | + "python": ("https://docs.python.org/3/", None), |
| 117 | + "scipy": ("https://docs.scipy.org/doc/scipy/", None), |
| 118 | + "ESMF": ("https://earthsystemmodeling.org/esmpy_doc/release/latest/html/", None), |
| 119 | +} |
| 120 | + |
| 121 | + |
| 122 | +# -- todo_ extension ---------------------------------------------------------- |
| 123 | +# See https://www.sphinx-doc.org/en/master/usage/extensions/todo.html |
| 124 | +todo_include_todos = True |
| 125 | + |
| 126 | + |
| 127 | +# -- apidoc extension --------------------------------------------------------- |
| 128 | +# See https://github.com/sphinx-contrib/apidoc |
| 129 | +module_dir = source_code_root / "esmf_regrid" |
| 130 | + |
| 131 | +apidoc_module_dir = str(module_dir) |
| 132 | +apidoc_output_dir = str(Path(__file__).parent / "_api_generated") |
| 133 | +apidoc_excluded_paths = [str(module_dir / "tests")] |
| 134 | +apidoc_separate_modules = True |
| 135 | +apidoc_extra_args = ["-H", "API"] |
0 commit comments