https://github.com/ppwwyyxx/dash-docset-jax
Create nice dash/zeal docset for JAX+Flax
https://github.com/ppwwyyxx/dash-docset-jax
dash flax jax zeal
Last synced: 10 months ago
JSON representation
Create nice dash/zeal docset for JAX+Flax
- Host: GitHub
- URL: https://github.com/ppwwyyxx/dash-docset-jax
- Owner: ppwwyyxx
- License: apache-2.0
- Created: 2022-05-30T10:06:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-02T00:42:32.000Z (over 2 years ago)
- Last Synced: 2025-04-11T18:56:10.977Z (about 1 year ago)
- Topics: dash, flax, jax, zeal
- Language: Python
- Homepage:
- Size: 466 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## JAX+Flax offline documentation in [dash](https://kapeli.com/dash)/[zeal](https://github.com/zealdocs/zeal) docset browser

To use, you can add this feed in Dash/Zeal directly:
```
https://raw.githubusercontent.com/ppwwyyxx/dash-docset-jax/master/Jax.xml
```
Or download the latest release [here](https://github.com/ppwwyyxx/dash-docset-jax/releases).
## Steps to generate the docset
1. Install JAX and Flax
1. `pip install tqdm python-magic selectolax doc2dash beautifulsoup4 lxml`
1. Build their documentation together:
```
git clone https://github.com/google/jax /tmp/jax
git clone https://github.com/google/flax /tmp/flax
cd /tmp/flax/docs/
# Install necessary doc dependencies from requirements.txt, then:
sphinx-build -b html -D nb_execution_mode=off ./ ./build/html -j auto
cd /tmp/jax/docs
cp -rv /tmp/flax/docs/api_reference/flax.* ./
# Install necessary doc dependencies from requirements.txt, then:
sphinx-build -b html -D nb_execution_mode=off ./ ./build/html -j auto
```
1. `cd` to this project, then run the following to beautify the docs:
```
export HTML_DIR=/tmp/jax/docs/build/html
# Beautify the docs for more friendly display:
./transform.py $HTML_DIR
# Use monospace font for code:
sed -i 's/var(--pst-font-family-monospace)/monospace/g' $HTML_DIR/**/*.css
doc2dash -f -d ./ -u https://jax.readthedocs.io/ --name jax -i icon.png $HTML_DIR
```
This will generate `jax.docset` that can be installed into Zeal/Dash.
## Others
* Latex renders correctly:

* Syntax highlight works (check `flax.linen.map_variables`)