Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate python docs and include in mdbook as part of deploy-book.yaml #97

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/deploy-book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "docs/**"
- ".github/workflows/deploy-book.yaml"
- "README.md"
- "python/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -32,11 +33,19 @@ jobs:
MDBOOK_VERSION: 0.4.21
steps:
- uses: actions/checkout@v3
- name: Install mdBook
- name: Install mdBook and supporting dependencies
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Build python docs
run:
sudo apt update
sudo apt install pipx
pipx ensurepath
pipx install pydoc-markdown
pydoc-markdown -I python/ -p fastsim --render-toc > docs/src/python_docs.md

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
Expand Down
3 changes: 2 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
book/
book/
src/python_docs.md
3 changes: 3 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Summary

- [Introduction](./intro.md)
- [Documentation](./fastsim-doc.md)
- [Python](./python-doc.md)
- [Rust](./rust-doc.md)
- [How to Update This Book](./how-to-update.md)
5 changes: 5 additions & 0 deletions docs/src/fastsim-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Documentation

## [Python](./python-doc.md)

## [Rust](./rust-doc.md)
15 changes: 11 additions & 4 deletions docs/src/how-to-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@

## Setup

1. If not already done, [install mdbook](https://rust-lang.github.io/mdBook/guide/installation.html)
If not already done, [install mdbook](https://rust-lang.github.io/mdBook/guide/installation.html)

## Publishing
## Serving locally
Run the following in the repository root directory:
1. If any python files were modified,
1. Install [pipx](https://github.com/pypa/pipx#install-pipx)
1. Install [pydoc-markdown](https://niklasrosenstein.github.io/pydoc-markdown/#installation-)
1. run `pydoc-markdown -I python/ -p fastsim --render-toc > docs/src/python_docs.md`. Do not modify this file manually.
1. Run `mdbook serve --open docs/`

## Publishing
1. Update `book.toml` or files in `docs/src/`
1. Make sure the docs look good locally: `mdbook build docs/ --open`
1. Make sure the docs look good locally by running the
1. Commit files and push to `main` branch

After that, a GitHub action will build the book and publish it [here](https://pages.github.nrel.gov/MBAP/mbap-computing/)
After that, a GitHub action will build the book and publish it [here](https://pages.github.nrel.gov/MBAP/mbap-computing/)
3,763 changes: 3,763 additions & 0 deletions docs/src/python-doc.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/src/rust-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# [Rust Documentation](https://docs.rs/fastsim-core/latest/fastsim_core/)
Loading