diff --git a/mk/docs.mk b/mk/docs.mk index 3e032d59728..9c79e1e8642 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -141,26 +141,6 @@ doc/footer.inc: $(D)/footer.inc | doc/ @$(call E, cp: $@) $(Q)cp -a $< $@ 2> /dev/null -doc/FiraSans-Regular.woff: $(D)/FiraSans-Regular.woff | doc/ - @$(call E, cp: $@) - $(Q)cp -a $< $@ 2> /dev/null - -doc/FiraSans-Medium.woff: $(D)/FiraSans-Medium.woff | doc/ - @$(call E, cp: $@) - $(Q)cp -a $< $@ 2> /dev/null - -doc/Heuristica-Regular.woff: $(D)/Heuristica-Regular.woff | doc/ - @$(call E, cp: $@) - $(Q)cp -a $< $@ 2> /dev/null - -doc/Heuristica-Italic.woff: $(D)/Heuristica-Italic.woff | doc/ - @$(call E, cp: $@) - $(Q)cp -a $< $@ 2> /dev/null - -doc/Heuristica-Bold.woff: $(D)/Heuristica-Bold.woff | doc/ - @$(call E, cp: $@) - $(Q)cp -a $< $@ 2> /dev/null - # The (english) documentation for each doc item. define DEF_SHOULD_BUILD_PDF_DOC diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b8df8b772d2..a95d85741e4 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -362,11 +362,21 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> { // Add all the static files. These may already exist, but we just // overwrite them anyway to make sure that they're fresh and up-to-date. try!(write(cx.dst.join("jquery.js"), - include_str!("static/jquery-2.1.0.min.js"))); - try!(write(cx.dst.join("main.js"), include_str!("static/main.js"))); - try!(write(cx.dst.join("main.css"), include_str!("static/main.css"))); + include_bin!("static/jquery-2.1.0.min.js"))); + try!(write(cx.dst.join("main.js"), include_bin!("static/main.js"))); + try!(write(cx.dst.join("main.css"), include_bin!("static/main.css"))); try!(write(cx.dst.join("normalize.css"), - include_str!("static/normalize.css"))); + include_bin!("static/normalize.css"))); + try!(write(cx.dst.join("FiraSans-Regular.woff"), + include_bin!("static/FiraSans-Regular.woff"))); + try!(write(cx.dst.join("FiraSans-Medium.woff"), + include_bin!("static/FiraSans-Medium.woff"))); + try!(write(cx.dst.join("Heuristica-Regular.woff"), + include_bin!("static/Heuristica-Regular.woff"))); + try!(write(cx.dst.join("Heuristica-Italic.woff"), + include_bin!("static/Heuristica-Italic.woff"))); + try!(write(cx.dst.join("Heuristica-Bold.woff"), + include_bin!("static/Heuristica-Bold.woff"))); // Update the search index let dst = cx.dst.join("search-index.js"); @@ -415,8 +425,8 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> { /// Writes the entire contents of a string to a destination, not attempting to /// catch any errors. -fn write(dst: Path, contents: &str) -> io::IoResult<()> { - File::create(&dst).write(contents.as_bytes()) +fn write(dst: Path, contents: &[u8]) -> io::IoResult<()> { + File::create(&dst).write(contents) } /// Makes a directory on the filesystem, failing the task if an error occurs and diff --git a/src/doc/FiraSans-Medium.woff b/src/librustdoc/html/static/FiraSans-Medium.woff similarity index 100% rename from src/doc/FiraSans-Medium.woff rename to src/librustdoc/html/static/FiraSans-Medium.woff diff --git a/src/doc/FiraSans-Regular.woff b/src/librustdoc/html/static/FiraSans-Regular.woff similarity index 100% rename from src/doc/FiraSans-Regular.woff rename to src/librustdoc/html/static/FiraSans-Regular.woff diff --git a/src/doc/Heuristica-Bold.woff b/src/librustdoc/html/static/Heuristica-Bold.woff similarity index 100% rename from src/doc/Heuristica-Bold.woff rename to src/librustdoc/html/static/Heuristica-Bold.woff diff --git a/src/doc/Heuristica-Italic.woff b/src/librustdoc/html/static/Heuristica-Italic.woff similarity index 100% rename from src/doc/Heuristica-Italic.woff rename to src/librustdoc/html/static/Heuristica-Italic.woff diff --git a/src/doc/Heuristica-Regular.woff b/src/librustdoc/html/static/Heuristica-Regular.woff similarity index 100% rename from src/doc/Heuristica-Regular.woff rename to src/librustdoc/html/static/Heuristica-Regular.woff