Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/theme/book.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1361,16 +1363,14 @@ 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 {
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;
}
}
.tooltiptext {
Expand Down
26 changes: 18 additions & 8 deletions src/theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,6 @@
</script>
{{/if}}

{{#if is_print}}
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
window.print();
})
</script>
{{/if}}

{{#if playpen_js}}
<script src="ace.js" type="text/javascript" charset="utf-8"></script>
<script src="editor.js" type="text/javascript" charset="utf-8"></script>
Expand All @@ -246,5 +238,23 @@
<script type="text/javascript" src="{{this}}"></script>
{{/each}}

{{#if is_print}}
{{#if mathjax_support}}
<script type="text/javascript">
window.addEventListener('load', function() {
MathJax.Hub.Register.StartupHook('End', function() {
window.setTimeout(window.print, 100);
});
});
</script>
{{else}}
<script type="text/javascript">
window.addEventListener('load', function() {
window.setTimeout(window.print, 100);
});
</script>
{{/if}}
{{/if}}

</body>
</html>
20 changes: 8 additions & 12 deletions src/theme/stylus/print.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -46,15 +43,14 @@
h1, h2, h3, h4, h5, h6 {
page-break-inside: avoid
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+ */
white-space: pre-wrap
}

.fa {
display: none !important
}
}