Skip to content

Commit

Permalink
gen-files/reference.py for the reference generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jetman80 committed Jan 19, 2024
1 parent 5f306c7 commit a472437
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
run: |
python --version
python -m pip list
- name: Set Env for tablite Import
uses: allenevans/[email protected]
with:
USE_NIMPORTER: false
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
2 changes: 1 addition & 1 deletion .pages
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ nav:
- Changelog: changelog.md
- Benchmarks: benchmarks.ipynb
- Tutorial: tutorial.ipynb
- Reference: reference.md
- Reference: reference # virtual folder created by gen-files plugin and reference.py
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ plugins:
- mike
- same-dir
- awesome-pages
- gen-files:
scripts:
- reference.py

extra:
version:
Expand Down
1 change: 0 additions & 1 deletion reference.md

This file was deleted.

10 changes: 10 additions & 0 deletions reference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/python

import tablite
import mkdocs_gen_files
import pkgutil

# We are generating files in the virtual mkdocs_gen_files environment, no real files are created
for submodule in pkgutil.iter_modules(tablite.__path__):
with mkdocs_gen_files.open("reference/{submodule_name}.md".format(submodule_name=submodule.name), "w") as f:
print("::: tablite.{submodule_name}".format(submodule_name=submodule.name), file=f)
1 change: 1 addition & 0 deletions requirements_mkdocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ mkdocstrings
mkdocstrings-python
mkdocs-same-dir
mkdocs-awesome-pages-plugin
mkdocs-gen-files

0 comments on commit a472437

Please sign in to comment.