mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Fix URLs in docs generation
This commit is contained in:
parent
64b5c49faf
commit
ddfa45eeb5
2 changed files with 6 additions and 8 deletions
|
@ -56,12 +56,9 @@ pub fn generate_docs_html(filenames: Vec<PathBuf>, build_dir: &Path) {
|
||||||
.expect("TODO gracefully handle failing to make the favicon");
|
.expect("TODO gracefully handle failing to make the favicon");
|
||||||
|
|
||||||
let template_html = include_str!("./static/index.html")
|
let template_html = include_str!("./static/index.html")
|
||||||
.replace("<!-- search.js -->", &format!("{}search.js", base_url()))
|
.replace("<!-- search.js -->", "/search.js")
|
||||||
.replace("<!-- styles.css -->", &format!("{}styles.css", base_url()))
|
.replace("<!-- styles.css -->", "/styles.css")
|
||||||
.replace(
|
.replace("<!-- favicon.svg -->", "/favicon.svg")
|
||||||
"<!-- favicon.svg -->",
|
|
||||||
&format!("{}favicon.svg", base_url()),
|
|
||||||
)
|
|
||||||
.replace(
|
.replace(
|
||||||
"<!-- Module links -->",
|
"<!-- Module links -->",
|
||||||
render_sidebar(package.modules.iter().flat_map(|loaded_module| {
|
render_sidebar(package.modules.iter().flat_map(|loaded_module| {
|
||||||
|
|
|
@ -41,7 +41,7 @@ RUSTFLAGS=-Awarnings
|
||||||
# We set ROC_DOCS_ROOT_DIR=builtins so that links will be generated relative to
|
# We set ROC_DOCS_ROOT_DIR=builtins so that links will be generated relative to
|
||||||
# "/builtins/" rather than "/" - which is what we want based on how the server
|
# "/builtins/" rather than "/" - which is what we want based on how the server
|
||||||
# is set up to serve them.
|
# is set up to serve them.
|
||||||
ROC_DOCS_URL_ROOT=builtins
|
export ROC_DOCS_URL_ROOT=/builtins
|
||||||
|
|
||||||
# These just need to be defined so that some env! macros don't fail.
|
# These just need to be defined so that some env! macros don't fail.
|
||||||
BUILTINS_WASM32_O=""
|
BUILTINS_WASM32_O=""
|
||||||
|
@ -51,5 +51,6 @@ BUILTINS_HOST_O=""
|
||||||
# "llvm" feature and therefore don't depend on LLVM being installed on the
|
# "llvm" feature and therefore don't depend on LLVM being installed on the
|
||||||
# system. (Netlify's build servers have Rust installed, but not LLVM.)
|
# system. (Netlify's build servers have Rust installed, but not LLVM.)
|
||||||
cargo run -p roc_cli --no-default-features docs compiler/builtins/roc/*.roc
|
cargo run -p roc_cli --no-default-features docs compiler/builtins/roc/*.roc
|
||||||
mv generated-docs/ www/build/builtins
|
mv generated-docs/*.* www/build # move all the .js, .css, etc. files to build/
|
||||||
|
mv generated-docs/ www/build/builtins # move all the folders to build/builtins/
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue