-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sphinx docs creation to Makefile
- Loading branch information
Showing
2 changed files
with
13 additions
and
14 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 |
---|---|---|
|
@@ -164,20 +164,7 @@ jobs: | |
- name: Build docs | ||
run: | | ||
mkdir docs | ||
cd docs | ||
sphinx-quickstart --quiet --sep --project=sapphirepy --copyright="2024, Oasis Protocol Foundation" --author="[email protected]" --ext-autodoc --ext-viewcode | ||
pip install furo | ||
sed -i "s/^html_theme = 'alabaster'/html_theme = 'furo'/" source/conf.py | ||
# Modify conf.py programmatically | ||
sed -i "s/^extensions = \[/extensions = [\n 'myst_parser',/" source/conf.py | ||
echo "source_suffix = {'.rst': 'restructuredtext', '.md': 'markdown'}" >> source/conf.py | ||
sed -i '/^Add your content/,/details\.$/d; /^sapphirepy documentation$/,/^=\+$/c\sapphirepy documentation\n========================\n\n.. automodule:: sapphirepy\n :members:\n :undoc-members:\n :show-inheritance:\n\n.. include:: ../../README.md\n :parser: markdown\n' source/index.rst | ||
echo -e "\n modules" >> source/index.rst | ||
cd .. # Back to project root | ||
sphinx-apidoc -o docs/source/ $(pip show sapphire-py | grep Location | cut -d' ' -f2)/sapphirepy | ||
make docs | ||
cd docs | ||
make html | ||
|
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 |
---|---|---|
|
@@ -22,3 +22,15 @@ build: wheel | |
|
||
wheel: | ||
$(PYTHON) setup.py bdist_wheel | ||
|
||
docs: | ||
mkdir docs | ||
cd docs && sphinx-quickstart --quiet --sep --project=sapphirepy --author='[email protected]' --ext-autodoc --ext-viewcode | ||
sed -i "s/^copyright = .*/copyright = '2024, Oasis Protocol Foundation'/" docs/source/conf.py | ||
pip install furo | ||
sed -i "s/^html_theme = 'alabaster'/html_theme = 'furo'/" docs/source/conf.py | ||
sed -i "s/^extensions = \[/extensions = [\n 'myst_parser',/" docs/source/conf.py | ||
echo "source_suffix = {'.rst': 'restructuredtext', '.md': 'markdown'}" >> docs/source/conf.py | ||
sed -i '/Add your content/,/details/c\\n.. automodule:: sapphirepy\n :members:\n :undoc-members:\n :show-inheritance:\n\n.. include:: ../../README.md\n :parser: markdown' docs/source/index.rst | ||
echo "\n modules" >> docs/source/index.rst | ||
sphinx-apidoc -o docs/source/ $$(pip show sapphire-py | grep Location | cut -d' ' -f2)/sapphirepy |