-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
print.inc.php
54 lines (54 loc) · 2.29 KB
/
print.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Print
*
* @package WikiDocs
* @repository https://github.com/Zavy86/wikidocs
*
* @var WikiDocs $APP
* @var Document $DOC
* @var ParsedownExtra $PARSER
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<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; clear: both;}
/* 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;}
/* adjust image and text alignment */
img {display: block;margin: 1em auto;max-width: 100%;height: auto;float: 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 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>