Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs to readthedocs [WIP] #797

Merged
merged 6 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/docs-publish.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- method: pip
path: .
extra_requirements:
- [docs, tests]
25 changes: 14 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# -- Path setup --------------------------------------------------------------

from datetime import datetime
import json
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -23,7 +24,7 @@
# -- Project information -----------------------------------------------------

project = u'xarray_spatial'
copyright = u'2020-2022, makepath'
copyright = u'2020-{}, makepath'.format(datetime.now().year)
author = u'makepath'

version = release = xrspatial.__version__
Expand Down Expand Up @@ -66,7 +67,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -91,16 +92,16 @@

html_favicon = '_static/img/favicon.ico'

# sphinx-multiversion config
smv_branch_whitelist = 'master'
if os.getenv('THEME') == 'sphinx_rtd_theme':
smv_tag_whitelist = r'^v([0-9]\.[2-9]\.[0-9])'
else:
smv_tag_whitelist = r'^v([0-9]\.[2-9]\.[0-9])'
# # sphinx-multiversion config
# smv_branch_whitelist = 'master'
# if os.getenv('THEME') == 'sphinx_rtd_theme':
# smv_tag_whitelist = r'^v([0-9]\.[2-9]\.[0-9])'
# else:
# smv_tag_whitelist = r'^v([0-9]\.[2-9]\.[0-9])'

# Load releases
with open("releases.json") as f:
releases = json.load(f)
# with open("releases.json") as f:
# releases = json.load(f)

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -109,11 +110,13 @@
html_theme_options = {
"external_links": [],
"github_url": "https://github.com/makepath/xarray-spatial",
"navbar_end": ["navbar-icon-links"],
}

html_context = {
'css_files': ['_static/css/styles.css'],
'releases': [(release, url) for release, url in releases.items()],
# 'releases': [(release, url) for release, url in releases.items()],
"default_mode": "light",
}

autosummary_generate = True
Expand Down
22 changes: 2 additions & 20 deletions docs/source/releases.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
{
"latest": "https://xarray-spatial.org/",
"0.3.7": "https://xarray-spatial.org/v0.3.7/index.html",
"0.3.6": "https://xarray-spatial.org/v0.3.6/index.html",
"0.3.5": "https://xarray-spatial.org/v0.3.5/index.html",
"0.3.4": "https://xarray-spatial.org/v0.3.4/index.html",
"0.3.3": "https://xarray-spatial.org/v0.3.3/index.html",
"0.3.2": "https://xarray-spatial.org/v0.3.2/index.html",
"0.3.1": "https://xarray-spatial.org/v0.3.1/index.html",
"0.3.0": "https://xarray-spatial.org/v0.3.0/index.html",
"0.2.9": "https://xarray-spatial.org/v0.2.9/index.html",
"0.2.8": "https://xarray-spatial.org/v0.2.8/index.html",
"0.2.7": "https://xarray-spatial.org/v0.2.7/index.html",
"0.2.6": "https://xarray-spatial.org/v0.2.6/index.html",
"0.2.5": "https://xarray-spatial.org/v0.2.5/index.html",
"0.2.4": "https://xarray-spatial.org/v0.2.4/index.html",
"0.2.3": "https://xarray-spatial.org/v0.2.3/index.html",
"0.2.2": "https://xarray-spatial.org/v0.2.2/index.html",
"0.2.1": "https://xarray-spatial.org/v0.2.1/index.html",
"0.2.0": "https://xarray-spatial.org/v0.2.0/index.html"
}
"latest": "https://xarray-spatial.readthedocs.io/"
}
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ console_scripts =

[options.extras_require]
doc =
dask[dataframe]
geopandas
Jinja2 >=2.11
ipykernel
Expand All @@ -43,7 +44,6 @@ doc =
pandoc
pydata_sphinx_theme
sphinx
sphinx-multiversion
sphinx-panels
sphinx_rtd_theme
examples =
Expand Down
16 changes: 16 additions & 0 deletions xrspatial/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.3.8.dev1+g27ab0c8.d20240419'
__version_tuple__ = version_tuple = (0, 3, 8, 'dev1', 'g27ab0c8.d20240419')
Loading