mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Fix asset links for docs
This commit is contained in:
parent
1018cdce37
commit
4bfa82b679
2 changed files with 24 additions and 17 deletions
|
@ -52,21 +52,28 @@ pub fn generate(filenames: Vec<PathBuf>, std_lib: StdLib, build_dir: &Path) {
|
|||
)
|
||||
.expect("TODO gracefully handle failing to make the favicon");
|
||||
|
||||
let template_html = include_str!("./static/index.html").replace(
|
||||
"<!-- Module links -->",
|
||||
render_sidebar(package.modules.iter().flat_map(|loaded_module| {
|
||||
loaded_module.documentation.values().map(move |d| {
|
||||
let exposed_values = loaded_module
|
||||
.exposed_values
|
||||
.iter()
|
||||
.map(|symbol| symbol.ident_str(&loaded_module.interns).to_string())
|
||||
.collect::<Vec<String>>();
|
||||
let template_html = include_str!("./static/index.html")
|
||||
.replace("<!-- search.js -->", &format!("{}search.js", base_href()))
|
||||
.replace("<!-- styles.css -->", &format!("{}styles.css", base_href()))
|
||||
.replace(
|
||||
"<!-- favicon.svg -->",
|
||||
&format!("{}favicon.svg", base_href()),
|
||||
)
|
||||
.replace(
|
||||
"<!-- Module links -->",
|
||||
render_sidebar(package.modules.iter().flat_map(|loaded_module| {
|
||||
loaded_module.documentation.values().map(move |d| {
|
||||
let exposed_values = loaded_module
|
||||
.exposed_values
|
||||
.iter()
|
||||
.map(|symbol| symbol.ident_str(&loaded_module.interns).to_string())
|
||||
.collect::<Vec<String>>();
|
||||
|
||||
(exposed_values, d)
|
||||
})
|
||||
}))
|
||||
.as_str(),
|
||||
);
|
||||
(exposed_values, d)
|
||||
})
|
||||
}))
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
// Write each package's module docs html file
|
||||
for loaded_module in package.modules.iter_mut() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue