-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Made significantly easier and still used sphinx * https://github.com/akaihola/darker/pull/url
- Loading branch information
1 parent
ed005fa
commit 09f17c5
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Sphinx build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
sphinx-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.13' | ||
cache: 'pip' # caching pip dependencies | ||
- run: pip install .[release] | ||
|
||
- name: Build HTML | ||
run: ./action/build_docs.sh | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: html-docs | ||
path: ./sphinx_output/ | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./sphinx_output | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ __pycache__/ | |
*.pyc | ||
/.vscode/ | ||
/build | ||
/sphinx_output | ||
/venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
THEME="sphinx_rtd_theme" | ||
OUTPUT_DIR="../sphinx_output" | ||
REPO_DIR=$PWD | ||
|
||
mkdir -p ../sphinx_project/source | ||
pushd ../sphinx_project | ||
|
||
pip install $THEME | ||
|
||
cat <<EOL > source/conf.py | ||
project = "README" | ||
html_theme = "$THEME" | ||
EOL | ||
|
||
cp "../README.rst" ../sphinx_project/source/index.rst | ||
sphinx-build -b html source $OUTPUT_DIR | ||
|
||
popd | ||
mv ../sphinx_project/$OUTPUT_DIR . | ||
rm -rf ../sphinx_project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters