prevent page break in code blocks + force wrap in pre tags (because you can't scroll...)

This commit is contained in:
Mathieu David 2015-09-05 17:39:00 +02:00
parent d03ae79765
commit 82a774c90e
2 changed files with 10 additions and 0 deletions

View File

@ -137,6 +137,7 @@ impl Renderer for HtmlHandlebars {
let rendered = try!(handlebars.render("index", &data));
let mut file = try!(utils::create_file(&book.get_dest().join("print").with_extension("html")));
try!(file.write_all(&rendered.into_bytes()));
output!("[*] Creating print.html ✓");
// Copy static files (js, css, images, ...)

View File

@ -296,4 +296,13 @@ html, body {
page-break-after: avoid;
/*break-after: avoid;*/
}
pre, code {
page-break-inside: avoid;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
}