@xiee/utils 1.13.61 → 1.13.63
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/default.css +8 -5
- package/css/default.min.css +1 -1
- package/css/default.min.css.map +1 -1
- package/css/manual.css +2 -0
- package/css/manual.min.css +1 -1
- package/css/manual.min.css.map +1 -1
- package/css/pages.css +3 -4
- package/css/pages.min.css +1 -1
- package/css/pages.min.css.map +1 -1
- package/js/toc-highlight.js +11 -11
- package/js/toc-highlight.min.js +1 -1
- package/js/toc-highlight.min.js.map +1 -1
- package/package.json +1 -1
package/css/default.css
CHANGED
|
@@ -28,14 +28,17 @@ pre > code {
|
|
|
28
28
|
border-left: 2px solid;
|
|
29
29
|
&:hover { opacity: inherit; }
|
|
30
30
|
}
|
|
31
|
-
.box, .figure, .table
|
|
31
|
+
.box, .figure, .table { margin: 1em auto; }
|
|
32
32
|
div > .caption { padding: 1px 1em; }
|
|
33
33
|
.figure { p:has(img), pre:has(svg) { text-align: center; } }
|
|
34
34
|
.flex-col { display: flex; justify-content: space-between; }
|
|
35
|
-
table {
|
|
35
|
+
table :is(th, td) { padding: 5px; font-variant-numeric: tabular-nums; }
|
|
36
|
+
table:not([class]) {
|
|
37
|
+
margin: 1em auto;
|
|
36
38
|
border-top: 1px solid #666;
|
|
37
39
|
thead th { border-bottom: 1px solid #ddd; }
|
|
38
|
-
|
|
40
|
+
}
|
|
41
|
+
table:not([class]), .table-striped {
|
|
39
42
|
thead, tfoot, tr:nth-child(even) { background: whitesmoke; }
|
|
40
43
|
}
|
|
41
44
|
blockquote {
|
|
@@ -52,7 +55,7 @@ hr, .footnotes::before { border: 1px dashed #ddd; }
|
|
|
52
55
|
ul { list-style: none; padding-left: 1em; }
|
|
53
56
|
ul ul { border-left: 1px solid lightsteelblue; }
|
|
54
57
|
}
|
|
55
|
-
table, .body h2 { border-bottom: 1px solid #666; }
|
|
58
|
+
table:not([class]), .body h2 { border-bottom: 1px solid #666; }
|
|
56
59
|
.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
|
|
57
60
|
.main-number::after { content: "."; }
|
|
58
61
|
span[class^="ref-number-"] { font-weight: bold; }
|
|
@@ -87,7 +90,7 @@ section.footnotes {
|
|
|
87
90
|
|
|
88
91
|
@media print {
|
|
89
92
|
body { max-width: 100%; }
|
|
90
|
-
tr, img {
|
|
93
|
+
tr, img { break-inside: avoid; }
|
|
91
94
|
}
|
|
92
95
|
@media only screen and (min-width: 992px) {
|
|
93
96
|
body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }
|
package/css/default.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
body{max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre)>code,code[class],div>.caption{background-color:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none),.box,.figure,.table{background-color:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table
|
|
1
|
+
body{max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre)>code,code[class],div>.caption{background-color:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none),.box,.figure,.table{background-color:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table :is(th,td){font-variant-numeric:tabular-nums;padding:5px}table:not([class]){border-top:1px solid #666;margin:1em auto;& thead th{border-bottom:1px solid #ddd}}table:not([class]),.table-striped{& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}&>ul{padding:0}& ul{padding-left:1em;list-style:none}& ul ul{border-left:1px solid #b0c4de}}table:not([class]),.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
|
|
2
2
|
/*# sourceMappingURL=default.min.css.map */
|
package/css/default.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,oFAOA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,iEACA,6HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,
|
|
1
|
+
{"version":3,"mappings":"AAAA,oFAOA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,iEACA,6HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,oCACA,6BACA,QAAU,+CACV,qDACA,+DACA,6DAGE,yCAEF,kCACE,uDAEF,2EAMA,4CACA,+BACA,KACE,yBACA,eACA,sCACA,uCAEF,yDACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAKA,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n}\nbody, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre { white-space: pre-wrap; word-break: break-word; }\npre code { display: block; padding: 1em; overflow-x: auto; }\ncode { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }\n:not(pre) > code, code[class], div > .caption { background-color: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none), .box, .figure, .table { background-color: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable :is(th, td) { padding: 5px; font-variant-numeric: tabular-nums; }\ntable:not([class]) {\n margin: 1em auto;\n border-top: 1px solid #666;\n thead th { border-bottom: 1px solid #ddd; }\n}\ntable:not([class]), .table-striped {\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n & > ul { padding: 0; }\n ul { list-style: none; padding-left: 1em; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\ntable:not([class]), .body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
|
package/css/manual.css
CHANGED
package/css/manual.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.table-full{width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
|
|
1
|
+
.table-full{border-top:1px solid #666;border-bottom:1px solid #666;width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
|
|
2
2
|
/*# sourceMappingURL=manual.min.css.map */
|
package/css/manual.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AACA,
|
|
1
|
+
{"version":3,"mappings":"AACA,8EAIE,6BAEE,IACE,2BACA,gCAIN,0EAMA,mBACE,sEAKF","sources":["manual.css"],"sourcesContent":["/* mainly for litedown::pkg_manual() */\n.table-full {\n width: 100%;\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n td {\n vertical-align: baseline;\n & > p {\n &:first-child { margin-top: 0; }\n &:last-child { margin-bottom: 0; }\n }\n }\n}\ncode.fade::before {\n content: \"🚫\";\n float: right;\n font-size: 1.5em;\n line-height: 1;\n}\n@media only screen {\n body:not(.pagesjs) pre:not([class]) {\n max-height: 300px;\n overflow-y: auto;\n }\n}\n.orcid {\n width: 1em;\n height: 1em;\n vertical-align: middle;\n}\n"],"names":[]}
|
package/css/pages.css
CHANGED
|
@@ -40,13 +40,11 @@
|
|
|
40
40
|
width: var(--paper-width);
|
|
41
41
|
height: var(--paper-height);
|
|
42
42
|
padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);
|
|
43
|
-
|
|
43
|
+
break-after: always;
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-direction: column;
|
|
46
46
|
justify-content: space-between;
|
|
47
|
-
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
}
|
|
47
|
+
overflow: hidden;
|
|
50
48
|
img {
|
|
51
49
|
max-width: 100%;
|
|
52
50
|
}
|
|
@@ -171,6 +169,7 @@
|
|
|
171
169
|
.page-multiple {
|
|
172
170
|
padding-top: 0;
|
|
173
171
|
padding-bottom: 0;
|
|
172
|
+
height: auto;
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
}
|
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}&:not(:has(.frontmatter)):has(.chapter-toc) #TOC:not(.chapter-toc){display: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);
|
|
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}&:not(:has(.frontmatter)):has(.chapter-toc) #TOC:not(.chapter-toc){display: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);break-after:always;flex-direction:column;justify-content:space-between;display:flex;overflow:hidden;& img{max-width:100%}& .chapter-before,& .chapter-after,& .buttons: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;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(var(--side-margin))}}&: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;& .pagesjs-body:has(.footnotes){margin-bottom:1em}}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{height:auto;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,gFAGA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,0PAYA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,gFAGA,mRASE,qBAGA,iFAGA,8CAIE,yIAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,gIAOA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,SACE,8CAGA,sCAGA,kCAIF,+BAEE,4BAEE,qDAMN,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 &:not(:has(.frontmatter)):has(.chapter-toc) #TOC:not(.chapter-toc) {\n display: 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 \tbreak-after: always;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n overflow: hidden;\n img {\n max-width: 100%;\n }\n .chapter-before, .chapter-after, .buttons: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 &:has(.side-left, .embed-left) .pagesjs-body {\n padding-left: calc(0px - var(--side-margin));\n .fullwidth {\n transform: translate(var(--side-margin));\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 .pagesjs-body:has(.footnotes) {\n margin-bottom: 1em;\n }\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 height: auto;\n }\n }\n}\n"],"names":[]}
|
package/js/toc-highlight.js
CHANGED
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
links.forEach(a => dict[a.getAttribute('href').replace('#', '')] = a);
|
|
8
8
|
const ids = Object.keys(dict);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
let id_active;
|
|
11
|
+
// status: 1 if an id is currently in the viewport, otherwise 0
|
|
12
|
+
const status = Array(ids.length).fill(0);
|
|
12
13
|
// create a new Intersection Observer instance
|
|
13
14
|
const observer = new IntersectionObserver(els => els.forEach(el => {
|
|
14
|
-
const id = el.target.id, i =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const n =
|
|
18
|
-
if (n) {
|
|
19
|
-
|
|
15
|
+
const id = el.target.id, i = ids.indexOf(id);
|
|
16
|
+
if (i < 0) return;
|
|
17
|
+
status[i] = +el.isIntersecting;
|
|
18
|
+
const n = status.indexOf(1); // the first id in view
|
|
19
|
+
if (n > -1) {
|
|
20
|
+
id_active = ids[n];
|
|
20
21
|
} else {
|
|
21
|
-
if (el.
|
|
22
|
+
if (!id_active || el.boundingClientRect.top < 0) return;
|
|
22
23
|
// if a heading exits from bottom and no heading is in view, activate previous ID
|
|
23
|
-
|
|
24
|
-
if (k >= 0) id_active = ids[k];
|
|
24
|
+
id_active = i > 0 ? ids[i - 1] : undefined;
|
|
25
25
|
}
|
|
26
26
|
for (const i in dict) {
|
|
27
27
|
dict[i].classList.toggle('active', i === id_active);
|
package/js/toc-highlight.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(e=>{const t='a[href^="#"]',
|
|
1
|
+
(e=>{const t='a[href^="#"]',r=e.querySelector(`:is(#TableOfContents, #TOC):has(${t})`);if(!r)return;const n=r.querySelectorAll(t),o={};n.forEach((e=>o[e.getAttribute("href").replace("#","")]=e));const c=Object.keys(o);let s;const i=Array(c.length).fill(0),l=new IntersectionObserver((e=>e.forEach((e=>{const t=e.target.id,r=c.indexOf(t);if(r<0)return;i[r]=+e.isIntersecting;const n=i.indexOf(1);if(n>-1)s=c[n];else{if(!s||e.boundingClientRect.top<0)return;s=r>0?c[r-1]:void 0}for(const e in o)o[e].classList.toggle("active",e===s)}))));e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach((e=>{1===e.nodeType&&o.hasOwnProperty(e.id)&&l.observe(e)}))})(document);
|
|
2
2
|
//# sourceMappingURL=toc-highlight.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","s","toc","querySelector","links","querySelectorAll","dict","forEach","a","getAttribute","replace","ids","Object","keys","
|
|
1
|
+
{"version":3,"names":["d","s","toc","querySelector","links","querySelectorAll","dict","forEach","a","getAttribute","replace","ids","Object","keys","id_active","status","Array","length","fill","observer","IntersectionObserver","els","el","id","target","i","indexOf","isIntersecting","n","boundingClientRect","top","undefined","classList","toggle","h","nodeType","hasOwnProperty","observe","document"],"sources":["toc-highlight.js"],"mappings":"AACA,CAACA,IAEC,MAAMC,EAAI,eAAgBC,EAAMF,EAAEG,cAAc,mCAAmCF,MACnF,IAAKC,EAAK,OACV,MAAME,EAAQF,EAAIG,iBAAiBJ,GAAIK,EAAO,CAAC,EAC/CF,EAAMG,SAAQC,GAAKF,EAAKE,EAAEC,aAAa,QAAQC,QAAQ,IAAK,KAAOF,IACnE,MAAMG,EAAMC,OAAOC,KAAKP,GAExB,IAAIQ,EAEJ,MAAMC,EAASC,MAAML,EAAIM,QAAQC,KAAK,GAEhCC,EAAW,IAAIC,sBAAqBC,GAAOA,EAAId,SAAQe,IAC3D,MAAMC,EAAKD,EAAGE,OAAOD,GAAIE,EAAId,EAAIe,QAAQH,GACzC,GAAIE,EAAI,EAAG,OACXV,EAAOU,IAAMH,EAAGK,eAChB,MAAMC,EAAIb,EAAOW,QAAQ,GACzB,GAAIE,GAAK,EACPd,EAAYH,EAAIiB,OACX,CACL,IAAKd,GAAaQ,EAAGO,mBAAmBC,IAAM,EAAG,OAEjDhB,EAAYW,EAAI,EAAId,EAAIc,EAAI,QAAKM,CACnC,CACA,IAAK,MAAMN,KAAKnB,EACdA,EAAKmB,GAAGO,UAAUC,OAAO,SAAUR,IAAMX,EAC3C,MAIFd,EAAEK,iBAAiB,qBAAqBE,SAAQ2B,IAC/B,IAAfA,EAAEC,UAAkB7B,EAAK8B,eAAeF,EAAEX,KAAOJ,EAASkB,QAAQH,EAAE,GAEvE,EAjCD,CAiCGI","ignoreList":[]}
|