The official rl-lang documentation site generator.
Reads the JSON dump produced by rl docs --json (the language reference,
stdlib docs, and tutorials baked into the rl binary) and renders it into a
static, multi-page HTML site with a navy theme, a sidebar linking every
entry, and client-side syntax highlighting for rl code blocks. No build
step, no frontend framework - plain HTML/CSS/JS.
Read it at: https://rl-lang.github.io/the-book
gen_docs_site.py- the generator. Takes adocs.jsonfile and an output directory, and writes oneindex.htmlplus one page per stdlib module, concept, and tutorial entry, all cross-linked via the sidebar.style.css- navy color scheme, sidebar layout, and the token colors used by the syntax highlighter.rl-highlight.js- a small dependency-free tokenizer that highlights<pre class="rl-code">blocks client-side, based on the real keyword list fromrl-lang's lexer..github/workflows/build-docs-site.yml- on every push tomaster, clonesrl-lang/rl-lang, builds it withcargo build --release, runsrl docs --json --output --out-file docs.jsonto get a fresh doc dump, runs it throughgen_docs_site.py, and deploys the result to GitHub Pages.
You need a docs.json file to feed the generator. Get one by building
rl-lang/rl-lang yourself and running:
cargo build --release
./target/release/rl docs --json --output --out-file docs.jsonThen generate the site:
python3 gen_docs_site.py docs.json site_outgen_docs_site.py copies style.css and rl-highlight.js into site_out
automatically - they just need to be sitting next to the script when you run
it. Serve the result to view it (opening index.html directly as a
file:// URL also works, since there's no build step):
python3 -m http.server --directory site_outThen open http://localhost:8000.
- Python 3, no third-party packages
- A build of
rl-lang/rl-langto producedocs.json(only needed locally - CI builds it for you)
Documentation licensed under CC BY 4.0.