From 9bf0e32b22c3dccd69eb128ffaf2ebb4c8d2961b Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Fri, 27 Apr 2018 12:32:56 -0500 Subject: [PATCH 1/6] Update print styles for new sidebar behavior --- src/theme/book.css | 13 +++++++------ src/theme/stylus/print.styl | 10 +++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index c5c02f2330..cc44cfe174 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -1322,12 +1322,14 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta .mobile-nav-chapters { display: none; } - #page-wrapper { - left: 0; - overflow-y: initial; - } #page-wrapper.page-wrapper { - padding-left: 0px; + -webkit-transform: none; + -moz-transform: none; + -o-transform: none; + -ms-transform: none; + transform: none; + margin-left: 0px; + overflow-y: initial; } #content { max-width: none; @@ -1361,7 +1363,6 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta h6 { page-break-inside: avoid; page-break-after: avoid; -/*break-after: avoid*/ } pre, code { diff --git a/src/theme/stylus/print.styl b/src/theme/stylus/print.styl index 5b5086efcf..0709969018 100644 --- a/src/theme/stylus/print.styl +++ b/src/theme/stylus/print.styl @@ -7,13 +7,10 @@ display: none } - #page-wrapper { - left: 0; - overflow-y: initial; - } - #page-wrapper.page-wrapper { - padding-left: 0px; + transform: none; + margin-left: 0px; + overflow-y: initial; } #content { @@ -46,7 +43,6 @@ h1, h2, h3, h4, h5, h6 { page-break-inside: avoid page-break-after: avoid - /*break-after: avoid*/ } pre, code { From b1fd7321fdb25a2e41bb29edcd2df47b89807490 Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Fri, 27 Apr 2018 12:56:03 -0500 Subject: [PATCH 2/6] Hide copy icons in print output --- src/theme/book.css | 3 +++ src/theme/stylus/print.styl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/theme/book.css b/src/theme/book.css index cc44cfe174..e8df1d9c9e 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -1373,6 +1373,9 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta white-space: -o-pre-wrap /* Opera 7 */; word-wrap: break-word /* Internet Explorer 5.5+ */; } + .fa { + display: none !important; + } } .tooltiptext { position: absolute; diff --git a/src/theme/stylus/print.styl b/src/theme/stylus/print.styl index 0709969018..218f7dba04 100644 --- a/src/theme/stylus/print.styl +++ b/src/theme/stylus/print.styl @@ -53,4 +53,8 @@ white-space: -o-pre-wrap /* Opera 7 */ word-wrap: break-word /* Internet Explorer 5.5+ */ } + + .fa { + display: none !important + } } From 6fbed8710c202d365aa8394def627aed36306509 Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Fri, 27 Apr 2018 13:01:04 -0500 Subject: [PATCH 3/6] Wait for mathjax rendering to complete before printing --- src/theme/index.hbs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 5a9180decd..eaa700c78a 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -212,14 +212,6 @@ {{/if}} - {{#if is_print}} - - {{/if}} - {{#if playpen_js}} @@ -246,5 +238,21 @@ {{/each}} + {{#if is_print}} + {{#if mathjax_support}} + + {{else}} + + {{/if}} + {{/if}} + From c0389abb319703808998bf4d0eb06ea1eed766dc Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Fri, 27 Apr 2018 13:26:33 -0500 Subject: [PATCH 4/6] Remove old wrapping css Browsers this old are already hilariously broken, so we don't need these fallbacks. --- src/theme/book.css | 6 +----- src/theme/stylus/print.styl | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index e8df1d9c9e..6013ab1b22 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -1367,11 +1367,7 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta 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+ */; + white-space: pre-wrap; } .fa { display: none !important; diff --git a/src/theme/stylus/print.styl b/src/theme/stylus/print.styl index 218f7dba04..931af1a4d3 100644 --- a/src/theme/stylus/print.styl +++ b/src/theme/stylus/print.styl @@ -47,11 +47,7 @@ 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+ */ + white-space: pre-wrap } .fa { From 7dfa1b8aa7754cdcf795828da228ad47a4a61065 Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Sun, 29 Apr 2018 13:01:36 -0500 Subject: [PATCH 5/6] Change mathjax script type Chrome won't execute this if it's not marked as js --- src/theme/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/index.hbs b/src/theme/index.hbs index eaa700c78a..1f7e4fd15b 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -240,7 +240,7 @@ {{#if is_print}} {{#if mathjax_support}} - {{else}} {{/if}}