diff --git a/.readthedocs.yml b/.readthedocs.yml index c3cfa3e57..f27933517 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -22,3 +22,5 @@ python: install: - method: pip path: . + extra_requirements: + - docs diff --git a/docs/conf.py b/docs/conf.py index 2064a0d9d..1a465806e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -183,6 +183,7 @@ def _reset_ultraplot(gallery_conf, fname): "sphinxext.custom_roles", # local extension "sphinx_automodapi.automodapi", # fork of automodapi "sphinx_rtd_light_dark", # use custom theme + "sphinx_sitemap", "sphinx_copybutton", # add copy button to code "_ext.notoc", "nbsphinx", # parse rst books @@ -373,6 +374,8 @@ def _reset_ultraplot(gallery_conf, fname): # The name of the Pygments (syntax highlighting) style to use. # The light-dark theme toggler overloads this, but set default anyway pygments_style = "none" +html_baseurl = "https://ultraplot.readthedocs.io/stable" +sitemap_url_scheme = "{link}" # -- Options for HTML output ------------------------------------------------- diff --git a/docs/contributing.rst b/docs/contributing.rst index e1aa270f6..ad4cb00c5 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -87,6 +87,7 @@ To build the documentation locally, use the following commands: cd docs # Install dependencies to the base conda environment.. conda env update -f environment.yml + pip install -e ".[docs]" # ...or create a new conda environment # conda env create -n ultraplot-dev --file docs/environment.yml # source activate ultraplot-dev diff --git a/environment.yml b/environment.yml index 904673230..a9d9fe4f2 100644 --- a/environment.yml +++ b/environment.yml @@ -5,6 +5,7 @@ dependencies: - python>=3.10,<3.14 - numpy - matplotlib>=3.9 + - basemap >=1.4.1 - cartopy - xarray - seaborn @@ -13,25 +14,10 @@ dependencies: - pytest-mpl - pytest-cov - pytest-xdist - - jupyter - pip - pint - - sphinx - - sphinx-gallery - - nbsphinx - - jupytext - - sphinx-copybutton - - sphinx-autoapi - - sphinx-automodapi - - sphinx-rtd-theme - - typing-extensions - - basemap >=1.4.1 - pre-commit - - sphinx-design - networkx - pyarrow - cftime - - m2r2 - - lxml-html-clean - pip: - - git+https://github.com/ultraplot/UltraTheme.git diff --git a/pyproject.toml b/pyproject.toml index 9872f5853..6e20a36eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,3 +57,22 @@ ignore = ["I001", "I002", "I003", "I004"] [tool.basedpyright] exclude = ["**/*.ipynb"] + +[project.optional-dependencies] +docs = [ + "jupyter", + "jupytext", + "lxml-html-clean", + "m2r2", + "mpltern", + "nbsphinx", + "sphinx", + "sphinx-autoapi", + "sphinx-automodapi", + "sphinx-copybutton", + "sphinx-design", + "sphinx-gallery", + "sphinx-rtd-light-dark @ git+https://github.com/ultraplot/UltraTheme.git", + "sphinx-sitemap", + "typing-extensions" +]