From b0c920bdf4ad09dc3d3a4bf42dee4b62b3684f0b Mon Sep 17 00:00:00 2001 From: Rust Maintainers Date: Sat, 19 May 2018 21:10:33 +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 | 70 ++------------- src/doc/rust-by-example/theme/index.hbs | 76 ++-------------- src/tools/linkchecker/main.rs | 5 ++ src/vendor/mdbook/src/book/init.rs | 6 -- .../renderer/html_handlebars/hbs_renderer.rs | 56 +----------- src/vendor/mdbook/src/theme/index.hbs | 87 +------------------ src/vendor/mdbook/src/theme/mod.rs | 29 ------- 7 files changed, 20 insertions(+), 309 deletions(-) diff --git a/src/doc/book/second-edition/theme/index.hbs b/src/doc/book/second-edition/theme/index.hbs index bb06bf7476..1661770582 100644 --- a/src/doc/book/second-edition/theme/index.hbs +++ b/src/doc/book/second-edition/theme/index.hbs @@ -10,15 +10,13 @@ - - - + - + @@ -111,27 +109,10 @@ {{#if mathjax_support}} - + {{/if}} - - - - - - - - - - + {{#each additional_js}} @@ -140,20 +121,6 @@ - - - - - - @@ -232,36 +199,9 @@ - - - {{{livereload}}} - {{#if google_analytics}} - - {{/if}} - - {{#if playpens_editable}} - - - - - - {{/if}} - {{#if is_print}} {{/if}} - + diff --git a/src/doc/rust-by-example/theme/index.hbs b/src/doc/rust-by-example/theme/index.hbs index 89dfaaa45b..4f4ff78362 100644 --- a/src/doc/rust-by-example/theme/index.hbs +++ b/src/doc/rust-by-example/theme/index.hbs @@ -10,15 +10,13 @@ - - - + - + @@ -29,27 +27,10 @@ {{#if mathjax_support}} - + {{/if}} - - - - - - - - - - + {{#each additional_js}} @@ -58,20 +39,6 @@ - - - - - - @@ -134,42 +101,9 @@ - - - {{{livereload}}} - {{#if google_analytics}} - - {{/if}} - - {{#if playpens_editable}} - - - - - - {{/if}} - {{#if is_print}} {{/if}} - + diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index f6eaa09f55..93dfc18de0 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -178,6 +178,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/init.rs b/src/vendor/mdbook/src/book/init.rs index 909b8cbf0b..9f1388e3a9 100644 --- a/src/vendor/mdbook/src/book/init.rs +++ b/src/vendor/mdbook/src/book/init.rs @@ -136,12 +136,6 @@ impl BookBuilder { let mut js = File::create(themedir.join("book.js"))?; js.write_all(theme::JS)?; - let mut highlight_css = File::create(themedir.join("highlight.css"))?; - highlight_css.write_all(theme::HIGHLIGHT_CSS)?; - - let mut highlight_js = File::create(themedir.join("highlight.js"))?; - 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 6535a4a3dd..f994a6b9e8 100644 --- a/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs @@ -3,7 +3,7 @@ use renderer::{RenderContext, Renderer}; use book::{Book, BookItem, Chapter}; use config::{Config, HtmlConfig, Playpen}; use {theme, utils}; -use theme::{playpen_editor, Theme}; +use theme::{Theme}; use errors::*; use regex::{Captures, Regex}; @@ -156,62 +156,8 @@ impl HtmlHandlebars { self.write_file(destination, "book.js", &theme.js)?; self.write_file(destination, "book.css", &theme.css)?; self.write_file(destination, "favicon.png", &theme.favicon)?; - self.write_file(destination, "highlight.css", &theme.highlight_css)?; self.write_file(destination, "tomorrow-night.css", &theme.tomorrow_night_css)?; self.write_file(destination, "ayu-highlight.css", &theme.ayu_highlight_css)?; - self.write_file(destination, "highlight.js", &theme.highlight_js)?; - self.write_file(destination, "clipboard.min.js", &theme.clipboard_js)?; - self.write_file( - destination, - "_FontAwesome/css/font-awesome.css", - theme::FONT_AWESOME, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.eot", - theme::FONT_AWESOME_EOT, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.svg", - theme::FONT_AWESOME_SVG, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.ttf", - theme::FONT_AWESOME_TTF, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.woff", - theme::FONT_AWESOME_WOFF, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.woff2", - theme::FONT_AWESOME_WOFF2, - )?; - self.write_file( - destination, - "_FontAwesome/fonts/FontAwesome.ttf", - theme::FONT_AWESOME_TTF, - )?; - - let playpen_config = &html_config.playpen; - - // Ace is a very large dependency, so only load it when requested - if playpen_config.editable { - // Load the editor - let editor = playpen_editor::PlaypenEditor::new(&playpen_config.editor); - self.write_file(destination, "editor.js", &editor.js)?; - self.write_file(destination, "ace.js", &editor.ace_js)?; - self.write_file(destination, "mode-rust.js", &editor.mode_rust_js)?; - self.write_file(destination, "theme-dawn.js", &editor.theme_dawn_js)?; - self.write_file(destination, - "theme-tomorrow_night.js", - &editor.theme_tomorrow_night_js, - )?; - } Ok(()) } diff --git a/src/vendor/mdbook/src/theme/index.hbs b/src/vendor/mdbook/src/theme/index.hbs index 2c15f38e19..c4b761a547 100644 --- a/src/vendor/mdbook/src/theme/index.hbs +++ b/src/vendor/mdbook/src/theme/index.hbs @@ -11,15 +11,13 @@ - - - + - + @@ -30,53 +28,12 @@ {{#if mathjax_support}} - + {{/if}} - - - - - - - - - - - -