Skip to content

Commit

Permalink
improve doc build and readme (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski authored Jan 10, 2022
1 parent a8388c1 commit ddfdfbe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
pull_request:
push:
branches: [main]
release:

jobs:
doc:
Expand All @@ -11,10 +10,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: |
python -m pip install -e .[doc]
cd doc
sphinx-build -b html -d _build/doctrees . _build/html
- run: python -m pip install -e .[doc]
- run: python doc/build.py
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Jacobi
======

`Documentation <https://hdembinski.github.io/jacobi/>`_

Fast numerical derivatives for real analytic functions with arbitrary round-off error.

Features
Expand Down
8 changes: 8 additions & 0 deletions doc/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3
import subprocess as subp
from pathlib import Path
import sys

cmd = "sphinx-build -W -b html -d _build/doctrees . _build/html"

sys.exit(subp.call(cmd.split(), cwd=Path(__file__).parent))
6 changes: 4 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

# import sys
# import os
from pathlib import Path

with open("index.rst.in") as f:
stub = f.read()

with open(Path("..") / "README.rst") as f:
readme = f.read().replace("doc/", "")
# remove line 4
lines = readme.split("\n")
lines = lines[:3] + lines[4:]
readme = "\n".join(lines)

with open("index.rst", "w") as f:
f.write(stub + "\n" + readme)
Expand Down

0 comments on commit ddfdfbe

Please sign in to comment.