Revert "Merge pull request #889 from s3bk/master" (#917)

* Revert "Merge pull request #889 from s3bk/master"

This reverts commit b30b58b565, reversing
changes made to c6220fba83.

* format tests :P
This commit is contained in:
Allen 2019-05-09 11:18:28 -07:00 committed by Dylan DPC
parent cb4a3e0711
commit df12cc55c8
7 changed files with 3 additions and 88 deletions

View File

@ -134,9 +134,6 @@ impl BookBuilder {
let mut general_css = File::create(cssdir.join("general.css"))?; let mut general_css = File::create(cssdir.join("general.css"))?;
general_css.write_all(theme::GENERAL_CSS)?; general_css.write_all(theme::GENERAL_CSS)?;
let mut book_css = File::create(cssdir.join("book.css"))?;
book_css.write_all(theme::BOOK_CSS)?;
let mut chrome_css = File::create(cssdir.join("chrome.css"))?; let mut chrome_css = File::create(cssdir.join("chrome.css"))?;
chrome_css.write_all(theme::CHROME_CSS)?; chrome_css.write_all(theme::CHROME_CSS)?;

View File

@ -123,7 +123,6 @@ impl HtmlHandlebars {
write_file(destination, "book.js", &theme.js)?; write_file(destination, "book.js", &theme.js)?;
write_file(destination, "css/general.css", &theme.general_css)?; write_file(destination, "css/general.css", &theme.general_css)?;
write_file(destination, "css/book.css", &theme.book_css)?;
write_file(destination, "css/chrome.css", &theme.chrome_css)?; write_file(destination, "css/chrome.css", &theme.chrome_css)?;
write_file(destination, "css/print.css", &theme.print_css)?; write_file(destination, "css/print.css", &theme.print_css)?;
write_file(destination, "css/variables.css", &theme.variables_css)?; write_file(destination, "css/variables.css", &theme.variables_css)?;
@ -558,7 +557,7 @@ fn fix_code_blocks(html: &str) -> String {
let after = &caps[3]; let after = &caps[3];
format!( format!(
r#"<code{before}class="block {classes}"{after}>"#, r#"<code{before}class="{classes}"{after}>"#,
before = before, before = before,
classes = classes, classes = classes,
after = after after = after

View File

@ -330,19 +330,11 @@ function playpen_text(playpen) {
stylesheets.ayuHighlight.disabled = false; stylesheets.ayuHighlight.disabled = false;
stylesheets.tomorrowNight.disabled = true; stylesheets.tomorrowNight.disabled = true;
stylesheets.highlight.disabled = true; stylesheets.highlight.disabled = true;
ace_theme = "ace/theme/tomorrow_night";
} else if (theme == 'book') {
stylesheets.ayuHighlight.disabled = true;
stylesheets.tomorrowNight.disabled = true;
stylesheets.highlight.disabled = true;
ace_theme = "ace/theme/tomorrow_night"; ace_theme = "ace/theme/tomorrow_night";
} else { } else {
stylesheets.ayuHighlight.disabled = true; stylesheets.ayuHighlight.disabled = true;
stylesheets.tomorrowNight.disabled = true; stylesheets.tomorrowNight.disabled = true;
stylesheets.highlight.disabled = false; stylesheets.highlight.disabled = false;
ace_theme = "ace/theme/dawn"; ace_theme = "ace/theme/dawn";
} }

View File

@ -1,65 +0,0 @@
body {
font-family: "Source Serif Pro", serif;
}
p {
text-align: justify;
line-height: 1.25em;
}
code {
font-family: "Source Code Pro", monospace;
padding: 0 !important;
}
code:not(.block) {
padding: 0 0 1pt 0 !important;
}
code:not(.block)::before {
content: '';
}
code:not(.block)::after {
content: '';
}
pre {
margin-left: 2em;
}
pre pre {
margin-left: 0;
}
pre.playpen > div.buttons {
float: right;
height: 0;
}
em {
font-style: italic;
}
h3::before {
content: "¶";
width: 1em;
display: inline-block;
margin-left: -1em;
}
h4::before {
content: "§";
width: 1em;
display: inline-block;
margin-left: -1em;
}
.left-buttons {
position: absolute;
}
.right-buttons {
position: absolute;
right: 0;
}
#menu-bar-sticky-container {
background-color: rgba(255, 255, 255, 0.8) !important;
}
@media print {
.menu-bar, .buttons {
display: none;
}
body {
font-size: 11pt;
}
}

View File

@ -17,18 +17,18 @@
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css"> <link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
<link rel="stylesheet" href="{{ path_to_root }}css/general.css"> <link rel="stylesheet" href="{{ path_to_root }}css/general.css">
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css"> <link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
<link rel="stylesheet" href="{{ path_to_root }}css/book.css">
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print"> <link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
<!-- Fonts --> <!-- Fonts -->
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css"> <link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Source+Serif+Pro" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500" rel="stylesheet" type="text/css">
<!-- Highlight.js Stylesheets --> <!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="{{ path_to_root }}highlight.css"> <link rel="stylesheet" href="{{ path_to_root }}highlight.css">
<link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css"> <link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
<link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css"> <link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
<!-- Custom theme stylesheets --> <!-- Custom theme stylesheets -->
{{#each additional_css}} {{#each additional_css}}
<link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}"> <link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
@ -109,7 +109,6 @@
<li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li> <li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li> <li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li> <li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li>
<li role="none"><button role="menuitem" class="theme" id="book">{{ theme_option "Book" }}</button></li>
</ul> </ul>
{{#if search_enabled}} {{#if search_enabled}}
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar"> <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">

View File

@ -15,7 +15,6 @@ pub static INDEX: &'static [u8] = include_bytes!("index.hbs");
pub static HEADER: &'static [u8] = include_bytes!("header.hbs"); pub static HEADER: &'static [u8] = include_bytes!("header.hbs");
pub static CHROME_CSS: &'static [u8] = include_bytes!("css/chrome.css"); pub static CHROME_CSS: &'static [u8] = include_bytes!("css/chrome.css");
pub static GENERAL_CSS: &'static [u8] = include_bytes!("css/general.css"); pub static GENERAL_CSS: &'static [u8] = include_bytes!("css/general.css");
pub static BOOK_CSS: &'static [u8] = include_bytes!("css/book.css");
pub static PRINT_CSS: &'static [u8] = include_bytes!("css/print.css"); pub static PRINT_CSS: &'static [u8] = include_bytes!("css/print.css");
pub static VARIABLES_CSS: &'static [u8] = include_bytes!("css/variables.css"); pub static VARIABLES_CSS: &'static [u8] = include_bytes!("css/variables.css");
pub static FAVICON: &'static [u8] = include_bytes!("favicon.png"); pub static FAVICON: &'static [u8] = include_bytes!("favicon.png");
@ -50,7 +49,6 @@ pub struct Theme {
pub header: Vec<u8>, pub header: Vec<u8>,
pub chrome_css: Vec<u8>, pub chrome_css: Vec<u8>,
pub general_css: Vec<u8>, pub general_css: Vec<u8>,
pub book_css: Vec<u8>,
pub print_css: Vec<u8>, pub print_css: Vec<u8>,
pub variables_css: Vec<u8>, pub variables_css: Vec<u8>,
pub favicon: Vec<u8>, pub favicon: Vec<u8>,
@ -82,7 +80,6 @@ impl Theme {
(theme_dir.join("book.js"), &mut theme.js), (theme_dir.join("book.js"), &mut theme.js),
(theme_dir.join("css/chrome.css"), &mut theme.chrome_css), (theme_dir.join("css/chrome.css"), &mut theme.chrome_css),
(theme_dir.join("css/general.css"), &mut theme.general_css), (theme_dir.join("css/general.css"), &mut theme.general_css),
(theme_dir.join("css/book.css"), &mut theme.book_css),
(theme_dir.join("css/print.css"), &mut theme.print_css), (theme_dir.join("css/print.css"), &mut theme.print_css),
( (
theme_dir.join("css/variables.css"), theme_dir.join("css/variables.css"),
@ -124,7 +121,6 @@ impl Default for Theme {
header: HEADER.to_owned(), header: HEADER.to_owned(),
chrome_css: CHROME_CSS.to_owned(), chrome_css: CHROME_CSS.to_owned(),
general_css: GENERAL_CSS.to_owned(), general_css: GENERAL_CSS.to_owned(),
book_css: BOOK_CSS.to_owned(),
print_css: PRINT_CSS.to_owned(), print_css: PRINT_CSS.to_owned(),
variables_css: VARIABLES_CSS.to_owned(), variables_css: VARIABLES_CSS.to_owned(),
favicon: FAVICON.to_owned(), favicon: FAVICON.to_owned(),
@ -180,7 +176,6 @@ mod tests {
"favicon.png", "favicon.png",
"css/chrome.css", "css/chrome.css",
"css/general.css", "css/general.css",
"css/book.css",
"css/print.css", "css/print.css",
"css/variables.css", "css/variables.css",
"book.js", "book.js",
@ -213,7 +208,6 @@ mod tests {
highlight_css: Vec::new(), highlight_css: Vec::new(),
tomorrow_night_css: Vec::new(), tomorrow_night_css: Vec::new(),
ayu_highlight_css: Vec::new(), ayu_highlight_css: Vec::new(),
book_css: Vec::new(),
highlight_js: Vec::new(), highlight_js: Vec::new(),
clipboard_js: Vec::new(), clipboard_js: Vec::new(),
}; };

View File

@ -419,7 +419,6 @@ fn theme_dir_overrides_work_correctly() {
dummy_book::assert_contains_strings(built_index, &["This is a modified index.hbs!"]); dummy_book::assert_contains_strings(built_index, &["This is a modified index.hbs!"]);
} }
#[test] #[test]
fn no_index_for_print_html() { fn no_index_for_print_html() {
let temp = DummyBook::new().build().unwrap(); let temp = DummyBook::new().build().unwrap();