mirror of https://github.com/Nonannet/pyhoff.git
Change docs path and update publishing method
This commit is contained in:
parent
0f5eda6cfc
commit
49f654993e
7
.flake8
7
.flake8
|
@ -12,9 +12,10 @@ exclude =
|
|||
__pycache__,
|
||||
build,
|
||||
dist,
|
||||
.conda
|
||||
.venv
|
||||
venv
|
||||
.conda,
|
||||
.venv,
|
||||
venv,
|
||||
docs/source/api
|
||||
|
||||
# Enable specific plugins or options
|
||||
# Example: Enabling flake8-docstrings
|
||||
|
|
|
@ -9,7 +9,7 @@ permissions:
|
|||
contents: write
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -29,8 +29,24 @@ jobs:
|
|||
rm ./source/*.rst
|
||||
make html
|
||||
touch ./build/html/.nojekyll
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
mkdir -p ./build/html/_autogenerated
|
||||
cp ./build/html/api/* ./build/html/_autogenerated/
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/build/html
|
||||
path: docs/build/html
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
|
@ -10,6 +10,10 @@ jobs:
|
|||
name: Build and publish
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/project/${{ github.event.repository.name }}/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ instance/
|
|||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
docs/source/_autogenerated/
|
||||
docs/source/api/
|
||||
|
||||
# Autogenerated documentation
|
||||
docs/source/modules.md
|
||||
|
|
|
@ -24,7 +24,7 @@ def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title
|
|||
write_dochtree(f, title, classes)
|
||||
|
||||
for cls in classes:
|
||||
with open(f'docs/source/_autogenerated/{cls}.md', 'w') as f2:
|
||||
with open(f'docs/source/api/{cls}.md', 'w') as f2:
|
||||
f2.write(f'# {module_name}.{cls}\n')
|
||||
f2.write('```{eval-rst}\n')
|
||||
f2.write(f'.. autoclass:: {module_name}.{cls}\n')
|
||||
|
@ -52,9 +52,9 @@ def write_dochtree(f: TextIOWrapper, title: str, items: list[str]):
|
|||
|
||||
if __name__ == "__main__":
|
||||
# Ensure the output directory exists
|
||||
os.makedirs('docs/source/_autogenerated', exist_ok=True)
|
||||
os.makedirs('docs/source/api', exist_ok=True)
|
||||
|
||||
with open('docs/source/_autogenerated/index.md', 'w') as f:
|
||||
with open('docs/source/api/index.md', 'w') as f:
|
||||
f.write('# Classes and Modules\n\n')
|
||||
|
||||
write_classes(f, ['BK*', 'WAGO_750_352'], 'pyhoff.devices', title='Bus coupler',
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
```{toctree}
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
_autogenerated/index
|
||||
api/index
|
||||
repo
|
||||
```
|
||||
|
||||
```{include} ../../README.md
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# Code repository
|
||||
|
||||
Code repository is on GitHub: [github.com/Nonannet/pyhoff](https://github.com/Nonannet/pyhoff).
|
Loading…
Reference in New Issue