mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
slightly better error messages
This commit is contained in:
parent
8bd80406e6
commit
54da8acb0c
1 changed files with 16 additions and 7 deletions
|
@ -80,13 +80,22 @@ pub fn generate_docs_html(root_file: PathBuf) {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
fs::write(build_dir.join("search.js"), assets.search_js).unwrap();
|
// Write CSS, JS, and favicon
|
||||||
fs::write(build_dir.join("styles.css"), assets.styles_css).unwrap();
|
// (The HTML requires more work!)
|
||||||
fs::write(build_dir.join("favicon.svg"), assets.favicon_svg).unwrap();
|
for (file, contents) in [
|
||||||
|
("search.js", assets.search_js),
|
||||||
// Get the html template
|
("styles.css", assets.styles_css),
|
||||||
// For debug builds, read from fs to speed up build
|
("favicon.svg", assets.favicon_svg),
|
||||||
// Otherwise, include as string literal
|
] {
|
||||||
|
let dir = build_dir.join(file);
|
||||||
|
fs::write(&dir, contents).unwrap_or_else(|error| {
|
||||||
|
panic!(
|
||||||
|
"Attempted to write {} but failed with this error: {}",
|
||||||
|
dir.display(),
|
||||||
|
error
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Insert asset urls & sidebar links
|
// Insert asset urls & sidebar links
|
||||||
let template_html = assets
|
let template_html = assets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue