From 774788ace55e27d15fadaeed4b54db36bcf77b19 Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Mon, 28 Jan 2019 06:02:48 +0000 Subject: [PATCH] d-no-web-dependencies-in-doc Gbp-Pq: Name d-no-web-dependencies-in-doc.patch --- src/tools/linkchecker/main.rs | 5 ++ vendor/mdbook/src/book/init.rs | 6 -- .../renderer/html_handlebars/hbs_renderer.rs | 55 +------------ .../src/renderer/html_handlebars/search.rs | 2 - vendor/mdbook/src/theme/index.hbs | 78 ++----------------- vendor/mdbook/src/theme/mod.rs | 29 ------- vendor/mdbook/src/theme/searcher/mod.rs | 2 - 7 files changed, 11 insertions(+), 166 deletions(-) diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 11c83819ea..9ca59c7753 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -180,6 +180,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/vendor/mdbook/src/book/init.rs b/vendor/mdbook/src/book/init.rs index 909b8cbf0b..9f1388e3a9 100644 --- a/vendor/mdbook/src/book/init.rs +++ b/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/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs index fbaad5239a..7feb727f80 100644 --- a/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +++ b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs @@ -3,7 +3,7 @@ use config::{Config, HtmlConfig, Playpen}; use errors::*; use renderer::{RenderContext, Renderer}; use renderer::html_handlebars::helpers; -use theme::{self, Theme, playpen_editor}; +use theme::{self, Theme}; use utils; use std::collections::BTreeMap; @@ -145,61 +145,8 @@ impl HtmlHandlebars { write_file(destination, "book.js", &theme.js)?; write_file(destination, "book.css", &theme.css)?; write_file(destination, "favicon.png", &theme.favicon)?; - write_file(destination, "highlight.css", &theme.highlight_css)?; write_file(destination, "tomorrow-night.css", &theme.tomorrow_night_css)?; write_file(destination, "ayu-highlight.css", &theme.ayu_highlight_css)?; - write_file(destination, "highlight.js", &theme.highlight_js)?; - write_file(destination, "clipboard.min.js", &theme.clipboard_js)?; - write_file( - destination, - "_FontAwesome/css/font-awesome.css", - theme::FONT_AWESOME, - )?; - write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.eot", - theme::FONT_AWESOME_EOT, - )?; - write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.svg", - theme::FONT_AWESOME_SVG, - )?; - write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.ttf", - theme::FONT_AWESOME_TTF, - )?; - write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.woff", - theme::FONT_AWESOME_WOFF, - )?; - write_file( - destination, - "_FontAwesome/fonts/fontawesome-webfont.woff2", - theme::FONT_AWESOME_WOFF2, - )?; - 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 && playpen_config.copy_js { - // Load the editor - write_file(destination, "editor.js", playpen_editor::JS)?; - write_file(destination, "ace.js", playpen_editor::ACE_JS)?; - write_file(destination, "mode-rust.js", playpen_editor::MODE_RUST_JS)?; - write_file(destination, "theme-dawn.js", playpen_editor::THEME_DAWN_JS)?; - write_file(destination, - "theme-tomorrow_night.js", - playpen_editor::THEME_TOMORROW_NIGHT_JS, - )?; - } Ok(()) } diff --git a/vendor/mdbook/src/renderer/html_handlebars/search.rs b/vendor/mdbook/src/renderer/html_handlebars/search.rs index d49772f8b2..5986392c7e 100644 --- a/vendor/mdbook/src/renderer/html_handlebars/search.rs +++ b/vendor/mdbook/src/renderer/html_handlebars/search.rs @@ -29,8 +29,6 @@ pub fn create_files(search_config: &Search, destination: &Path, book: &Book) -> if search_config.copy_js { utils::fs::write_file(destination, "searchindex.js", index.as_bytes())?; utils::fs::write_file(destination, "searcher.js", searcher::JS)?; - utils::fs::write_file(destination, "mark.min.js", searcher::MARK_JS)?; - utils::fs::write_file(destination, "elasticlunr.min.js", searcher::ELASTICLUNR_JS)?; debug!("Copying search files ✓"); } diff --git a/vendor/mdbook/src/theme/index.hbs b/vendor/mdbook/src/theme/index.hbs index 5a9180decd..d1531dc1e3 100644 --- a/vendor/mdbook/src/theme/index.hbs +++ b/vendor/mdbook/src/theme/index.hbs @@ -12,15 +12,13 @@ - - - + - + @@ -31,47 +29,12 @@ {{#if mathjax_support}} - + {{/if}} - - - - - - -