From: Matthijs van Otterdijk Date: Sun, 5 Jul 2020 14:06:52 +0000 (+0100) Subject: Use local web resources instead of remote ones X-Git-Tag: archive/raspbian/1.43.0+dfsg1-1+rpi1^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=927c5bbd4c8b83e51d33db1f83fb63f542961f8a;p=rustc.git Use local web resources instead of remote ones Bug: https://github.com/azerupi/mdBook/issues/271 Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase the patch on top of a newer version. . Make sure the paths here match the ones in debian/rust-doc.links Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase the patch on top of a newer version. . Make sure the paths here match the ones in debian/rust-doc.links Gbp-Pq: Name d-0003-mdbook-strip-embedded-libs.patch --- diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index fb4611ed1c..aa6a7fb8fe 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -163,6 +163,11 @@ fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Opti { 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 f940e1faf7..16e6263ce6 100644 --- a/vendor/mdbook/src/book/init.rs +++ b/vendor/mdbook/src/book/init.rs @@ -148,12 +148,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 0be925622a..605c53e307 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 crate::config::{Config, HtmlConfig, Playpen}; use crate::errors::*; use crate::renderer::html_handlebars::helpers; use crate::renderer::{RenderContext, Renderer}; -use crate::theme::{self, playpen_editor, Theme}; +use crate::theme::{self, Theme}; use crate::utils; use std::borrow::Cow; @@ -114,7 +114,7 @@ impl HtmlHandlebars { &self, destination: &Path, theme: &Theme, - html_config: &HtmlConfig, + _html_config: &HtmlConfig, ) -> Result<()> { use crate::utils::fs::write_file; @@ -130,62 +130,8 @@ impl HtmlHandlebars { write_file(destination, "css/print.css", &theme.print_css)?; write_file(destination, "css/variables.css", &theme.variables_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 f184a592e8..6e4325c9ff 100644 --- a/vendor/mdbook/src/renderer/html_handlebars/search.rs +++ b/vendor/mdbook/src/renderer/html_handlebars/search.rs @@ -34,8 +34,6 @@ pub fn create_files(search_config: &Search, destination: &Path, book: &Book) -> format!("Object.assign(window.search, {});", 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 3a0cb4a8c2..a4c3e6a055 100644 --- a/vendor/mdbook/src/theme/index.hbs +++ b/vendor/mdbook/src/theme/index.hbs @@ -20,12 +20,10 @@ - - - + - + @@ -36,7 +34,7 @@ {{#if mathjax_support}} - + {{/if}} @@ -46,46 +44,6 @@ var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}"; - - - - - - - - -