-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp_paged.html
232 lines (201 loc) · 6.55 KB
/
wp_paged.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="$if(lang)$$lang$$else$en-US$endif$" xml:lang="$if(lang)$$lang$$else$en-US$endif$">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="dc:format" content="text/html">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width">
<meta property="dc:type" content="Text">
<meta property="dc:language" content="$if(lang)$$lang$$else$en$endif$">
<meta property="dc:title og:title" content="$pagetitle$">
$if(url)$<meta property="dc:identifier og:url" content="$url$">$endif$
<meta name="description" property="dc:description og:description schema:description" content="$if(description)$$description$$else$$pagetitle$$endif$">
$for(author-meta)$<meta name="author" content="$author-meta$">$endfor$
$if(date-meta)$<meta name="date" content="$date-meta$">$endif$
<meta name="keywords" property="dc:subject" content="$for(keywords-plain)$$keywords-plain$$sep$, $endfor$">
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
<script>
window.PagedConfig = {
before: async () => {
// Expand the citations links
let citations = document.querySelectorAll('.citation');
for (let citation of citations) {
let anchor = citation.querySelector('a');
if (!anchor) continue;
let span = document.createElement('span');
span.innerHTML = anchor.innerHTML
anchor.insertAdjacentElement('afterend', span)
let href = anchor.getAttribute('href')
anchor.remove();
let newAnchor = document.createElement('a');
newAnchor.setAttribute('href', href);
citation.insertAdjacentElement('beforebegin', newAnchor);
newAnchor.appendChild(citation);
}
// For the table captions, we would want to write this CSS rule:
// caption {caption-side: bottom-outside;}
// However, the bottom-outside value is not standard and not implemented in Chrome.
// So, we need to modify the DOM.
let tables = document.querySelectorAll('table');
for (let table of tables) {
let caption = table.querySelector('caption');
if (!caption) continue;
let tableContainer = document.createElement('div');
tableContainer.className = 'table-container';
table.insertAdjacentElement('beforebegin', tableContainer);
tableContainer.appendChild(table);
let bookdownIdentifier = caption.querySelector('span[id^="tab\\:"]');
if (!!bookdownIdentifier) {
let tableId = bookdownIdentifier.id;
bookdownIdentifier.removeAttribute('id');
table.id = tableId;
}
let newCaption = document.createElement('p');
newCaption.className = 'caption';
newCaption.innerHTML = caption.innerHTML;
caption.remove();
tableContainer.appendChild(newCaption);
}
}
}
</script>
$if(math)$
$if(mathjax)$
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function() {
let beforePaged = PagedConfig.before;
window.PagedConfig = {
before: async () => {
await beforePaged();
await new Promise((resolve, reject) => {
var script = document.createElement("script");
script.type = "text/javascript";
var src = `$mathjaxurl$` + "?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
window.MathJax = {
AuthorInit: () => {
MathJax.Hub.Register.StartupHook("Begin", () => {
MathJax.Hub.Queue(resolve);
});
}
};
document.getElementsByTagName("head")[0].appendChild(script);
});
}
};
})();
</script>
$endif$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
$if(highlightjs)$
<link rel="stylesheet"
href="$highlightjs$/$if(highlightjs-theme)$$highlightjs-theme$$else$default$endif$.css"
$if(html5)$$else$type="text/css" $endif$/>
<script src="$highlightjs$/highlight.js"></script>
<script type="text/javascript">
if (window.hljs && document.readyState && document.readyState === "complete") {
window.setTimeout(function() {
hljs.initHighlighting();
}, 0);
}
</script>
$endif$
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$
$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$
</head>
<body>
<div style="display:none" aria-hidden="true">
\(
\let\pkg=\mathbf
\let\proglang=\textsf
\let\code=\texttt
\newcommand{\E}{\mathsf{E}}
\newcommand{\VAR}{\mathsf{VAR}}
\newcommand{\COV}{\mathsf{COV}}
\newcommand{\Prob}{\mathsf{P}}
\)
</div>
$for(include-before)$
$include-before$
$endfor$
<br><br><br><br>
<article>
$if(title)$
<header id="$idprefix$header" class="title-page">
<h1 class="title">$title$</h1>
<br><br>
<span class="shorttitle" style="display: none;" aria-hidden="true">$if(shorttitle)$$shorttitle$$else$$title$$endif$</span>
$if(author)$
<div class="authors-container" role="list">
$for(author)$
<p class="author-item" role="listitem" style="--rank: $author.rank$;">
$if(author.data.name)$
<span class="author">$author.data.name$</span>
$if(author.data.affiliation)$
<br><span class="author-affil">$author.data.affiliation$</span>
$endif$
$if(author.data.email)$
<br><span class="author-email">$author.data.email$</span><!–– CL&PB -->
$endif$
$else$
<span class="author">$author.data$</span>
$endif$
</p>
$endfor$
</div>
$endif$
</header>
$endif$
<br><br>
<! –– CL&PB: add a date class to the front page (+)-->
<section class="date" property="dc:date">
$if(date)$
<h2 class="date">$date$</h2>
$endif$
</section>
<br><br>
<section class="download-link" property="dc:download-link">
$if(download-link)$
<h2 class="download-link">$download-link$</h2>
$endif$
</section>
<br><br>
<section class="abstract" property="dc:abstract">
$if(abstract)$
<h2 class="abstract-header">Abstract</h2>
<div class="abstract-content">
$abstract$
</div>
$endif$
<section class="keywords" role="list" aria-labelledby="$idprefix$keywords-header">
<p><span id="$idprefix$keywords-header" class="keywords-heading" aria-level="3" role="heading">Keywords</span>: $for(keywords)$<span role="listitem">$keywords$</span>$sep$, $endfor$.</p>
</section>
</section>
<main role="main">
$body$
</main>
</article>
$for(include-after)$
$include-after$
$endfor$
<script>
// when the page is about to reload via servr, remember the scroll position
document.addEventListener('servr:reload', function(e) {
sessionStorage.setItem('pagedown-scroll', window.scrollY);
});
</script>
</body>
</html>