Luke Boswell said:
I wonder if we could just commit the html files into the repo under a folder structure...
www/ - 0.16.0/ - 0.17.0/I'm not sure if this is compatible with GH pages...
I've been messing around with this... it'd be really nice if we had a flag in roc cli roc docs --mount "/0.11.0/" that could say, hey generate the static site but assume you will be mounted at this folder /0.11.0/ or something... so all the links point at the correct location and there is no need to replace things.
A message was moved here from #compiler development > casual conversation by Luke Boswell.
Does this idea sound like something we should/shouldn't add?
Sounds reasonable if we don't have a better way to do relative links. Sometimes it is also useful to specify the full urls in apps and html files. So some sort of config here sounds really reasonable.
Yeah doing a little research, it seems a common feature for static site generators to provide a path prefix.
Oh we might already have it, I wonder what this var does? ROC_DOCS_URL_ROOT
Hey I think it works!. .. well at least locally
Probably should change that to a cli arg that can be found via help.
I can do that soon, just testing the multiple docs version idea in roc-json
yeah it was originally added just for builtins
but cli flag seems fine :thumbs_up:
like --root or something
or --root-dir
Hey it works... :tada:
https://lukewilliamboswell.github.io/roc-json/0.11.0/
https://lukewilliamboswell.github.io/roc-json/0.10.2/
That's the simplest multi-version docs site ever
Screenshot 2025-01-08 at 13.08.57.png
Added a default index page that redirects to the latest docs, or shows a link if JS is disabled.
next we need to be able to put the package/app/platform name in the place of the word “documentation” :wink:
Even if with a cli arg
yeah there's a design question there
need to figure out how package naming will actually work before we can display the names :big_smile:
In case it's helpful to anyone... here's a script I've used to generate the static docs for roc-json. It uses the --root-dir so these play nicely with GH Pages static sites.
https://lukewilliamboswell.github.io/roc-json/0.12.0/
https://lukewilliamboswell.github.io/roc-json/0.11.0/
#!/usr/bin/env bash
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
# Function to validate version number format (x.y.z)
validate_version() {
if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version number must be in format x.y.z (e.g., 0.12.0)"
exit 1
fi
}
# Check if version argument is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <version>"
echo "Example: $0 0.12.0"
exit 1
fi
VERSION=$1
# Validate version number
validate_version "$VERSION"
# Run roc docs with validated version
roc docs --root-dir "/roc-json/$VERSION/" package/main.roc
# Create new version directory in www/
mkdir www/$VERSION
# Move generated docs to version directory
mv generated-docs/* www/$VERSION
Last updated: Jun 16 2026 at 16:19 UTC