@xiee/utils 1.13.34 → 1.13.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/callout.css +29 -14
- package/css/callout.min.css +1 -1
- package/css/callout.min.css.map +1 -1
- package/css/pages.css +4 -2
- package/css/pages.min.css +1 -1
- package/css/pages.min.css.map +1 -1
- package/js/callout.js +3 -3
- package/js/callout.min.js +1 -1
- package/js/callout.min.js.map +1 -1
- package/js/pages.js +27 -6
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/js/render-katex.js +53 -1
- package/js/render-katex.min.js +1 -1
- package/js/render-katex.min.js.map +1 -1
- package/mathjax-config.js +7 -0
- package/package.json +1 -1
package/css/callout.css
CHANGED
|
@@ -6,24 +6,39 @@ legend {
|
|
|
6
6
|
font-weight: bold;
|
|
7
7
|
border-style: groove;
|
|
8
8
|
padding: 2px .5em;
|
|
9
|
+
background: white;
|
|
10
|
+
}
|
|
11
|
+
.callout {
|
|
12
|
+
legend::before {
|
|
13
|
+
content: var(--callout-icon);
|
|
14
|
+
}
|
|
15
|
+
legend::after {
|
|
16
|
+
content: attr(data-legend);
|
|
17
|
+
text-transform: uppercase;
|
|
18
|
+
}
|
|
19
|
+
background: var(--callout-background);
|
|
20
|
+
&, legend { border-color: var(--callout-border); }
|
|
9
21
|
}
|
|
10
22
|
.callout-tip {
|
|
11
|
-
border
|
|
23
|
+
--callout-border: honeydew;
|
|
24
|
+
--callout-icon: "☆ ";
|
|
12
25
|
}
|
|
13
26
|
.callout-caution {
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
--callout-border: aqua;
|
|
28
|
+
--callout-background: azure;
|
|
29
|
+
--callout-icon: "☂ ";
|
|
16
30
|
}
|
|
17
31
|
.callout-important {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
--callout-border: gold;
|
|
33
|
+
--callout-background: lemonchiffon;
|
|
34
|
+
--callout-icon: "☀ ";
|
|
35
|
+
}
|
|
36
|
+
.callout-note {
|
|
37
|
+
--callout-border: lightskyblue;
|
|
38
|
+
--callout-icon: "⚑ ";
|
|
39
|
+
}
|
|
40
|
+
.callout-warning {
|
|
41
|
+
--callout-border: salmon;
|
|
42
|
+
--callout-background: mistyrose;
|
|
43
|
+
--callout-icon: "⚠ ";
|
|
29
44
|
}
|
package/css/callout.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fieldset{margin:1em auto;font-size:.9em}legend{border-style:groove;padding:2px .5em;font-weight:700}.callout-
|
|
1
|
+
fieldset{margin:1em auto;font-size:.9em}legend{background:#fff;border-style:groove;padding:2px .5em;font-weight:700}.callout{background:var(--callout-background);& legend:before{content:var(--callout-icon)}& legend:after{content:attr(data-legend);text-transform:uppercase}&,& legend{border-color:var(--callout-border)}}.callout-tip{--callout-border:honeydew;--callout-icon:"☆ "}.callout-caution{--callout-border:aqua;--callout-background:azure;--callout-icon:"☂ "}.callout-important{--callout-border:gold;--callout-background:lemonchiffon;--callout-icon:"☀ "}.callout-note{--callout-border:lightskyblue;--callout-icon:"⚑ "}.callout-warning{--callout-border:salmon;--callout-background:mistyrose;--callout-icon:"⚠ "}
|
|
2
2
|
/*# sourceMappingURL=callout.min.css.map */
|
package/css/callout.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,wCAIA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,wCAIA,4EAMA,8CACE,4CAGA,kEAKA,+CAEF,6DAIA,wFAKA,iGAKA,kEAIA","sources":["callout.css"],"sourcesContent":["fieldset {\n font-size: .9em;\n margin: 1em auto;\n}\nlegend {\n font-weight: bold;\n border-style: groove;\n padding: 2px .5em;\n background: white;\n}\n.callout {\n legend::before {\n content: var(--callout-icon);\n }\n legend::after {\n content: attr(data-legend);\n text-transform: uppercase;\n }\n background: var(--callout-background);\n &, legend { border-color: var(--callout-border); }\n}\n.callout-tip {\n --callout-border: honeydew;\n --callout-icon: \"☆ \";\n}\n.callout-caution {\n --callout-border: aqua;\n --callout-background: azure;\n --callout-icon: \"☂ \";\n}\n.callout-important {\n --callout-border: gold;\n --callout-background: lemonchiffon;\n --callout-icon: \"☀ \";\n}\n.callout-note {\n --callout-border: lightskyblue;\n --callout-icon: \"⚑ \";\n}\n.callout-warning {\n --callout-border: salmon;\n --callout-background: mistyrose;\n --callout-icon: \"⚠ \";\n}\n"],"names":[]}
|
package/css/pages.css
CHANGED
|
@@ -158,7 +158,9 @@
|
|
|
158
158
|
}
|
|
159
159
|
@media only screen {
|
|
160
160
|
.pagesjs {
|
|
161
|
-
|
|
161
|
+
&:has(.pagesjs-page) {
|
|
162
|
+
background-color: #f7f7f7;
|
|
163
|
+
}
|
|
162
164
|
.pagesjs-page {
|
|
163
165
|
background-color: white;
|
|
164
166
|
}
|
|
@@ -172,7 +174,7 @@
|
|
|
172
174
|
height: auto;
|
|
173
175
|
}
|
|
174
176
|
.footnotes {
|
|
175
|
-
margin:
|
|
177
|
+
margin: 2em auto 1em;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
}
|
package/css/pages.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px}@page{size:var(--paper-width)var(--paper-height);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .frontmatter,& .chapter{min-height:unset;box-shadow:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);page-break-after:always;flex-direction:column;justify-content:space-between;display:flex;& img{max-width:100%}& pre{white-space:pre-wrap}& .chapter-before,& .chapter-after,& .pencil:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.pagesjs-page:has(#TOC)~.pagesjs-page *):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}&>ul{columns:18em}& a{display:flex;&:after{content:attr(data-page-number);align-self:end}& .section-number{margin-right:.3em}& .dot-leader{border-bottom:1px dashed;flex:1 0 2em;margin:0 1ex 1ex}}}& .fullwidth{float:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));max-width:none;transform:none}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:first-child:is(.page-book *){padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .frontmatter{padding:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right))0 calc(0px - var(--paper-margin-left))}}}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(calc(0px - var(--side-width)))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:" "}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;position:relative}@media only screen{.pagesjs{background-color:#f7f7f7
|
|
1
|
+
:root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px}@page{size:var(--paper-width)var(--paper-height);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .frontmatter,& .chapter{min-height:unset;box-shadow:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);page-break-after:always;flex-direction:column;justify-content:space-between;display:flex;& img{max-width:100%}& pre{white-space:pre-wrap}& .chapter-before,& .chapter-after,& .pencil:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.pagesjs-page:has(#TOC)~.pagesjs-page *):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}&>ul{columns:18em}& a{display:flex;&:after{content:attr(data-page-number);align-self:end}& .section-number{margin-right:.3em}& .dot-leader{border-bottom:1px dashed;flex:1 0 2em;margin:0 1ex 1ex}}}& .fullwidth{float:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));max-width:none;transform:none}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:first-child:is(.page-book *){padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .frontmatter{padding:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right))0 calc(0px - var(--paper-margin-left))}}}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(calc(0px - var(--side-width)))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:" "}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;position:relative}@media only screen{.pagesjs{&:has(.pagesjs-page){background-color:#f7f7f7}& .pagesjs-page{background-color:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{height:auto}& .footnotes{margin:2em auto 1em}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{padding-top:0;padding-bottom:0}}}
|
|
2
2
|
/*# sourceMappingURL=pages.min.css.map */
|
package/css/pages.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,0PAYA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,wQAQE,qBAGA,2BAGA,gFAGA,8CAIE,yIAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,gIAOA,iFAMA,yCAEE,iDAGA,+IAIE,wDAGA,6FAKJ,wFAEE,iEAIF,2FAGA,wCAMJ,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,
|
|
1
|
+
{"version":3,"mappings":"AAAA,0PAYA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,wQAQE,qBAGA,2BAGA,gFAGA,8CAIE,yIAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,gIAOA,iFAMA,yCAEE,iDAGA,+IAIE,wDAGA,6FAKJ,wFAEE,iEAIF,2FAGA,wCAMJ,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,SACE,8CAGA,sCAGA,kCAIF,+BAEE,4BAGA,mCAKJ,aACE,wBAGE","sources":["pages.css"],"sourcesContent":[":root {\n --paper-width: 210mm;\n --paper-height: 297mm;\n --paper-margin-top: 40px;\n --paper-margin-right: 80px;\n --paper-margin-bottom: 40px;\n --paper-margin-left: 80px;\n --page-header-height: 40px;\n --page-header-bottom: 40px;\n --page-footer-height: 40px;\n --page-footer-top: 40px;\n}\n@page {\n size: var(--paper-width) var(--paper-height);\n margin: 0;\n}\n@page multiple {\n margin-top: var(--paper-margin-top);\n margin-bottom: var(--paper-margin-bottom);\n}\n.page-multiple {\n page: multiple;\n}\n.pagesjs {\n padding: 0;\n max-width: 100%;\n margin: 5mm;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 5mm;\n .frontmatter, .chapter {\n min-height: unset;\n box-shadow: none;\n }\n .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n \tpage-break-after: always;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n img {\n max-width: 100%;\n }\n pre {\n white-space: pre-wrap;\n }\n .chapter-before, .chapter-after, .pencil:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &:not(.pagesjs-page:has(#TOC) ~ .pagesjs-page *)::before {\n content: \"Contents\";\n display: block;\n font-weight: bold;\n font-size: 1.5em;\n margin-bottom: 1em;\n }\n & > ul {\n columns: 18em;\n }\n a {\n display: flex;\n &::after {\n content: attr(data-page-number);\n align-self: end;\n }\n .section-number {\n margin-right: .3em;\n }\n .dot-leader {\n flex: 1 0 2em;\n border-bottom: dashed 1px;\n margin: 0 1ex 1ex;\n }\n }\n }\n .fullwidth {\n float: none;\n max-width: none;\n width: var(--paper-width);\n margin-left: calc(0px - var(--paper-margin-left));\n transform: none;\n }\n .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:first-child:is(.page-book *) {\n padding: 0;\n .pagesjs-header, .pagesjs-footer {\n display: none;\n }\n .frontmatter {\n margin: 0;\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n height: 100%;\n .title {\n margin-top: calc(0px - var(--paper-margin-top));\n }\n & > div {\n margin: 0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left));\n }\n }\n }\n &:has(.side-left, .embed-left) .pagesjs-body {\n padding-left: calc(0px - var(--side-margin));\n .fullwidth {\n transform: translate(calc(0px - var(--side-width)));\n }\n }\n &:has(.side-right, .embed-right) .pagesjs-body {\n padding-right: calc(0px - var(--side-margin));\n }\n .side {\n font-size: .9em;\n background: none;\n }\n }\n}\n.pagesjs-header, .pagesjs-footer {\n font-size: .9em;\n display: flex;\n justify-content: space-between;\n}\n.pagesjs-header {\n flex: 0 0 var(--page-header-height);\n margin-bottom: var(--page-header-bottom);\n align-items: end;\n &::before {\n content: attr(data-main-title);\n }\n &::after {\n content: attr(data-page-title);\n }\n}\n.pagesjs-footer {\n flex: 0 0 var(--page-footer-height);\n margin-top: var(--page-footer-top);\n align-items: start;\n &::before {\n content: \" \";\n }\n &::after {\n content: attr(data-page-number);\n }\n}\n.pagesjs-body {\n flex-grow: 1;\n position: relative;\n}\n@media only screen {\n .pagesjs {\n &:has(.pagesjs-page) {\n background-color: #f7f7f7;\n }\n .pagesjs-page {\n background-color: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n height: auto;\n }\n .footnotes {\n margin: 2em auto 1em;\n }\n }\n}\n@media print {\n .pagesjs {\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0;\n padding-bottom: 0;\n }\n }\n}\n"],"names":[]}
|
package/js/callout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// turn <div class="callout-*"> to <fieldset><legend>*
|
|
2
2
|
document.querySelectorAll('div[class^="callout-"]').forEach(el => {
|
|
3
3
|
const f = document.createElement('fieldset');
|
|
4
|
-
f.className = el.className;
|
|
4
|
+
f.className = el.className; f.classList.add('callout');
|
|
5
5
|
// if the data-legend attribute exists, use its value as legend, otherwise use the class name
|
|
6
|
-
|
|
7
|
-
f.
|
|
6
|
+
f.insertAdjacentHTML('afterbegin', '<legend></legend>');
|
|
7
|
+
f.firstChild.dataset.legend = el.dataset.legend || el.classList[0].replace('callout-', '');
|
|
8
8
|
el.after(f);
|
|
9
9
|
f.append(...el.children);
|
|
10
10
|
el.remove();
|
package/js/callout.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
document.querySelectorAll('div[class^="callout-"]').forEach((e=>{const
|
|
1
|
+
document.querySelectorAll('div[class^="callout-"]').forEach((e=>{const l=document.createElement("fieldset");l.className=e.className,l.classList.add("callout"),l.insertAdjacentHTML("afterbegin","<legend></legend>"),l.firstChild.dataset.legend=e.dataset.legend||e.classList[0].replace("callout-",""),e.after(l),l.append(...e.children),e.remove()}));
|
package/js/callout.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["document","querySelectorAll","forEach","el","f","createElement","className","
|
|
1
|
+
{"version":3,"names":["document","querySelectorAll","forEach","el","f","createElement","className","classList","add","insertAdjacentHTML","firstChild","dataset","legend","replace","after","append","children","remove"],"sources":["callout.js"],"mappings":"AACAA,SAASC,iBAAiB,0BAA0BC,SAAQC,IAC1D,MAAMC,EAAIJ,SAASK,cAAc,YACjCD,EAAEE,UAAYH,EAAGG,UAAWF,EAAEG,UAAUC,IAAI,WAE5CJ,EAAEK,mBAAmB,aAAc,qBACnCL,EAAEM,WAAWC,QAAQC,OAAST,EAAGQ,QAAQC,QAAUT,EAAGI,UAAU,GAAGM,QAAQ,WAAY,IACvFV,EAAGW,MAAMV,GACTA,EAAEW,UAAUZ,EAAGa,UACfb,EAAGc,QAAQ","ignoreList":[]}
|
package/js/pages.js
CHANGED
|
@@ -47,19 +47,24 @@
|
|
|
47
47
|
}
|
|
48
48
|
// break elements that are relatively easy to break (such as <ul>)
|
|
49
49
|
function fragment(el, container, parent, page) {
|
|
50
|
-
|
|
50
|
+
const tag = el.tagName, is_code = tag === 'CODE';
|
|
51
|
+
// if <code>, keep fragmenting; otherwise exit when box fits
|
|
52
|
+
if (!(is_code && container) && box.scrollHeight <= H) return;
|
|
51
53
|
const box_cur = page || box, el2 = el.cloneNode(); // shallow clone (wrapper only)
|
|
52
54
|
// add the clone to current box, and move original el to next box
|
|
53
55
|
container ? container.append(el2) : (
|
|
54
56
|
box_body.append(el2), box_cur.after(newPage()), box_body.append(el)
|
|
55
57
|
);
|
|
56
|
-
//
|
|
57
|
-
if (
|
|
58
|
+
// fragment <pre>'s <code> and <div>'s single child (e.g., #TOC > ul)
|
|
59
|
+
if (tag === 'PRE') {
|
|
60
|
+
const code = el.firstElementChild;
|
|
61
|
+
code?.tagName == 'CODE' && /\n/.test(code.innerHTML) && fragment(code, el2, el, box_cur);
|
|
62
|
+
} else if (tag === 'DIV' && nChild(el) === 1) {
|
|
58
63
|
fragment(el.firstElementChild, el2, el, box_cur);
|
|
59
64
|
}
|
|
60
65
|
const prev = el2.previousElementSibling;
|
|
61
66
|
// keep moving el's first item to el2 until page height > H
|
|
62
|
-
if (['UL', 'BLOCKQUOTE'].
|
|
67
|
+
if (['UL', 'BLOCKQUOTE'].includes(tag) && nChild(el) > 1) while (true) {
|
|
63
68
|
const item = el.firstChild;
|
|
64
69
|
if (!item) break;
|
|
65
70
|
el2.append(item);
|
|
@@ -69,8 +74,23 @@
|
|
|
69
74
|
break;
|
|
70
75
|
}
|
|
71
76
|
}
|
|
77
|
+
// split lines in <code> and try to move them into el2 line by line
|
|
78
|
+
if (is_code) {
|
|
79
|
+
const code = el.innerHTML.split('\n'), code2 = [];
|
|
80
|
+
for (let i of code) {
|
|
81
|
+
code2.push(i); el2.innerHTML = code2.join('\n');
|
|
82
|
+
if (box_cur.scrollHeight > H) {
|
|
83
|
+
code2.pop(); el2.innerHTML = code2.join('\n');
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (code2.length > 0) {
|
|
88
|
+
el.innerHTML = code.slice(code2.length).join('\n');
|
|
89
|
+
if (removeBlank(parent)) return; // exit if <pre> is empty
|
|
90
|
+
}
|
|
91
|
+
}
|
|
72
92
|
// if the clone is empty, remove it, otherwise keep fragmenting the remaining el
|
|
73
|
-
if (!removeBlank(el2) || prev) fragment(container ? parent : el);
|
|
93
|
+
if (!removeBlank(el2) || is_code || prev) fragment(container ? parent : el);
|
|
74
94
|
}
|
|
75
95
|
|
|
76
96
|
// use data-short-title of a header if exists, and fall back to inner text
|
|
@@ -174,7 +194,8 @@
|
|
|
174
194
|
|
|
175
195
|
// add page numbers to TOC with data-* attributes
|
|
176
196
|
$$('#TOC a[href^="#"]').forEach(a => {
|
|
177
|
-
const
|
|
197
|
+
const id = CSS.escape(a.getAttribute('href').replace(/^#/, '')),
|
|
198
|
+
p = $(`.pagesjs-page:has(#${id}) .pagesjs-header`);
|
|
178
199
|
a.dataset.pageNumber = p ? p.dataset.pageNumber : '';
|
|
179
200
|
});
|
|
180
201
|
}
|
package/js/pages.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}function r(e){return e.childElementCount}const a=e.createElement("div"),
|
|
1
|
+
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}function r(e){return e.childElementCount}const a=e.createElement("div"),i=n("h1").length>1;a.className="pagesjs-page",a.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let s,o,c,l=[];function d(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",a.innerHTML),s=e||a.cloneNode(!0),o=s.children[1],l.length&&s.classList.add(...l),s}function f(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function p(e){if(e.classList.contains("pagesjs-page"))return s.after(d(e)),void(r(e)>3&&(o.append(...[...e.children].slice(3)),s.after(d())));if(s.scrollHeight>c){const[e,t]=[s,o];e.after(d()),r(t)>1&&o.append(t.lastChild)}o.append(e),g(e)}function g(e,t,n,a){const i=e.tagName,l="CODE"===i;if((!l||!t)&&s.scrollHeight<=c)return;const p=a||s,h=e.cloneNode();if(t?t.append(h):(o.append(h),p.after(d()),o.append(e)),"PRE"===i){const t=e.firstElementChild;"CODE"==t?.tagName&&/\n/.test(t.innerHTML)&&g(t,h,e,p)}else"DIV"===i&&1===r(e)&&g(e.firstElementChild,h,e,p);const u=h.previousElementSibling;if(["UL","BLOCKQUOTE"].includes(i)&&r(e)>1)for(;;){const t=e.firstChild;if(!t)break;if(h.append(t),p.scrollHeight>c){(u||r(h)>1)&&e.insertBefore(t,e.firstChild);break}}if(l){const t=e.innerHTML.split("\n"),r=[];for(let e of t)if(r.push(e),h.innerHTML=r.join("\n"),p.scrollHeight>c){r.pop(),h.innerHTML=r.join("\n");break}if(r.length>0&&(e.innerHTML=t.slice(r.length).join("\n"),f(n)))return}(!f(h)||l||u)&&g(t?n:e)}function h(e){return e&&(e.dataset.shortTitle||e.innerText)}const u=h(t("h1.title, .frontmatter h1, .title, h1")),m=(i?"h1":"h2")+":not(.frontmatter *)",b=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));function E(){if("complete"!==e.readyState)return setTimeout(E,10);const r=e.body.classList;if(r.contains("pagesjs"))return;r.add("pagesjs"),i&&r.add("page-book"),e.body.insertAdjacentElement("afterbegin",d()),c=s.clientHeight||window.innerHeight,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),r.add("pagesjs-filling"),[t(".frontmatter"),t("#TOC"),t(".abstract")].forEach((e=>{e&&(p(e),i&&s.after(d()))})),n(".body").forEach((e=>{l=["chapter","appendix"].filter((t=>e.classList.contains(t))),i&&(""===s.innerText?d(s):s.after(d())),[...e.children].map(p),f(e.parentNode),f(e)})),r.remove("pagesjs-filling"),n('#TOC a[href^="#"]').forEach((t=>{const n=e.createElement("span"),r=t.firstElementChild;for(r?.classList.contains("section-number")?r.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));let a,o=0;n(".pagesjs-page").forEach((e=>{if(f(e))return;if(i){if(t(".frontmatter",e))return;t(m,e)&&(a="")}const r=function(e){let t=+e.dataset.pagesOffset;if(t)return t;const r=e.scrollHeight;if(t=Math.ceil(r/c),t<=1)return t;const a=b.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!a)return t;function i(){return Math.ceil((r+(t-1)*a)/c)}let s=i();for(;s>t;)t=s,s=i();return t}(e);r>1&&e.classList.add("page-multiple"),o+=r,e.classList.add("page-"+(o%2==0?"even":"odd"));const s={pageNumber:o,mainTitle:u,pageTitle:a};let l;[e.children[0],e.children[2]].forEach((e=>{for(const t in s)s[t]&&(e.dataset[t]=s[t])})),a=h([...n(m,e)].pop())||a,n(".footnotes",e).forEach(((t,n)=>{0===n?(l=t,e.children[1].after(t)):(l.append(...t.children),t.remove())}))})),n('#TOC a[href^="#"]').forEach((e=>{const n=t(`.pagesjs-page:has(#${CSS.escape(e.getAttribute("href").replace(/^#/,""))}) .pagesjs-header`);e.dataset.pageNumber=n?n.dataset.pageNumber:""}))}addEventListener("beforeprint",E);let j=sessionStorage.getItem("pagesjs");j&&E(),addEventListener("keypress",(e=>"p"===e.key&&(E(),j=j?"":"1",sessionStorage.setItem("pagesjs",j),j||location.reload())))})(document);
|
package/js/pages.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","className","innerHTML","box","box_body","H","box_cls","newPage","insertAdjacentHTML","cloneNode","children","classList","add","removeBlank","v","innerText","trim","remove","fill","contains","after","append","slice","scrollHeight","box2","box_body2","lastChild","fragment","container","parent","page","box_cur","el2","
|
|
1
|
+
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","className","innerHTML","box","box_body","H","box_cls","newPage","insertAdjacentHTML","cloneNode","children","classList","add","removeBlank","v","innerText","trim","remove","fill","contains","after","append","slice","scrollHeight","box2","box_body2","lastChild","fragment","container","parent","page","tag","tagName","is_code","box_cur","el2","code","firstElementChild","test","prev","previousElementSibling","includes","item","firstChild","insertBefore","split","code2","i","push","join","pop","shortTitle","h","dataset","main","ps","tb","map","getComputedStyle","documentElement","getPropertyValue","replace","paginate","readyState","setTimeout","cls","body","insertAdjacentElement","clientHeight","window","innerHeight","forEach","filter","parentNode","a","n","nextSibling","pageNumber","page_title","N","pagesOffset","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","info","mainTitle","pageTitle","ft","key","p","CSS","escape","getAttribute","addEventListener","pg","sessionStorage","getItem","e","setItem","location","reload","document"],"sources":["pages.js"],"mappings":"AAEA,CAACA,IACC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAKA,EAAGG,iBAAiBJ,GAAK,EAAI,CAClE,SAASK,EAAOJ,GAAM,OAAOA,EAAGK,iBAAmB,CAEnD,MAAMC,EAAMT,EAAEU,cAAc,OAAQC,EAAON,EAAG,MAAMO,OAAS,EAC7DH,EAAII,UAAY,eAChBJ,EAAIK,UAAY,2GAGhB,IAAIC,EAAKC,EAAUC,EAAGC,EAAU,GAChC,SAASC,EAAQhB,GAIf,OAHAA,IAAOF,EAAE,gBAAiBE,IAAOA,EAAGiB,mBAAmB,aAAcX,EAAIK,WACzEC,EAAMZ,GAAMM,EAAIY,WAAU,GAAOL,EAAWD,EAAIO,SAAS,GACzDJ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AAK,GAAK,IAAKC,eAAeG,QAAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EA9MD,CA8MGC","ignoreList":[]}
|
package/js/render-katex.js
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
// support \ref \eqref \label for KaTeX, based on https://github.com/KaTeX/KaTeX/issues/2003
|
|
2
|
+
(d => {
|
|
3
|
+
renderMathInElement(d.body, {
|
|
4
|
+
strict: false, throwOnError: false,
|
|
5
|
+
trust: context => ['\\href', '\\htmlId', '\\htmlClass'].includes(context.command),
|
|
6
|
+
macros: {
|
|
7
|
+
'\\eqref': '\\htmlClass{ktx-eqref}{\\href{###1}{(\\text{#1})}}',
|
|
8
|
+
'\\ref': '\\htmlClass{ktx-ref}{\\href{###1}{\\text{#1}}}',
|
|
9
|
+
'\\label': '\\htmlClass{ktx-label}{\\htmlId{#1}{}}'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function $(s, el = d) { return el.querySelector(s); }
|
|
13
|
+
function $$(s, el = d) { return el.querySelectorAll(s); }
|
|
14
|
+
const xrefs = $$('.katex:has(:is(.ktx-ref, .ktx-eqref))');
|
|
15
|
+
if (!xrefs.length) return;
|
|
16
|
+
|
|
17
|
+
const M = {}; // map equation labels to numbers
|
|
18
|
+
let n = 0;
|
|
19
|
+
// scan all display expressions for labels and tags
|
|
20
|
+
$$('.katex-display').forEach(el => {
|
|
21
|
+
const s = '.ktx-label > [id]', lab = $(s, el);
|
|
22
|
+
if (!lab) return; // no labels found
|
|
23
|
+
// find the common ancestor of all labels and the label of each row of equation
|
|
24
|
+
const ids = [...$$(':scope > [style]', lab.offsetParent.parentNode)].map(el => {
|
|
25
|
+
return $(s, el)?.id || '';
|
|
26
|
+
});
|
|
27
|
+
// find all tags
|
|
28
|
+
const tags = [...$$('.tag > .vlist-t > .vlist-r > .vlist > [style]', el)].map(tag => {
|
|
29
|
+
// if tag is automatically generated by CSS counter, we have to compute it
|
|
30
|
+
// manually because there is no way to access CSS counters from JS
|
|
31
|
+
return $('.eqn-num', tag) ? `(${++n})` : tag.innerText.trim();
|
|
32
|
+
});
|
|
33
|
+
if (ids.length === tags.length) {
|
|
34
|
+
ids.forEach((id, i) => id && (M[id] = tags[i]));
|
|
35
|
+
} else {
|
|
36
|
+
console.warn('labels and tags differ in length in ', el, ids, tags);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// resolve innerText of cross-ref links
|
|
41
|
+
function resolveRefLink(a, paren) {
|
|
42
|
+
const id = a.getAttribute('href').replace(/^#/, ''), tag = M[id];
|
|
43
|
+
a.innerText = tag ? (paren ? tag : tag.replace(/^\(|\)$/g, '')) : '???';
|
|
44
|
+
a.classList.add(`cross-ref-eq${paren ? 'n' : ''}`);
|
|
45
|
+
}
|
|
46
|
+
xrefs.forEach(el => {
|
|
47
|
+
const a = $('a', el);
|
|
48
|
+
if (!a) return;
|
|
49
|
+
const paren = a.parentNode.classList.contains('ktx-eqref'), p = el.parentNode;
|
|
50
|
+
p.after(a); p.remove(); // remove KaTeX's HTML for links to make their style consistent with surrounding text
|
|
51
|
+
resolveRefLink(a, paren);
|
|
52
|
+
});
|
|
53
|
+
})(document);
|
package/js/render-katex.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
renderMathInElement(
|
|
1
|
+
(e=>{function t(t,r=e){return r.querySelector(t)}function r(t,r=e){return r.querySelectorAll(t)}renderMathInElement(e.body,{strict:!1,throwOnError:!1,trust:e=>["\\href","\\htmlId","\\htmlClass"].includes(e.command),macros:{"\\eqref":"\\htmlClass{ktx-eqref}{\\href{###1}{(\\text{#1})}}","\\ref":"\\htmlClass{ktx-ref}{\\href{###1}{\\text{#1}}}","\\label":"\\htmlClass{ktx-label}{\\htmlId{#1}{}}"}});const n=r(".katex:has(:is(.ktx-ref, .ktx-eqref))");if(!n.length)return;const s={};let l=0;r(".katex-display").forEach((e=>{const n=".ktx-label > [id]",a=t(n,e);if(!a)return;const o=[...r(":scope > [style]",a.offsetParent.parentNode)].map((e=>t(n,e)?.id||"")),c=[...r(".tag > .vlist-t > .vlist-r > .vlist > [style]",e)].map((e=>t(".eqn-num",e)?`(${++l})`:e.innerText.trim()));o.length===c.length?o.forEach(((e,t)=>e&&(s[e]=c[t]))):console.warn("labels and tags differ in length in ",e,o,c)})),n.forEach((e=>{const r=t("a",e);if(!r)return;const n=r.parentNode.classList.contains("ktx-eqref"),l=e.parentNode;l.after(r),l.remove(),function(e,t){const r=e.getAttribute("href").replace(/^#/,""),n=s[r];e.innerText=n?t?n:n.replace(/^\(|\)$/g,""):"???",e.classList.add("cross-ref-eq"+(t?"n":""))}(r,n)}))})(document);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","renderMathInElement","body","strict","throwOnError","trust","context","includes","command","macros","xrefs","length","M","n","forEach","lab","ids","offsetParent","parentNode","map","id","tags","tag","innerText","trim","i","console","warn","a","paren","classList","contains","p","after","remove","getAttribute","replace","add","resolveRefLink","document"],"sources":["render-katex.js"],"mappings":"AACA,CAACA,IAUC,SAASC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,EAAGC,cAAcF,EAAI,CACpD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAGG,iBAAiBJ,EAAI,CAVxDK,oBAAoBP,EAAEQ,KAAM,CAC1BC,QAAQ,EAAOC,cAAc,EAC7BC,MAAOC,GAAW,CAAC,SAAU,WAAY,eAAeC,SAASD,EAAQE,SACzEC,OAAQ,CACN,UAAW,qDACX,QAAS,iDACT,UAAW,4CAKf,MAAMC,EAAQX,EAAG,yCACjB,IAAKW,EAAMC,OAAQ,OAEnB,MAAMC,EAAI,CAAC,EACX,IAAIC,EAAI,EAERd,EAAG,kBAAkBe,SAAQjB,IAC3B,MAAMD,EAAI,oBAAqBmB,EAAMpB,EAAEC,EAAGC,GAC1C,IAAKkB,EAAK,OAEV,MAAMC,EAAM,IAAIjB,EAAG,mBAAoBgB,EAAIE,aAAaC,aAAaC,KAAItB,GAChEF,EAAEC,EAAGC,IAAKuB,IAAM,KAGnBC,EAAO,IAAItB,EAAG,gDAAiDF,IAAKsB,KAAIG,GAGrE3B,EAAE,WAAY2B,GAAO,MAAMT,KAAOS,EAAIC,UAAUC,SAErDR,EAAIL,SAAWU,EAAKV,OACtBK,EAAIF,SAAQ,CAACM,EAAIK,IAAML,IAAOR,EAAEQ,GAAMC,EAAKI,MAE3CC,QAAQC,KAAK,uCAAwC9B,EAAImB,EAAKK,EAChE,IASFX,EAAMI,SAAQjB,IACZ,MAAM+B,EAAIjC,EAAE,IAAKE,GACjB,IAAK+B,EAAG,OACR,MAAMC,EAAQD,EAAEV,WAAWY,UAAUC,SAAS,aAAcC,EAAInC,EAAGqB,WACnEc,EAAEC,MAAML,GAAII,EAAEE,SAThB,SAAwBN,EAAGC,GACzB,MAAMT,EAAKQ,EAAEO,aAAa,QAAQC,QAAQ,KAAM,IAAKd,EAAMV,EAAEQ,GAC7DQ,EAAEL,UAAYD,EAAOO,EAAQP,EAAMA,EAAIc,QAAQ,WAAY,IAAO,MAClER,EAAEE,UAAUO,IAAI,gBAAeR,EAAQ,IAAM,IAC/C,CAMES,CAAeV,EAAGC,EAAM,GAE3B,EAnDD,CAmDGU","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// enable MathJax equation numbering: https://docs.mathjax.org/en/latest/input/tex/eqnumbers.html
|
|
2
|
+
(() => {
|
|
3
|
+
m = window.MathJax || {}; // make sure not to override existing config
|
|
4
|
+
m.tex = m.tex || {};
|
|
5
|
+
m.tex.tags = m.tex.tags || 'ams';
|
|
6
|
+
window.MathJax = m;
|
|
7
|
+
})();
|