From 4fa3b407659703c0b98233feaaf409b70950c795 Mon Sep 17 00:00:00 2001 From: Rust Maintainers Date: Sun, 15 Oct 2017 20:31:03 +0100 Subject: [PATCH] d-no-web-dependencies-in-doc Gbp-Pq: Name d-no-web-dependencies-in-doc.patch --- src/doc/book/second-edition/theme/index.hbs | 22 +++------------ src/tools/linkchecker/main.rs | 5 ++++ src/vendor/mdbook/src/book/mod.rs | 8 ------ .../renderer/html_handlebars/hbs_renderer.rs | 10 ------- src/vendor/mdbook/src/theme/index.hbs | 27 ++++-------------- src/vendor/mdbook/src/theme/mod.rs | 28 ------------------- 6 files changed, 15 insertions(+), 85 deletions(-) diff --git a/src/doc/book/second-edition/theme/index.hbs b/src/doc/book/second-edition/theme/index.hbs index 7635dcdce1..878052dc68 100644 --- a/src/doc/book/second-edition/theme/index.hbs +++ b/src/doc/book/second-edition/theme/index.hbs @@ -10,14 +10,13 @@ - - + - + - + - - - + @@ -148,13 +141,6 @@ - - - {{{livereload}}} diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 1b55dc792c..78bcb659e3 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -149,6 +149,11 @@ fn check(cache: &mut Cache, url.starts_with("irc:") || url.starts_with("data:") { return; } + // Ignore parent URLs, so that the package installation process can + // provide a symbolic link later + if url.starts_with("../") { + return; + } let mut parts = url.splitn(2, "#"); let url = parts.next().unwrap(); let fragment = parts.next(); diff --git a/src/vendor/mdbook/src/book/mod.rs b/src/vendor/mdbook/src/book/mod.rs index 85d20a7918..62574042e6 100644 --- a/src/vendor/mdbook/src/book/mod.rs +++ b/src/vendor/mdbook/src/book/mod.rs @@ -285,14 +285,6 @@ impl MDBook { let mut js = try!(File::create(&theme_dir.join("book.js"))); try!(js.write_all(theme::JS)); - // highlight.css - let mut highlight_css = try!(File::create(&theme_dir.join("highlight.css"))); - try!(highlight_css.write_all(theme::HIGHLIGHT_CSS)); - - // highlight.js - let mut highlight_js = try!(File::create(&theme_dir.join("highlight.js"))); - try!(highlight_js.write_all(theme::HIGHLIGHT_JS)); - Ok(()) } diff --git a/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs b/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs index 4fac6869cc..5f5c64cd7c 100644 --- a/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs @@ -162,17 +162,7 @@ impl Renderer for HtmlHandlebars { try!(book.write_file("book.js", &theme.js)); try!(book.write_file("book.css", &theme.css)); try!(book.write_file("favicon.png", &theme.favicon)); - try!(book.write_file("jquery.js", &theme.jquery)); - try!(book.write_file("highlight.css", &theme.highlight_css)); try!(book.write_file("tomorrow-night.css", &theme.tomorrow_night_css)); - try!(book.write_file("highlight.js", &theme.highlight_js)); - try!(book.write_file("_FontAwesome/css/font-awesome.css", theme::FONT_AWESOME)); - try!(book.write_file("_FontAwesome/fonts/fontawesome-webfont.eot", theme::FONT_AWESOME_EOT)); - try!(book.write_file("_FontAwesome/fonts/fontawesome-webfont.svg", theme::FONT_AWESOME_SVG)); - try!(book.write_file("_FontAwesome/fonts/fontawesome-webfont.ttf", theme::FONT_AWESOME_TTF)); - try!(book.write_file("_FontAwesome/fonts/fontawesome-webfont.woff", theme::FONT_AWESOME_WOFF)); - try!(book.write_file("_FontAwesome/fonts/fontawesome-webfont.woff2", theme::FONT_AWESOME_WOFF2)); - try!(book.write_file("_FontAwesome/fonts/FontAwesome.ttf", theme::FONT_AWESOME_TTF)); // Copy all remaining files try!(utils::fs::copy_files_except_ext(book.get_src(), book.get_dest(), true, &["md"])); diff --git a/src/vendor/mdbook/src/theme/index.hbs b/src/vendor/mdbook/src/theme/index.hbs index dec2927449..ce3959676e 100644 --- a/src/vendor/mdbook/src/theme/index.hbs +++ b/src/vendor/mdbook/src/theme/index.hbs @@ -10,27 +10,19 @@ - - - + - + - - - - - + + + @@ -101,17 +93,10 @@ - - - {{{livereload}}} - + diff --git a/src/vendor/mdbook/src/theme/mod.rs b/src/vendor/mdbook/src/theme/mod.rs index 130dd1157a..7382b908d3 100644 --- a/src/vendor/mdbook/src/theme/mod.rs +++ b/src/vendor/mdbook/src/theme/mod.rs @@ -7,17 +7,7 @@ pub static INDEX: &'static [u8] = include_bytes!("index.hbs"); pub static CSS: &'static [u8] = include_bytes!("book.css"); pub static FAVICON: &'static [u8] = include_bytes!("favicon.png"); pub static JS: &'static [u8] = include_bytes!("book.js"); -pub static HIGHLIGHT_JS: &'static [u8] = include_bytes!("highlight.js"); pub static TOMORROW_NIGHT_CSS: &'static [u8] = include_bytes!("tomorrow-night.css"); -pub static HIGHLIGHT_CSS: &'static [u8] = include_bytes!("highlight.css"); -pub static JQUERY: &'static [u8] = include_bytes!("jquery-2.1.4.min.js"); -pub static FONT_AWESOME: &'static [u8] = include_bytes!("_FontAwesome/css/font-awesome.min.css"); -pub static FONT_AWESOME_EOT: &'static [u8] = include_bytes!("_FontAwesome/fonts/fontawesome-webfont.eot"); -pub static FONT_AWESOME_SVG: &'static [u8] = include_bytes!("_FontAwesome/fonts/fontawesome-webfont.svg"); -pub static FONT_AWESOME_TTF: &'static [u8] = include_bytes!("_FontAwesome/fonts/fontawesome-webfont.ttf"); -pub static FONT_AWESOME_WOFF: &'static [u8] = include_bytes!("_FontAwesome/fonts/fontawesome-webfont.woff"); -pub static FONT_AWESOME_WOFF2: &'static [u8] = include_bytes!("_FontAwesome/fonts/fontawesome-webfont.woff2"); -pub static FONT_AWESOME_OTF: &'static [u8] = include_bytes!("_FontAwesome/fonts/FontAwesome.otf"); /// The `Theme` struct should be used instead of the static variables because the `new()` method /// will look if the user has a theme directory in his source folder and use the users theme instead @@ -30,10 +20,7 @@ pub struct Theme { pub css: Vec, pub favicon: Vec, pub js: Vec, - pub highlight_css: Vec, pub tomorrow_night_css: Vec, - pub highlight_js: Vec, - pub jquery: Vec, } impl Theme { @@ -45,10 +32,7 @@ impl Theme { css: CSS.to_owned(), favicon: FAVICON.to_owned(), js: JS.to_owned(), - highlight_css: HIGHLIGHT_CSS.to_owned(), tomorrow_night_css: TOMORROW_NIGHT_CSS.to_owned(), - highlight_js: HIGHLIGHT_JS.to_owned(), - jquery: JQUERY.to_owned(), }; // Check if the given path exists @@ -82,18 +66,6 @@ impl Theme { let _ = f.read_to_end(&mut theme.favicon); } - // highlight.js - if let Ok(mut f) = File::open(&src.join("highlight.js")) { - theme.highlight_js.clear(); - let _ = f.read_to_end(&mut theme.highlight_js); - } - - // highlight.css - if let Ok(mut f) = File::open(&src.join("highlight.css")) { - theme.highlight_css.clear(); - let _ = f.read_to_end(&mut theme.highlight_css); - } - // tomorrow-night.css if let Ok(mut f) = File::open(&src.join("tomorrow-night.css")) { theme.tomorrow_night_css.clear(); -- 2.30.2