Skip to content

Commit e3bc9fb

Browse files
committed
Correctly load normalize.css in documentation pages
Recent versions of rustc is no longer importing normalize.css from main.css. We need point fix link of the normalize.css to load it correctly.
1 parent 0d4321a commit e3bc9fb

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/docbuilder/chroot_builder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,9 @@ impl DocBuilder {
368368
info!("Copying essential files for: {}", res.rustc_version);
369369

370370
let files = (// files require rustc version subfix
371-
["rustdoc.css", "main.css", "main.js", "jquery.js"],
371+
["rustdoc.css", "main.css", "main.js", "jquery.js", "normalize.css"],
372372
// files doesn't require rustc version subfix
373-
["normalize.css",
374-
"FiraSans-Medium.woff",
373+
["FiraSans-Medium.woff",
375374
"FiraSans-Regular.woff",
376375
"Heuristica-Italic.woff",
377376
"SourceCodePro-Regular.woff",

src/utils/copy.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ fn copy_html(source: &PathBuf,
100100

101101
let reader = io::BufReader::new(source_file);
102102

103-
let replace_regex = Regex::new(r#"(href|src)="(.*)(main|jquery|rustdoc|playpen)\.(css|js)""#)
104-
.unwrap();
103+
// FIXME: We don't need to store common libraries (jquery and normalize) for the each version
104+
// of rustc. I believe storing only one version of this files should work in every
105+
// documentation page.
106+
let replace_regex =
107+
Regex::new(r#"(href|src)="(.*)(main|jquery|rustdoc|playpen|normalize)\.(css|js)""#)
108+
.unwrap();
105109
let replace_str = format!("$1=\"{}../../$2$3-{}.$4\"",
106110
if target { "../" } else { "" },
107111
rustc_version);

0 commit comments

Comments
 (0)