Skip to content

Commit

Permalink
add documentation on how to generate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexseal committed Jan 10, 2024
1 parent e0622c0 commit ef3aa8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev/DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ To install the entire package along with python glue code, do `python3.[version]

Stubs are useful for type checking and IDE autocompletion. To generate stubs, you **first need to have mplib compiled and installed**. Then, do `python3.[version] -m pip install pybind11_stubgen` and then run `bash dev/generate_stubs.sh`. This will generate stubs for the entire project in the `stubs/` directory. Note that you might need to change the version of the python inside the script. The default is 3.11.

### Documentation Generation
### Website Generation

We use `pdoc` to generate the documentation. First install a version of mplib referring to the section above.

Then, you will need to install `pdoc` with `python3.[version] -m pip install pdoc`. The reason the version is important is because `pdoc` will actually do analysis on the files, so it will scrape through the mplib installed in the site package. Then, run `bash dev/generate_docs.sh`. This will generate the documentation in the `docs/` directory. Note that you might need to change the version of the python inside the script. The default is 3.11.
Then, you will need to install `pdoc` with `python3.[version] -m pip install pdoc`. The reason the version is important is because `pdoc` will actually do analysis on the files, so it will scrape through the mplib installed in the site package. Then, run `bash dev/generate_pdoc.sh` from the root of MPlib. This will generate the documentation in the `docs/` directory. Note that you might need to change the version of the python inside the script. The default is 3.11.
8 changes: 8 additions & 0 deletions dev/generate_pdoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# python3.[version] -m pip install pdoc
# run from the root of the project

current_dir=$(pwd)
cd ~ # go out of the current directory to avoid picking up local mplib (need global)
python3.11 -m pdoc -o $current_dir/docs mplib
cd $current_dir

0 comments on commit ef3aa8a

Please sign in to comment.