Skip to content

Commit

Permalink
Merge pull request #72 from ikalnytskyi/chore/readthedocs
Browse files Browse the repository at this point in the history
Revive Read-the-Docs publishing
  • Loading branch information
ikalnytskyi committed Nov 19, 2023
2 parents b62f1b7 + df9feeb commit 2c99cd9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3"

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .

sphinx:
configuration: docs/conf.py
fail_on_warning: true
8 changes: 1 addition & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import importlib.metadata


Expand All @@ -23,12 +22,7 @@
html_use_index = False
html_show_sourcelink = False
html_logo = "_static/picobox.svg"

if not os.environ.get("READTHEDOCS") == "True":
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"

# Sphinx does not support "code" directive preserving default (docutils)
# behaviour. This means code won't be highlighted which is not good. In
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx_rtd_theme
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies = ["ruff == 0.1.6"]
scripts.run = ["ruff check {args:.}", "ruff format --check --diff {args:.}"]

[tool.hatch.envs.docs]
dependencies = ["sphinx", "sphinx_rtd_theme"]
pre-install-commands = ["python -m pip install -r docs/requirements.txt"]
scripts.run = "sphinx-build -W -b html docs docs/_build/"

[tool.ruff]
Expand Down

0 comments on commit 2c99cd9

Please sign in to comment.