Skip to content

Commit

Permalink
Merge pull request #147 from leomoon/master
Browse files Browse the repository at this point in the history
print view fixes
  • Loading branch information
leomoon authored Jul 13, 2024
2 parents 0be0f3a + 96d03ba commit d23c3f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.33
1.0.34
5 changes: 0 additions & 5 deletions helpers/priss-0.0.1/css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ body {
font-size: 12pt;
}


/* bidirectional language support */
h1,h2,h3,h4,h5,h6,p,pre,th,td{unicode-bidi:plaintext;text-align:start;}

/* HEADINGS */
h1,h2,h3,h4,h5,h6 {font-family: Helvetica, Arial, sans-serif;}
h1{font-size:19pt;}
Expand Down Expand Up @@ -54,4 +50,3 @@ tr {page-break-inside: avoid;}

/* HIDE UNNECESSARY ELEMENTS */
#header, #footer, #navigation, #sidebar {display:none;}

27 changes: 26 additions & 1 deletion print.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,37 @@
<link type="text/css" rel="stylesheet" href="<?= $APP->PATH ?>helpers/priss-0.0.1/css/print.css" media="print,screen,projection"/>
<link type="text/css" rel="stylesheet" href="<?= $APP->PATH ?>helpers/katex-0.16.7/css/katex.min.css" media="screen,projection">
<title><?= ($DOC->ID!="homepage"?$DOC->TITLE." - ":null).$APP->TITLE ?></title>
<!-- override some priss css -->
<style>
/* bidirectional language support */
h1,h2,h3,h4,h5,h6,p,pre,th,td{unicode-bidi:plaintext;text-align:start;}
/* these are set too small */
code, pre, blockquote, .mono {font-family: Consolas, 'Courier New', Courier, monospace; font-size: 11pt !important;}
/* fixes long strings making side menu freeze */
h1, h2, h3, h4, p, article ul li, article ol li, td {overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; hyphens: auto;}
/* based on markdown rules, tables should be 100% */
table{width:100%;}
/* font must be defined for international langs to display in monospace */
code, pre {font-family: Consolas, 'Courier New', Courier, monospace;}
/* hide video elements */
.video-responsive, .video-responsive iframe {display:none;}
</style>
<!-- start with details open -->
<script>
window.addEventListener('beforeprint', function() {
document.querySelectorAll('details').forEach(function(detail) {
detail.setAttribute('open', '');
});
});
</script>
</head>
<body>
<script src="<?= $APP->PATH ?>helpers/mermaid-9.4.3/mermaid.min.js"></script>
<script>mermaid.initialize({ startOnLoad: true,'theme':'neutral' });</script>
<?= $PARSER->text($DOC->loadContent())."\n" ?>
<script>window.print();</script>
<script src="<?= $APP->PATH ?>helpers/katex-0.16.7/js/katex.min.js"></script>
<script src="<?= $APP->PATH ?>helpers/katex-0.16.7/js/auto-render.js"></script>
<script>renderMathInElement(document.body);</script>
<script>window.print();</script>
</body>
</html>

0 comments on commit d23c3f3

Please sign in to comment.