diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f9eb048..c153b63 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,10 +1,12 @@ version: 2 build: - image: latest + os: ubuntu-22.04 + tools: + python: "3.12" + python: - version: 3.8 install: - requirements: requirements/docs.txt - method: pip diff --git a/docs/conf.py b/docs/conf.py index a1128bd..6fda11c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,6 +38,7 @@ 'sphinx.ext.coverage', 'sphinx.ext.napoleon', 'sphinx_autodoc_typehints', + 'sphinx_immaterial', ] napoleon_use_param = True @@ -56,9 +57,53 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = 'sphinx_immaterial' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + +html_theme_options = { + "repo_url": "https://github.com/jsfehler/inori", + "repo_name": "inori", + "icon": { + "repo": "fontawesome/brands/git", + "edit": "material/file-edit-outline", + }, + "font": False, + "features": [ + "navigation.expand", + "navigation.sections", + "navigation.top", + "navigation.tracking", + "search.share", + "toc.follow", + "toc.sticky", + "content.tabs.link", + "announce.dismiss", + ], + "palette": [ + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "primary": "blue-grey", + "accent": "orange", + "toggle": { + "icon": "material/lightbulb-outline", + "name": "Switch to dark mode", + }, + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "primary": "grey", + "accent": "amber", + "toggle": { + "icon": "material/lightbulb", + "name": "Switch to light mode", + }, + }, + ], + +} diff --git a/inori/__init__.py b/inori/__init__.py index e50daf6..a24e8f1 100644 --- a/inori/__init__.py +++ b/inori/__init__.py @@ -1,5 +1,5 @@ from .client import Client from .route import Route - +from .version import __version__ # NOQA: F401 __all__ = ['Client', 'Route'] diff --git a/requirements/docs.txt b/requirements/docs.txt index 6107c75..24da60e 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,2 +1,4 @@ shibari==0.0.2 +Sphinx==7.3.7 sphinx-autodoc-typehints==2.1.1 +sphinx-immaterial==0.11.11 diff --git a/tox.ini b/tox.ini index 3e84ba3..3057b8d 100644 --- a/tox.ini +++ b/tox.ini @@ -14,3 +14,12 @@ skip_install = true deps = -rrequirements/lint.txt changedir = . commands = flake8 inori tests + +[testenv:build_docs] +allowlist_externals = make +deps = + -rrequirements/docs.txt +changedir = docs/ +commands = + make clean + make {posargs}