{{ partial "singlebody.html" $printPage }}
- {{ $printPage.Content }}
- {{ $printPageScratch := $s.Get (printf "/%s" $printPage.File) }}
- {{ range $printPageKid := $printPageScratch.has_children }}
-
{{ partial "singlebody.html" $printPageKid }}
- {{ $printPageKid.Content }}
- {{ . }}
+
{{ partial "printsinglebody.html" $p }}
+ {{ $p.Content }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" $p.File.UniqueID) }}
+ {{ $cssHashes = printf "%s css-%s-h2" $cssHashes $p.File.UniqueID }}
+
+ {{ range $scratch.has_children }}
+
+ {{ $addS := 0 }}
+ {{ with .Params.authors }}
+ {{ $addS = len . }}
+ {{ end }}
+ {{ range $n, $authorFile := .Params.authors }}
+ {{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
+ {{ if eq $n 0 }}
+
{{ end }}
+
+ {{ $tit := .Title }}
+ {{ if gt (len .Title) 54 }}
+ {{ $tit = printf "%s…" (substr .Title 0 50) }}
+ {{ end }}
+ author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }}
+ {{ else }}
+ , {{ $author.Title }}
{{ end }}
-
- {{ end }}
+ {{ end }}
+ {{ with .Params.authors }}{{ index $scratch.crust 0 }}⁄{{ $tit }}
+ {{ partial "printsinglebody.html" . }}
+ {{ .Content }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
+ {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
+ {{ $kid := $s.Get (printf "/%s" .File) }}
+ {{ range $kid.has_children }}
+
+ {{ $addS := 0 }}
+ {{ with .Params.authors }}
+ {{ $addS = len . }}
+ {{ end }}
+ {{ range $n, $authorFile := .Params.authors }}
+ {{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
+ {{ if eq $n 0 }}
+
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }}
+ {{ else }}
+ , {{ $author.Title }}
+ {{ end }}
+ {{ end }}
+ {{ with .Params.authors }}
{{ end }}
+
+ {{ $tit := .Title }}
+ {{ if gt (len .Title) 54 }}
+ {{ $tit = printf "%s…" (substr .Title 0 50) }}
+ {{ end }}
+ {{ index $scratch.crust 0 }}⁄{{ $tit }}
+ {{ partial "printsinglebody.html" . }}
+ {{ .Content }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
+ {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
+ {{ end }}
+ {{ end }}
+
+ {{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
+
+ {{- .Title }} - {{ .Site.Title -}}
+ {{- partialCached "sandpointjs.html" . .RelPermalink -}}
+
+
+ {{- block "keywords" . -}}{{- end -}}
+ {{- partialCached "footer.html" . -}}
+
+
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html
new file mode 100644
index 0000000..e70e8e3
--- /dev/null
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html
@@ -0,0 +1,23 @@
+{{ define "keywords" }}
+ {{ $p := split (trim .RelPermalink "/") "/" }}
+ {{ if eq (len $p) 1 }}
+
- {{ end }}
- {{ end }}
-
- {{ with ($p.Scratch.Get "links") }}
- {{ range $i, $_ := ($p.Scratch.Get "links") }}
+ {{ $pPath := printf "/%s" $p.File }}
+ {{ with $ss := $s.Get $pPath }}
+ {{ with $ss.backlinks }}
+ {{ range $i, $_ := $ss.backlinks }}
{{ if eq $i 0 }}
-
+
- {{ end }}
{{ end }}
{{ end }}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css
new file mode 100644
index 0000000..4682b5e
--- /dev/null
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css
@@ -0,0 +1,242 @@
+@page {
+ size: 6.14in 9.21in;
+ margin-bottom: 0.8in;
+ padding-bottom: 0.2in;
+ margin-top: 0.7in;
+}
+
+@page:left {
+ margin-right: 0.8in;
+ margin-left: 0.9in;
+ @bottom-left-corner {
+ content: counter(page);
+ font-size: 1rem;
+ vertical-align: text-top;
+ }
+
+ @bottom {
+ content: element(runningTitle);
+ position: relative;
+ }
+}
+
+@page:right {
+ margin-left: 0.8in;
+ margin-right: 0.9in;
+ @bottom-right-corner {
+ content: counter(page);
+ font-size: 1rem;
+ vertical-align: text-top;
+ }
+
+ @bottom {
+ content: element(runningAuthors);
+ position: relative;
+ }
+}
+
+@page crustpage :first {
+ @bottom-right-corner {
+ content: none;
+ }
+ @bottom {
+ content: none;
+ }
+}
+
+@media print {
+ html {
+ font-size: 0.8em;
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+ }
+ body {
+ font-size: 1rem;
+ padding: 0;
+ margin: 0;
+ }
+
+ .sup,
+ .hassup {
+ color: black;
+ }
+ .grid {
+ display: inline;
+ }
+
+ .coretitle {
+ margin-top: 3rem;
+ margin-bottom: 2rem;
+ font-size: 2.2rem;
+ }
+
+ .leftcolumn {
+ display: none;
+ }
+
+ .has,
+ .afterhas {
+ font-size: 1.1rem;
+ }
+
+ .mantle,
+ .crust {
+ margin-bottom: 0.2em;
+ }
+
+ .content {
+ padding: 0px;
+ margin: 0 auto;
+ margin-top: 4rem;
+ }
+
+ .hpar {
+ display: none;
+ }
+
+ .mantletitle {
+ font-size: 1.7rem;
+ }
+
+ .sessiongrid {
+ display: none;
+ }
+
+ #bibliography {
+ break-before: page;
+ }
+
+ .footnotes ol {
+ margin-top: 3rem;
+ padding-left: 0.9rem;
+ }
+
+ .footnotes hr {
+ border: none;
+ border-top: 0px;
+ text-align: left;
+ margin-top: 2rem;
+ margin-bottom: -2rem;
+ }
+
+ .footnotes hr::after {
+ content: "Endnotes";
+ font-size: 1.2rem;
+ font-weight: bold;
+ }
+
+ .runningTitle {
+ position: running(runningTitle);
+ }
+
+ .runningAuthors {
+ position: running(runningAuthors);
+ }
+
+ .hasauthors .afterhas {
+ font-size: 1.5rem;
+ }
+
+ .crustpage {
+ break-before: page;
+ page: crustpage;
+ }
+
+ .hasin {
+ display: none;
+ }
+
+ .abstract {
+ margin-left: 0;
+ margin-right: 0;
+ max-width: inherit;
+ }
+
+ .keywords {
+ margin-left: 0;
+ margin-right: 0;
+ max-width: inherit;
+ padding-left: 0;
+ padding-right: 0;
+ font-size: 0.9rem;
+ }
+ /*
+ h2:before,
+ h3:before,
+ h4:before,
+ h5:before {
+ content: none;
+ }
+ */
+ h2, h3, h4, h5, hr {
+ break-after: avoid;
+ }
+
+ .glosscontainer,
+ table,
+ table + p,
+ tr,
+ blockquote,
+ li {
+ break-inside: avoid;
+ }
+
+ .authorpage {
+ break-before: page;
+ }
+
+ img {
+ display: block;
+ max-height: 150mm;
+ width: auto;
+ break-after: avoid;
+ margin-bottom: 0.5rem;
+ margin-left: 1rem;
+ }
+
+ .crustoc {
+ position: relative;
+ bottom: 0
+ }
+
+ a.toc::before {
+ direction: rtl;
+ content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
+ line-height: 0;
+ height: 1px;
+ position: absolute;
+ bottom: 10px;
+ z-index: -1;
+ }
+
+ a.toc {
+ display: grid;
+ grid-template-columns: 1fr auto;
+ align-items: flex-end;
+ }
+
+ a.toc span {
+ }
+
+ a.toc .back {
+ background: white;
+ }
+
+ a.toc::after {
+ text-align: right;
+ float: right;
+ content: target-counter(attr(href url), page, decimal-leading-zero);
+ background: white;
+ padding-left: 0.1rem;
+ }
+
+ ol[data-split-from] {
+ padding-left: 0.5rem;
+ }
+
+ .longesttitle {
+ visibility: hidden;
+ cursor: default;
+ }
+}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css
index 11a51fc..35c040a 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css
@@ -1 +1 @@
-stdin 587:3 ⚠ grid-auto-rows is not supported by ie [autoprefixer] html,body,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}img,video{height:auto;max-width:100%}iframe{border:0}strong del{display:inline;text-decoration:none;margin-left:1rem;box-decoration-break:clone;-webkit-box-decoration-break:clone}table{border-collapse:collapse;border-spacing:0;background-color:#fff9f9;border-left:1px red solid;margin-left:1rem}td,th{padding:0;vertical-align:top;padding-right:1rem;padding-left:1rem;padding-bottom:.5rem}td:not([align]),th:not([align]){text-align:left}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:600;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:700;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:900;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format("svg")}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local("Great Vibes"),local("GreatVibes-Regular"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format("woff"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format("svg")}html{line-height:1.5}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}#preview{display:none}sup,sub{vertical-align:baseline;position:relative;top:-.4em}sub{top:.4em}.headiter{display:flex;justify-content:space-between;border-bottom:.3rem solid red;border-top:.1rem solid red;padding-top:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;margin-bottom:1rem}a.edit-button{color:#000;text-decoration:none}a.edit-button:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}.header{display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;grid-auto-flow:column;position:-webkit-sticky;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{-ms-grid-column:1;grid-column:1}.bibliotheke{width:2.4rem;-ms-grid-column:2;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.alsoin{font-weight:700;display:inline-flex;padding-left:.2rem;padding-right:.3rem}.ddmenu{cursor:pointer;display:-ms-inline-grid;display:inline-grid}.ddmenu input{display:none}.ddmenu li{list-style-type:none}.ddmenu .hiddendiv{display:none;margin-top:-.9rem}input:focus,select:focus,textarea:focus,label:focus,button:focus{outline:none}.ddmenu input:checked~.hiddendiv{display:block}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}ol li{list-style-type:decimal}img{width:100%}.supt{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:rgba(0,0,0,.8);vertical-align:baseline;position:relative;top:-.3em}.sup{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.nosup a{color:red}.nosup a span.sup{display:none}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.grid{padding-left:3rem;margin-bottom:2rem;display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.leftcolumn{-ms-grid-column:1;grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{padding-left:.5rem}.has{display:-ms-inline-grid;display:inline-grid;-ms-grid-column:2;grid-column:2;grid-auto-rows:-webkit-max-content;grid-auto-rows:max-content;font-size:1.4rem;font-style:italic;margin-bottom:.8rem}.hasauthors{font-size:1.6rem!important}.hassup{-ms-grid-column:1;grid-column:1;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative}.afterhas{-ms-grid-column:2;grid-column:2}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}.abstract{font-style:italic;border-left:1px solid #000;margin-left:5rem;margin-right:2rem;margin-bottom:1.2rem;padding-left:1rem;padding-right:2rem;padding-top:1.2rem;padding-bottom:1.2rem;background-color:rgba(0,0,0,.05);max-width:70ch}.authors{display:inline-block;font-size:1.8rem;margin-left:5rem;margin-right:2rem;padding-left:1rem}.keywords{display:inline-block;font-size:1.2rem;margin-left:5rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;margin-bottom:2.2rem;max-width:72ch}blockquote{border-left:1px red solid;margin-left:1rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}.smallcaps{font-family:vollkorn sc,serif;font-weight:400}body{counter-reset:h2 glossN}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}details{padding-left:1rem}#toggleAllLinks{font-size:.8rem}#toggleAllLinks:hover{cursor:pointer;text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red}.glosscontainer{display:-ms-grid;display:grid;-ms-grid-columns:auto 0 1fr;grid-template-columns:auto 1fr;-ms-grid-rows:1fr;grid-template-rows:1fr;gap:0 0;grid-template-areas:"glossnumber gloss";border-left:1px red solid;background-color:#fff9f9;padding-top:.4em;margin-top:1rem;margin-bottom:1rem;margin-left:1rem;margin-right:2rem;padding-bottom:.4em;padding-left:1rem;padding-right:2rem}.gloss{-ms-grid-row:1;-ms-grid-column:3;grid-area:gloss}.glossnumber{-ms-grid-row:1;-ms-grid-column:1;grid-area:glossnumber;padding-right:.6rem}.glossnumberAuto::before{counter-increment:glossN;content:"(" counter(glossN)")"}.glosswords{display:inline-block;padding-left:-.3rem;padding-right:1rem}.sitemap{padding-left:3rem;font-size:1.2rem}.sitemap a{color:rgba(0,0,0,.4)}.sitemap .sup{color:rgba(255,0,0,.7)}.highline a,.sitemap a:hover{color:#000}.highline .sup,.sitemap .sup:hover{color:red}.highline{font-size:1.6rem;color:#000;border-left:1px red solid;padding-left:1rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}}
\ No newline at end of file
+qhtml,body,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}img,video{height:auto;max-width:100%}iframe{border:0}strong del{display:inline;text-decoration:none;margin-left:1rem;box-decoration-break:clone;-webkit-box-decoration-break:clone}table{border-collapse:collapse;border-spacing:0;background-color:#fff9f9;border-left:1px red solid;margin-left:1rem}td,th{padding:0;vertical-align:top;padding-right:1rem;padding-left:1rem;padding-bottom:.5rem}td:not([align]),th:not([align]){text-align:left}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:600;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:700;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:900;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format("svg")}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local("Great Vibes"),local("GreatVibes-Regular"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format("woff"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format("svg")}html{line-height:1.5}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}#preview{display:none}sup,sub{vertical-align:baseline;position:relative;top:-.4em}sub{top:.4em}.headiter{display:flex;justify-content:space-between;border-bottom:.3rem solid red;border-top:.1rem solid red;padding-top:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;margin-bottom:1rem}a.edit-button{color:#000;text-decoration:none}a.edit-button:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}.header{display:grid;grid-template-columns:auto;grid-auto-flow:column;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{grid-column:1}.bibliotheke{width:2.4rem;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.alsoin{font-weight:700;display:inline-flex;padding-left:.2rem;padding-right:.3rem}.ddmenu{cursor:pointer;display:inline-grid}.ddmenu input{display:none}.ddmenu li{list-style-type:none}.ddmenu .hiddendiv{display:none;margin-top:-.9rem}input:focus,select:focus,textarea:focus,label:focus,button:focus{outline:none}.ddmenu input:checked~.hiddendiv{display:block}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}ol li{list-style-type:decimal}img{width:100%}.supt{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:rgba(0,0,0,.8);vertical-align:baseline;position:relative;top:-.3em}.sup{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.nosup a{color:red}.nosup a span.sup{display:none}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.grid{padding-left:3rem;margin-bottom:2rem;display:grid;grid-template-columns:1fr 1fr}.leftcolumn{grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{padding-left:.5rem}.has{display:inline-grid;grid-column:2;grid-auto-rows:max-content;font-size:1.4rem;font-style:italic;margin-bottom:.8rem}.hasauthors{font-size:1.6rem!important;display:flex}.hassup{grid-column:1;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative}.afterhas{grid-column:2}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}.abstract{font-style:italic;border-left:1px solid #000;margin-left:5rem;margin-right:2rem;margin-bottom:1.2rem;padding-left:1rem;padding-right:2rem;padding-top:1.2rem;padding-bottom:1.2rem;background-color:rgba(0,0,0,5%);max-width:45ch}.authors{display:inline-block;font-size:1.8rem;margin-left:5rem;margin-right:2rem;padding-left:1rem}.keywords{display:inline-block;font-size:1.2rem;margin-left:5rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;margin-bottom:2.2rem;max-width:72ch}blockquote{border-left:1px red solid;margin-left:1rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}.smallcaps{font-family:vollkorn sc,serif;font-weight:400}body{counter-reset:h2 glossN}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}details{padding-left:1rem}#toggleAllLinks{font-size:.8rem}#toggleAllLinks:hover{cursor:pointer;text-decoration:underline;text-decoration-color:red}.glosscontainer{display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr;gap:0 0;grid-template-areas:"glossnumber gloss";border-left:1px red solid;background-color:#fff9f9;padding-top:.4em;margin-top:1rem;margin-bottom:1rem;margin-left:1rem;margin-right:2rem;padding-bottom:.4em;padding-left:1rem;padding-right:2rem}.gloss{grid-area:gloss}.glossnumber{grid-area:glossnumber;padding-right:.6rem}.glossnumberAuto::before{counter-increment:glossN;content:"(" counter(glossN)")"}.glosswords{display:inline-block;padding-left:-.3rem;padding-right:1rem}.sitemap{padding-left:3rem;font-size:1.2rem}.sitemap a{color:rgba(0,0,0,.4)}.sitemap .sup{color:rgba(255,0,0,.7)}.highline a,.sitemap a:hover{color:#000}.highline .sup,.sitemap .sup:hover{color:red}.highline{font-size:1.6rem;color:#000;border-left:1px red solid;padding-left:1rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}.svedit{display:none;margin-left:.5rem}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js
index 1b7048a..c984974 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js
@@ -1,3 +1,7 @@
+/**
+ * @license Paged.js v0.1.43 | MIT | https://gitlab.pagedmedia.org/tools/pagedjs
+ */
+
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
@@ -620,64 +624,87 @@
}
function nodeAfter(node, limiter) {
- let after = node;
+ if (limiter && node === limiter) {
+ return;
+ }
+ let significantNode = nextSignificantNode(node);
+ if (significantNode) {
+ return significantNode;
+ }
+ if (node.parentNode) {
+ while ((node = node.parentNode)) {
+ if (limiter && node === limiter) {
+ return;
+ }
+ significantNode = nextSignificantNode(node);
+ if (significantNode) {
+ return significantNode;
+ }
+ }
+ }
+ }
- if (after.nextSibling) {
- if (limiter && node === limiter) {
- return;
- }
- after = after.nextSibling;
- } else {
- while (after) {
- after = after.parentNode;
- if (limiter && after === limiter) {
- after = undefined;
- break;
+ function nodeBefore(node, limiter) {
+ if (limiter && node === limiter) {
+ return;
+ }
+ let significantNode = previousSignificantNode(node);
+ if (significantNode) {
+ return significantNode;
+ }
+ if (node.parentNode) {
+ while ((node = node.parentNode)) {
+ if (limiter && node === limiter) {
+ return;
}
- if (after && after.nextSibling) {
- after = after.nextSibling;
- break;
+ significantNode = previousSignificantNode(node);
+ if (significantNode) {
+ return significantNode;
}
}
}
+ }
+
+ function elementAfter(node, limiter) {
+ let after = nodeAfter(node, limiter);
+
+ while (after && after.nodeType !== 1) {
+ after = nodeAfter(after, limiter);
+ }
return after;
}
- function nodeBefore(node, limiter) {
- let before = node;
- if (before.previousSibling) {
- if (limiter && node === limiter) {
- return;
- }
- before = before.previousSibling;
- } else {
- while (before) {
- before = before.parentNode;
- if (limiter && before === limiter) {
- before = undefined;
- break;
- }
- if (before && before.previousSibling) {
- before = before.previousSibling;
- break;
- }
- }
+ function elementBefore(node, limiter) {
+ let before = nodeBefore(node, limiter);
+
+ while (before && before.nodeType !== 1) {
+ before = nodeBefore(before, limiter);
}
return before;
}
- function elementAfter(node, limiter) {
- let after = nodeAfter(node);
+ function displayedElementAfter(node, limiter) {
+ let after = elementAfter(node, limiter);
- while (after && after.nodeType !== 1) {
- after = nodeAfter(after);
+ while (after && after.dataset.undisplayed) {
+ after = elementAfter(after);
}
return after;
}
+ function displayedElementBefore(node, limiter) {
+ let before = elementBefore(node, limiter);
+
+ while (before && before.dataset.undisplayed) {
+ before = elementBefore(before);
+ }
+
+ return before;
+ }
+
function rebuildAncestors(node) {
let parent, ancestor;
let ancestors = [];
@@ -810,15 +837,16 @@
return false;
}
- function needsPageBreak(node) {
- if( typeof node !== "undefined" &&
- typeof node.dataset !== "undefined" &&
- (node.dataset.page || node.dataset.afterPage)
- ) {
- return true;
+ function needsPageBreak(node, previousSignificantNode) {
+ if (typeof node === "undefined" || !previousSignificantNode || isIgnorable(node)) {
+ return false;
}
-
- return false;
+ if (node.dataset && node.dataset.undisplayed) {
+ return false;
+ }
+ const previousSignificantNodePage = previousSignificantNode.dataset ? previousSignificantNode.dataset.page : undefined;
+ const currentNodePage = node.dataset ? node.dataset.page : undefined;
+ return currentNodePage !== previousSignificantNodePage;
}
function *words(node) {
@@ -881,7 +909,7 @@
return true;
}
- if (node.style.display === "none") {
+ if (node.style && node.style.display === "none") {
return false;
}
@@ -1029,6 +1057,158 @@
return index;
}
+
+ /**
+ * Throughout, whitespace is defined as one of the characters
+ * "\t" TAB \u0009
+ * "\n" LF \u000A
+ * "\r" CR \u000D
+ * " " SPC \u0020
+ *
+ * This does not use Javascript's "\s" because that includes non-breaking
+ * spaces (and also some other characters).
+ */
+
+ /**
+ * Determine if a node should be ignored by the iterator functions.
+ * taken from https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace#Whitespace_helper_functions
+ *
+ * @param {Node} node An object implementing the DOM1 |Node| interface.
+ * @return {boolean} true if the node is:
+ * 1) A |Text| node that is all whitespace
+ * 2) A |Comment| node
+ * and otherwise false.
+ */
+ function isIgnorable(node) {
+ return (node.nodeType === 8) || // A comment node
+ ((node.nodeType === 3) && isAllWhitespace(node)); // a text node, all whitespace
+ }
+
+ /**
+ * Determine whether a node's text content is entirely whitespace.
+ *
+ * @param {Node} node A node implementing the |CharacterData| interface (i.e., a |Text|, |Comment|, or |CDATASection| node
+ * @return {boolean} true if all of the text content of |nod| is whitespace, otherwise false.
+ */
+ function isAllWhitespace(node) {
+ return !(/[^\t\n\r ]/.test(node.textContent));
+ }
+
+ /**
+ * Version of |previousSibling| that skips nodes that are entirely
+ * whitespace or comments. (Normally |previousSibling| is a property
+ * of all DOM nodes that gives the sibling node, the node that is
+ * a child of the same parent, that occurs immediately before the
+ * reference node.)
+ *
+ * @param {ChildNode} sib The reference node.
+ * @return {Node|null} Either:
+ * 1) The closest previous sibling to |sib| that is not ignorable according to |is_ignorable|, or
+ * 2) null if no such node exists.
+ */
+ function previousSignificantNode(sib) {
+ while ((sib = sib.previousSibling)) {
+ if (!isIgnorable(sib)) return sib;
+ }
+ return null;
+ }
+
+ function breakInsideAvoidParentNode(node) {
+ while ((node = node.parentNode)) {
+ if (node && node.dataset && node.dataset.breakInside === "avoid") {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Find a parent with a given node name.
+ * @param {Node} node - initial Node
+ * @param {string} nodeName - node name (eg. "TD", "TABLE", "STRONG"...)
+ * @param {Node} limiter - go up to the parent until there's no more parent or the current node is equals to the limiter
+ * @returns {Node|undefined} - Either:
+ * 1) The closest parent for a the given node name, or
+ * 2) undefined if no such node exists.
+ */
+ function parentOf(node, nodeName, limiter) {
+ if (limiter && node === limiter) {
+ return;
+ }
+ if (node.parentNode) {
+ while ((node = node.parentNode)) {
+ if (limiter && node === limiter) {
+ return;
+ }
+ if (node.nodeName === nodeName) {
+ return node;
+ }
+ }
+ }
+ }
+
+ /**
+ * Version of |nextSibling| that skips nodes that are entirely
+ * whitespace or comments.
+ *
+ * @param {ChildNode} sib The reference node.
+ * @return {Node|null} Either:
+ * 1) The closest next sibling to |sib| that is not ignorable according to |is_ignorable|, or
+ * 2) null if no such node exists.
+ */
+ function nextSignificantNode(sib) {
+ while ((sib = sib.nextSibling)) {
+ if (!isIgnorable(sib)) return sib;
+ }
+ return null;
+ }
+
+ function filterTree(content, func, what) {
+ const treeWalker = document.createTreeWalker(
+ content || this.dom,
+ what || NodeFilter.SHOW_ALL,
+ func ? { acceptNode: func } : null,
+ false
+ );
+
+ let node;
+ let current;
+ node = treeWalker.nextNode();
+ while(node) {
+ current = node;
+ node = treeWalker.nextNode();
+ current.parentNode.removeChild(current);
+ }
+ }
+
+ /**
+ * Layout
+ * @class
+ */
+ class BreakToken {
+
+ constructor(node, offset) {
+ this.node = node;
+ this.offset = offset;
+ }
+
+ equals(otherBreakToken) {
+ if (!otherBreakToken) {
+ return false;
+ }
+ if (this["node"] && otherBreakToken["node"] &&
+ this["node"] !== otherBreakToken["node"]) {
+ return false;
+ }
+ if (this["offset"] && otherBreakToken["offset"] &&
+ this["offset"] !== otherBreakToken["offset"]) {
+ return false;
+ }
+ return true;
+ }
+
+ }
+
const MAX_CHARS_PER_BREAK = 1500;
/**
@@ -1057,13 +1237,15 @@
this.settings = options || {};
this.maxChars = this.settings.maxChars || MAX_CHARS_PER_BREAK;
+ this.forceRenderBreak = false;
}
- async renderTo(wrapper, source, breakToken, bounds=this.bounds) {
+ async renderTo(wrapper, source, breakToken, bounds = this.bounds) {
let start = this.getStart(source, breakToken);
let walker = walk(start, source);
let node;
+ let prevNode;
let done;
let next;
@@ -1072,8 +1254,11 @@
let length = 0;
+ let prevBreakToken = breakToken || new BreakToken(start);
+
while (!done && !newBreakToken) {
next = walker.next();
+ prevNode = node;
node = next.value;
done = next.done;
@@ -1085,7 +1270,12 @@
await this.waitForImages(imgs);
}
- newBreakToken = this.findBreakToken(wrapper, source, bounds);
+ newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
+
+ if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
+ console.warn("Unable to layout item: ", prevNode);
+ return undefined;
+ }
return newBreakToken;
}
@@ -1093,7 +1283,6 @@
// Check if the rendered element has a break set
if (hasRenderedContent && this.shouldBreak(node)) {
-
this.hooks && this.hooks.layout.trigger(wrapper, this);
let imgs = wrapper.querySelectorAll("img");
@@ -1101,12 +1290,17 @@
await this.waitForImages(imgs);
}
- newBreakToken = this.findBreakToken(wrapper, source, bounds);
+ newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
if (!newBreakToken) {
newBreakToken = this.breakAt(node);
}
+ if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
+ console.warn("Unable to layout item: ", node);
+ return undefined;
+ }
+
length = 0;
break;
@@ -1129,6 +1323,21 @@
walker = walk(nodeAfter(node, source), source);
}
+ if (this.forceRenderBreak) {
+ this.hooks && this.hooks.layout.trigger(wrapper, this);
+
+ newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
+
+ if (!newBreakToken) {
+ newBreakToken = this.breakAt(node);
+ }
+
+ length = 0;
+ this.forceRenderBreak = false;
+
+ break;
+ }
+
// Only check x characters
if (length >= this.maxChars) {
@@ -1139,7 +1348,12 @@
await this.waitForImages(imgs);
}
- newBreakToken = this.findBreakToken(wrapper, source, bounds);
+ newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken);
+
+ if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
+ console.warn("Unable to layout item: ", node);
+ return undefined;
+ }
if (newBreakToken) {
length = 0;
@@ -1151,15 +1365,23 @@
return newBreakToken;
}
- breakAt(node, offset=0) {
- return {
+ breakAt(node, offset = 0) {
+ let newBreakToken = new BreakToken(
node,
offset
- };
+ );
+ let breakHooks = this.hooks.onBreakToken.triggerSync(newBreakToken, undefined, node, this);
+ breakHooks.forEach((newToken) => {
+ if (typeof newToken != "undefined") {
+ newBreakToken = newToken;
+ }
+ });
+
+ return newBreakToken;
}
shouldBreak(node) {
- let previousSibling = node.previousSibling;
+ let previousSibling = previousSignificantNode(node);
let parentNode = node.parentNode;
let parentBreakBefore = needsBreakBefore(node) && parentNode && !previousSibling && needsBreakBefore(parentNode);
let doubleBreakBefore;
@@ -1168,7 +1390,11 @@
doubleBreakBefore = node.dataset.breakBefore === parentNode.dataset.breakBefore;
}
- return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node);
+ return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node, previousSibling);
+ }
+
+ forceBreak() {
+ this.forceRenderBreak = true;
}
getStart(source, breakToken) {
@@ -1184,7 +1410,7 @@
return start;
}
- append(node, dest, breakToken, shallow=true, rebuild=true) {
+ append(node, dest, breakToken, shallow = true, rebuild = true) {
let clone = cloneNode(node, !shallow);
@@ -1215,7 +1441,7 @@
dest.appendChild(clone);
}
- let nodeHooks = this.hooks.renderNode.triggerSync(clone, node);
+ let nodeHooks = this.hooks.renderNode.triggerSync(clone, node, this);
nodeHooks.forEach((newNode) => {
if (typeof newNode != "undefined") {
clone = newNode;
@@ -1235,16 +1461,16 @@
async awaitImageLoaded(image) {
return new Promise(resolve => {
if (image.complete !== true) {
- image.onload = function() {
- let { width, height } = window.getComputedStyle(image);
+ image.onload = function () {
+ let {width, height} = window.getComputedStyle(image);
resolve(width, height);
};
- image.onerror = function(e) {
- let { width, height } = window.getComputedStyle(image);
+ image.onerror = function (e) {
+ let {width, height} = window.getComputedStyle(image);
resolve(width, height, e);
};
} else {
- let { width, height } = window.getComputedStyle(image);
+ let {width, height} = window.getComputedStyle(image);
resolve(width, height);
}
});
@@ -1264,7 +1490,7 @@
break;
}
- if(window.getComputedStyle(node)["break-inside"] === "avoid") {
+ if (window.getComputedStyle(node)["break-inside"] === "avoid") {
breakNode = node;
break;
}
@@ -1286,7 +1512,11 @@
if (!renderedNode) {
// Find closest element with data-ref
- renderedNode = findElement(prevValidNode(temp), rendered);
+ let prevNode = prevValidNode(temp);
+ if (!isElement(prevNode)) {
+ prevNode = prevNode.parentElement;
+ }
+ renderedNode = findElement(prevNode, rendered);
// Check if temp is the last rendered node at its level.
if (!temp.nextSibling) {
// We need to ensure that the previous sibling of temp is fully rendered.
@@ -1294,7 +1524,7 @@
const walker = document.createTreeWalker(renderedNodeFromSource, NodeFilter.SHOW_ELEMENT);
const lastChildOfRenderedNodeFromSource = walker.lastChild();
const lastChildOfRenderedNodeMatchingFromRendered = findElement(lastChildOfRenderedNodeFromSource, rendered);
- // Check if we found that the last child in source
+ // Check if we found that the last child in source
if (!lastChildOfRenderedNodeMatchingFromRendered) {
// Pending content to be rendered before virtual break token
return;
@@ -1318,8 +1548,14 @@
parent = findElement(renderedNode, source);
index = indexOfTextNode(temp, parent);
- node = child(parent, index);
- offset = 0;
+ // No seperatation for the first textNode of an element
+ if(index === 0) {
+ node = parent;
+ offset = 0;
+ } else {
+ node = child(parent, index);
+ offset = 0;
+ }
}
} else {
renderedNode = findElement(container.parentNode, rendered);
@@ -1344,14 +1580,14 @@
return;
}
- return {
+ return new BreakToken(
node,
offset
- };
+ );
}
- findBreakToken(rendered, source, bounds=this.bounds, extract=true) {
+ findBreakToken(rendered, source, bounds = this.bounds, prevBreakToken, extract = true) {
let overflow = this.findOverflow(rendered, bounds);
let breakToken, breakLetter;
@@ -1365,12 +1601,6 @@
if (overflow) {
breakToken = this.createBreakToken(overflow, rendered, source);
// breakToken is nullable
- if (breakToken && breakToken["node"] && breakToken["offset"] && breakToken["node"].textContent) {
- breakLetter = breakToken["node"].textContent.charAt(breakToken["offset"]);
- } else {
- breakLetter = undefined;
- }
-
let breakHooks = this.hooks.onBreakToken.triggerSync(breakToken, overflow, rendered, this);
breakHooks.forEach((newToken) => {
if (typeof newToken != "undefined") {
@@ -1378,6 +1608,16 @@
}
});
+ // Stop removal if we are in a loop
+ if (breakToken && breakToken.equals(prevBreakToken)) {
+ return breakToken;
+ }
+
+ if (breakToken && breakToken["node"] && breakToken["offset"] && breakToken["node"].textContent) {
+ breakLetter = breakToken["node"].textContent.charAt(breakToken["offset"]);
+ } else {
+ breakLetter = undefined;
+ }
if (breakToken && breakToken.node && extract) {
this.removeOverflow(overflow, breakLetter);
@@ -1387,18 +1627,18 @@
return breakToken;
}
- hasOverflow(element, bounds=this.bounds) {
+ hasOverflow(element, bounds = this.bounds) {
let constrainingElement = element && element.parentNode; // this gets the element, instead of the wrapper for the width workaround
- let { width } = element.getBoundingClientRect();
+ let {width} = element.getBoundingClientRect();
let scrollWidth = constrainingElement ? constrainingElement.scrollWidth : 0;
return Math.max(Math.floor(width), scrollWidth) > Math.round(bounds.width);
}
- findOverflow(rendered, bounds=this.bounds) {
+ findOverflow(rendered, bounds = this.bounds) {
if (!this.hasOverflow(rendered, bounds)) return;
let start = Math.round(bounds.left);
- let end = Math.round(bounds.right);
+ let end = Math.round(bounds.right);
let range;
let walker = walk(rendered.firstChild, rendered);
@@ -1423,7 +1663,12 @@
// Check if it is a float
let isFloat = false;
- if (isElement(node) ) {
+ // Check if the node is inside a break-inside: avoid table cell
+ const insideTableCell = parentOf(node, "TD", rendered);
+ if (insideTableCell && window.getComputedStyle(insideTableCell)["break-inside"] === "avoid") {
+ // breaking inside a table cell produces unexpected result, as a workaround, we forcibly avoid break inside in a cell.
+ prev = insideTableCell;
+ } else if (isElement(node)) {
let styles = window.getComputedStyle(node);
isFloat = styles.getPropertyValue("float") !== "none";
skip = styles.getPropertyValue("break-inside") === "avoid";
@@ -1434,27 +1679,27 @@
if (prev) {
range = document.createRange();
- range.setStartBefore(prev);
+ range.selectNode(prev);
break;
}
if (!br && !isFloat && isElement(node)) {
range = document.createRange();
- range.setStartBefore(node);
+ range.selectNode(node);
break;
}
if (isText(node) && node.textContent.trim().length) {
range = document.createRange();
- range.setStartBefore(node);
+ range.selectNode(node);
break;
}
}
if (!range && isText(node) &&
- node.textContent.trim().length &&
- window.getComputedStyle(node.parentNode)["break-inside"] !== "avoid") {
+ node.textContent.trim().length &&
+ !breakInsideAvoidParentNode(node.parentNode)) {
let rects = getClientRects(node);
let rect;
@@ -1466,7 +1711,7 @@
}
}
- if(left >= end) {
+ if (left >= end) {
range = document.createRange();
offset = this.textBreak(node, start, end);
if (!offset) {
@@ -1498,7 +1743,7 @@
}
- findEndToken(rendered, source, bounds=this.bounds) {
+ findEndToken(rendered, source, bounds = this.bounds) {
if (rendered.childNodes.length === 0) {
return;
}
@@ -1510,7 +1755,7 @@
if (!validNode(lastChild)) {
// Only get elements with refs
lastChild = lastChild.previousSibling;
- } else if(!validNode(lastChild.lastChild)) {
+ } else if (!validNode(lastChild.lastChild)) {
// Deal with invalid dom items
lastChild = prevValidNode(lastChild.lastChild);
break;
@@ -1607,18 +1852,31 @@
hyphenateAtBreak(startContainer, breakLetter) {
if (isText(startContainer)) {
let startText = startContainer.textContent;
- let prevLetter = startText[startText.length-1];
+ let prevLetter = startText[startText.length - 1];
// Add a hyphen if previous character is a letter or soft hyphen
if (
- (breakLetter && /^\w|\u00AD$/.test(prevLetter) && /^\w|\u00AD$/.test(breakLetter)) ||
- (!breakLetter && /^\w|\u00AD$/.test(prevLetter))
+ (breakLetter && /^\w|\u00AD$/.test(prevLetter) && /^\w|\u00AD$/.test(breakLetter)) ||
+ (!breakLetter && /^\w|\u00AD$/.test(prevLetter))
) {
startContainer.parentNode.classList.add("pagedjs_hyphen");
startContainer.textContent += this.settings.hyphenGlyph || "\u2011";
}
}
}
+
+ equalTokens(a, b) {
+ if (!a || !b) {
+ return false;
+ }
+ if (a["node"] && b["node"] && a["node"] !== b["node"]) {
+ return false;
+ }
+ if (a["offset"] && b["offset"] && a["offset"] !== b["offset"]) {
+ return false;
+ }
+ return true;
+ }
}
eventEmitter(Layout.prototype);
@@ -1693,7 +1951,7 @@
let page = this.element;
// let pagebox = this.pagebox;
- let index = pgnum+1;
+ let index = pgnum + 1;
let id = `page-${index}`;
@@ -1748,7 +2006,7 @@
this.layoutMethod = new Layout(this.area, this.hooks, maxChars);
let newBreakToken = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
-
+
this.addListeners(contents);
this.endToken = newBreakToken;
@@ -1773,7 +2031,7 @@
let e;
for (var i = 0; i < entries.length; i++) {
e = entries[i];
- if(e.dataset.ref === ref) {
+ if (e.dataset.ref === ref) {
return e;
}
}
@@ -1803,8 +2061,8 @@
}
// TODO: fall back to mutation observer?
- this._onScroll = function() {
- if(this.listening) {
+ this._onScroll = function () {
+ if (this.listening) {
this.element.scrollLeft = 0;
}
}.bind(this);
@@ -1827,30 +2085,31 @@
this.element.removeEventListener("underflow", this._checkOverflowAfterResize, false);
}
- this.element &&this.element.removeEventListener("scroll", this._onScroll);
+ this.element && this.element.removeEventListener("scroll", this._onScroll);
}
addResizeObserver(contents) {
let wrapper = this.wrapper;
let prevHeight = wrapper.getBoundingClientRect().height;
- this.ro = new ResizeObserver( entries => {
+ this.ro = new ResizeObserver(entries => {
if (!this.listening) {
return;
}
+ requestAnimationFrame(() => {
+ for (let entry of entries) {
+ const cr = entry.contentRect;
- for (let entry of entries) {
- const cr = entry.contentRect;
-
- if (cr.height > prevHeight) {
- this.checkOverflowAfterResize(contents);
- prevHeight = wrapper.getBoundingClientRect().height;
- } else if (cr.height < prevHeight ) { // TODO: calc line height && (prevHeight - cr.height) >= 22
- this.checkUnderflowAfterResize(contents);
- prevHeight = cr.height;
+ if (cr.height > prevHeight) {
+ this.checkOverflowAfterResize(contents);
+ prevHeight = wrapper.getBoundingClientRect().height;
+ } else if (cr.height < prevHeight) { // TODO: calc line height && (prevHeight - cr.height) >= 22
+ this.checkUnderflowAfterResize(contents);
+ prevHeight = cr.height;
+ }
}
- }
+ });
});
this.ro.observe(wrapper);
@@ -1861,7 +2120,7 @@
return;
}
- let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents);
+ let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents, this.startToken);
if (newBreakToken) {
this.endToken = newBreakToken;
@@ -1876,8 +2135,6 @@
let endToken = this.layoutMethod.findEndToken(this.wrapper, contents);
- // let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents);
-
if (endToken) {
this._onUnderflow && this._onUnderflow(endToken);
}
@@ -1918,7 +2175,6 @@
let fragment = range.createContextualFragment(markup);
this.addRefs(fragment);
- this.removeEmpty(fragment);
return fragment;
}
@@ -1933,7 +2189,6 @@
// }
this.addRefs(contents);
- this.removeEmpty(contents);
return contents;
}
@@ -1942,7 +2197,7 @@
var treeWalker = document.createTreeWalker(
content,
NodeFilter.SHOW_ELEMENT,
- { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
+ null,
false
);
@@ -1965,62 +2220,10 @@
}
}
- removeEmpty(content) {
- var treeWalker = document.createTreeWalker(
- content,
- NodeFilter.SHOW_TEXT,
- { acceptNode: function(node) {
- // Only remove more than a single space
- if (node.textContent.length > 1 && !node.textContent.trim()) {
-
- // Don't touch whitespace if text is preformated
- let parent = node.parentNode;
- let pre = isElement(parent) && parent.closest("pre");
- if (pre) {
- return NodeFilter.FILTER_REJECT;
- }
-
- return NodeFilter.FILTER_ACCEPT;
- } else {
- return NodeFilter.FILTER_REJECT;
- }
- } },
- false
- );
-
- let node;
- let current;
- node = treeWalker.nextNode();
- while(node) {
- current = node;
- node = treeWalker.nextNode();
- // if (!current.nextSibling || (current.nextSibling && current.nextSibling.nodeType === 1)) {
- current.parentNode.removeChild(current);
- // }
- }
- }
-
find(ref) {
return this.refs[ref];
}
- // isWrapper(element) {
- // return wrappersRegex.test(element.nodeName);
- // }
-
- isText(node) {
- return node.tagName === "TAG";
- }
-
- isElement(node) {
- return node.nodeType === 1;
- }
-
- hasChildren(node) {
- return node.childNodes && node.childNodes.length;
- }
-
-
destroy() {
this.refs = undefined;
this.dom = undefined;
@@ -2313,6 +2516,7 @@
this.hooks = {};
this.hooks.beforeParsed = new Hook(this);
+ this.hooks.filter = new Hook(this);
this.hooks.afterParsed = new Hook(this);
this.hooks.beforePageLayout = new Hook(this);
this.hooks.layout = new Hook(this);
@@ -2362,6 +2566,8 @@
parsed = new ContentParser(content);
+ this.hooks.filter.triggerSync(parsed);
+
this.source = parsed;
this.breakToken = undefined;
@@ -2372,7 +2578,7 @@
this.setup(renderTo);
}
- this.emit("rendering", content);
+ this.emit("rendering", parsed);
await this.hooks.afterParsed.trigger(parsed, this);
@@ -2385,7 +2591,7 @@
}
this.rendered = true;
- this.pagesArea.style.setProperty("--pagedjs-page-count", this.total);
+ this.pagesArea.style.setProperty("--pagedjs-page-count", this.total);
await this.hooks.afterRendered.trigger(this.pages, this);
@@ -2429,7 +2635,6 @@
let done = false;
let result;
-
while (!done) {
result = await this.q.enqueue(() => { return this.renderAsync(renderer); });
done = result.done;
@@ -25494,6 +25699,10 @@
--pagedjs-padding-right: 0mm;
--pagedjs-padding-bottom: 0mm;
--pagedjs-padding-left: 0mm;
+ --pagedjs-border-top: 0mm;
+ --pagedjs-border-right: 0mm;
+ --pagedjs-border-bottom: 0mm;
+ --pagedjs-border-left: 0mm;
--pagedjs-bleed-top: 0mm;
--pagedjs-bleed-right: 0mm;
--pagedjs-bleed-bottom: 0mm;
@@ -25513,6 +25722,7 @@
--pagedjs-mark-cross-display: none;
--pagedjs-mark-crop-display: none;
--pagedjs-page-count: 0;
+ --pagedjs-page-counter-increment: 1;
}
@page {
@@ -25581,6 +25791,7 @@
display: var(--pagedjs-mark-crop-display);
flex-grow: 0;
flex-shrink: 0;
+ z-index: 9999999999;
}
.pagedjs_bleed-top .pagedjs_marks-crop:nth-child(1),
@@ -25836,8 +26047,11 @@
grid-row: page;
width: 100%;
height: 100%;
- padding: var(--pagedjs-padding-top) var(--pagedjs-padding-right) var(--pagedjs-padding-bottom) var(--pagedjs-padding-left)
-
+ padding: var(--pagedjs-padding-top) var(--pagedjs-padding-right) var(--pagedjs-padding-bottom) var(--pagedjs-padding-left);
+ border-top: var(--pagedjs-border-top);
+ border-right: var(--pagedjs-border-right);
+ border-bottom: var(--pagedjs-border-bottom);
+ border-left: var(--pagedjs-border-left);
}
.pagedjs_pagebox > .pagedjs_area > .pagedjs_page_content {
@@ -25848,19 +26062,17 @@
}
.pagedjs_page {
- counter-increment: page;
+ counter-increment: page var(--pagedjs-page-counter-increment);
width: var(--pagedjs-width);
height: var(--pagedjs-height);
}
.pagedjs_page.pagedjs_right_page {
- counter-increment: page;
width: var(--pagedjs-width-right);
height: var(--pagedjs-height-right);
}
.pagedjs_page.pagedjs_left_page {
- counter-increment: page;
width: var(--pagedjs-width-left);
height: var(--pagedjs-height-left);
}
@@ -25869,7 +26081,6 @@
counter-reset: pages var(--pagedjs-page-count);
}
-
.pagedjs_pagebox .pagedjs_margin-top-left-corner,
.pagedjs_pagebox .pagedjs_margin-top-right-corner,
.pagedjs_pagebox .pagedjs_margin-bottom-left-corner,
@@ -26037,10 +26248,6 @@
content: none !important;
}
-img {
- height: auto;
-}
-
[data-align-last-split-element='justify'] {
text-align-last: justify;
}
@@ -26426,7 +26633,6 @@ img {
this.width = undefined;
this.height = undefined;
this.orientation = undefined;
-
this.marginalia = {};
}
@@ -26440,18 +26646,25 @@ img {
width: undefined,
height: undefined,
orientation: undefined,
- margin : {
+ margin: {
top: {},
right: {},
left: {},
bottom: {}
},
- padding : {
+ padding: {
top: {},
right: {},
left: {},
bottom: {}
},
+ border: {
+ top: {},
+ right: {},
+ left: {},
+ bottom: {}
+ },
+ backgroundOrigin: undefined,
block: {},
marks: undefined
};
@@ -26497,7 +26710,7 @@ img {
page.marginalia = marginalia;
}
- let declarations = this.replaceDeclartations(node);
+ let declarations = this.replaceDeclarations(node);
if (declarations.size) {
page.size = declarations.size;
@@ -26564,6 +26777,10 @@ img {
page.padding = declarations.padding;
}
+ if (declarations.border) {
+ page.border = declarations.border;
+ }
+
if (declarations.marks) {
page.marks = declarations.marks;
}
@@ -26606,15 +26823,15 @@ img {
let bleedrecto = undefined;
if (":left" in this.pages) {
- bleedverso = this.pages[":left"].bleed;
- }
+ bleedverso = this.pages[":left"].bleed;
+ }
- if (":right" in this.pages) {
- bleedrecto = this.pages[":right"].bleed;
- }
+ if (":right" in this.pages) {
+ bleedrecto = this.pages[":right"].bleed;
+ }
if ((width && height) &&
- (this.width !== width || this.height !== height)) {
+ (this.width !== width || this.height !== height)) {
this.width = width;
this.height = height;
this.format = format;
@@ -26702,7 +26919,7 @@ img {
return parsed;
}
- replaceDeclartations(ast) {
+ replaceDeclarations(ast) {
let parsed = {};
lib.walk(ast.block, {
@@ -26737,7 +26954,7 @@ img {
parsed.margin[m] = declaration.value.children.first();
dList.remove(dItem);
- } else if (prop === "padding"){
+ } else if (prop === "padding") {
parsed.padding = this.getPaddings(declaration.value);
dList.remove(dItem);
@@ -26753,8 +26970,43 @@ img {
}
parsed.padding[p] = declaration.value.children.first();
dList.remove(dItem);
+ }
- } else if (prop === "size") {
+ else if (prop === "border") {
+ if (!parsed.border) {
+ parsed.border = {
+ top: {},
+ right: {},
+ left: {},
+ bottom: {}
+ };
+ }
+ parsed.border.top = lib.generate(declaration.value);
+ parsed.border.right = lib.generate(declaration.value);
+ parsed.border.left = lib.generate(declaration.value);
+ parsed.border.bottom = lib.generate(declaration.value);
+
+ dList.remove(dItem);
+
+ }
+
+ else if (prop.indexOf("border-") === 0) {
+ if (!parsed.border) {
+ parsed.border = {
+ top: {},
+ right: {},
+ left: {},
+ bottom: {}
+ };
+ }
+ let p = prop.substring("border-".length);
+
+ parsed.border[p] = lib.generate(declaration.value);
+ dList.remove(dItem);
+
+ }
+
+ else if (prop === "size") {
parsed.size = this.getSize(declaration);
dList.remove(dItem);
} else if (prop === "bleed") {
@@ -26780,7 +27032,7 @@ img {
unit: "px"
});
break;
- // ignore
+ // ignore
}
}
@@ -26793,8 +27045,8 @@ img {
});
return parsed;
- }
+ }
getSize(declaration) {
let width, height, orientation, format;
@@ -26802,7 +27054,7 @@ img {
lib.walk(declaration, {
visit: "Dimension",
enter: (node, item, list) => {
- let {value, unit} = node;
+ let { value, unit } = node;
if (typeof width === "undefined") {
width = { value, unit };
} else if (typeof height === "undefined") {
@@ -26860,9 +27112,16 @@ img {
};
lib.walk(declaration, {
- visit: "Dimension",
- enter: (node, item, list) => {
- margins.push(node);
+ enter: (node) => {
+ switch (node.type) {
+ case "Dimension": // margin: 1in 2in, margin: 20px, etc...
+ margins.push(node);
+ break;
+ case "Number": // margin: 0
+ margins.push({value: node.value, unit: "px"});
+ break;
+ // ignore
+ }
}
});
@@ -26900,9 +27159,16 @@ img {
};
lib.walk(declaration, {
- visit: "Dimension",
- enter: (node, item, list) => {
- paddings.push(node);
+ enter: (node) => {
+ switch (node.type) {
+ case "Dimension": // padding: 1in 2in, padding: 20px, etc...
+ paddings.push(node);
+ break;
+ case "Number": // padding: 0
+ paddings.push({value: node.value, unit: "px"});
+ break;
+ // ignore
+ }
}
});
if (paddings.length === 1) {
@@ -26930,50 +27196,79 @@ img {
}
return padding;
}
+
+ // get values for the border on the @page to pass them to the element with the .pagedjs_area class
+ getBorders(declaration) {
+ let border = {
+ top: {},
+ right: {},
+ left: {},
+ bottom: {}
+ };
+
+ if (declaration.prop == "border") {
+ border.top = lib.generate(declaration.value);
+ border.right = lib.generate(declaration.value);
+ border.bottom = lib.generate(declaration.value);
+ border.left = lib.generate(declaration.value);
+
+ }
+ else if (declaration.prop == "border-top") {
+ border.top = lib.generate(declaration.value);
+ }
+ else if (declaration.prop == "border-right") {
+ border.right = lib.generate(declaration.value);
+
+ }
+ else if (declaration.prop == "border-bottom") {
+ border.bottom = lib.generate(declaration.value);
+
+ }
+ else if (declaration.prop == "border-left") {
+ border.left = lib.generate(declaration.value);
+ }
+
+ return border;
+ }
+
+
addPageClasses(pages, ast, sheet) {
// First add * page
- if ("*" in pages && !pages["*"].added) {
+ if ("*" in pages) {
let p = this.createPage(pages["*"], ast.children, sheet);
sheet.insertRule(p);
- pages["*"].added = true;
}
// Add :left & :right
- if (":left" in pages && !pages[":left"].added) {
+ if (":left" in pages) {
let left = this.createPage(pages[":left"], ast.children, sheet);
sheet.insertRule(left);
- pages[":left"].added = true;
}
- if (":right" in pages && !pages[":right"].added) {
+ if (":right" in pages) {
let right = this.createPage(pages[":right"], ast.children, sheet);
sheet.insertRule(right);
- pages[":right"].added = true;
}
// Add :first & :blank
- if (":first" in pages && !pages[":first"].first) {
+ if (":first" in pages) {
let first = this.createPage(pages[":first"], ast.children, sheet);
sheet.insertRule(first);
- pages[":first"].added = true;
}
- if (":blank" in pages && !pages[":blank"].added) {
+ if (":blank" in pages) {
let blank = this.createPage(pages[":blank"], ast.children, sheet);
sheet.insertRule(blank);
- pages[":blank"].added = true;
}
// Add nth pages
for (let pg in pages) {
- if (pages[pg].nth && !pages[pg].added) {
+ if (pages[pg].nth) {
let nth = this.createPage(pages[pg], ast.children, sheet);
sheet.insertRule(nth);
- pages[pg].added = true;
}
}
// Add named pages
for (let pg in pages) {
- if (pages[pg].name && !pages[pg].added) {
+ if (pages[pg].name) {
let named = this.createPage(pages[pg], ast.children, sheet);
sheet.insertRule(named);
- pages[pg].added = true;
}
}
@@ -26988,11 +27283,14 @@ img {
loc: 0,
children: children
};
+
+
let rule = this.createRule(selectors, block);
this.addMarginVars(page.margin, children, children.first());
-
this.addPaddingVars(page.padding, children, children.first());
+ this.addBorderVars(page.border, children, children.first());
+
if (page.width) {
this.addDimensions(page.width, page.height, page.orientation, children, children.first());
@@ -27002,7 +27300,6 @@ img {
this.addMarginaliaStyles(page, ruleList, rule, sheet);
this.addMarginaliaContent(page, ruleList, rule, sheet);
}
-
return rule;
}
@@ -27020,6 +27317,7 @@ img {
}
});
list.append(mVar, item);
+
}
}
}
@@ -27027,6 +27325,7 @@ img {
addPaddingVars(padding, list, item) {
// variables for padding
for (let p in padding) {
+
if (typeof padding[p].value !== "undefined") {
let value = padding[p].value + (padding[p].unit || "");
let pVar = list.createItem({
@@ -27044,6 +27343,25 @@ img {
}
}
+ addBorderVars(border, list, item) {
+ // variables for borders
+ for (let b in border) {
+ if (typeof border[b] !== "undefined") {
+ let value = border[b];
+ let bVar = list.createItem({
+ type: "Declaration",
+ property: "--pagedjs-border-" + b,
+ value: {
+ type: "Raw",
+ value: value
+ }
+ });
+ list.append(bVar, item);
+ }
+
+ }
+ }
+
addDimensions(width, height, orientation, list, item) {
let widthString, heightString;
@@ -27074,7 +27392,7 @@ img {
let block = lib.clone(page.marginalia[loc]);
let hasContent = false;
- if(block.children.isEmpty()) {
+ if (block.children.isEmpty()) {
continue;
}
@@ -27108,11 +27426,11 @@ img {
if (node.property === "width" &&
(loc === "top-left" ||
- loc === "top-center" ||
- loc === "top-right" ||
- loc === "bottom-left" ||
- loc === "bottom-center" ||
- loc === "bottom-right")) {
+ loc === "top-center" ||
+ loc === "top-right" ||
+ loc === "bottom-left" ||
+ loc === "bottom-center" ||
+ loc === "bottom-right")) {
let c = lib.clone(node);
c.property = "max-width";
list.appendData(c);
@@ -27120,11 +27438,11 @@ img {
if (node.property === "height" &&
(loc === "left-top" ||
- loc === "left-middle" ||
- loc === "left-bottom" ||
- loc === "right-top" ||
- loc === "right-middle" ||
- loc === "right-bottom")) {
+ loc === "left-middle" ||
+ loc === "left-bottom" ||
+ loc === "right-top" ||
+ loc === "right-middle" ||
+ loc === "right-bottom")) {
let c = lib.clone(node);
c.property = "max-height";
list.appendData(c);
@@ -27170,7 +27488,7 @@ img {
}
});
- if(content.children.isEmpty()) {
+ if (content.children.isEmpty()) {
continue;
}
@@ -27282,7 +27600,7 @@ img {
bleedLeftRecto = this.createVariable("--pagedjs-bleed-right-left", CSSValueToString(bleedrecto.left));
widthStringRight = `calc( ${CSSValueToString(width)} + ${CSSValueToString(bleedrecto.left)} + ${CSSValueToString(bleedrecto.right)} )`;
- heightStringRight = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedrecto.top)} + ${CSSValueToString(bleedrecto.bottom)} )`;
+ heightStringRight = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedrecto.top)} + ${CSSValueToString(bleedrecto.bottom)} )`;
}
if (bleedverso) {
bleedTopVerso = this.createVariable("--pagedjs-bleed-left-top", CSSValueToString(bleedverso.top));
@@ -27291,18 +27609,18 @@ img {
bleedLeftVerso = this.createVariable("--pagedjs-bleed-left-left", CSSValueToString(bleedverso.left));
widthStringLeft = `calc( ${CSSValueToString(width)} + ${CSSValueToString(bleedverso.left)} + ${CSSValueToString(bleedverso.right)} )`;
- heightStringLeft = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedverso.top)} + ${CSSValueToString(bleedverso.bottom)} )`;
+ heightStringLeft = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedverso.top)} + ${CSSValueToString(bleedverso.bottom)} )`;
}
let pageWidthVar = this.createVariable("--pagedjs-width", CSSValueToString(width));
let pageHeightVar = this.createVariable("--pagedjs-height", CSSValueToString(height));
rules.push(
- bleedTop,
- bleedRight,
- bleedBottom,
- bleedLeft,
- bleedTopRecto,
+ bleedTop,
+ bleedRight,
+ bleedBottom,
+ bleedLeft,
+ bleedTopRecto,
bleedRightRecto,
bleedBottomRecto,
bleedLeftRecto,
@@ -27310,7 +27628,7 @@ img {
bleedRightVerso,
bleedBottomVerso,
bleedLeftVerso,
- pageWidthVar,
+ pageWidthVar,
pageHeightVar
);
}
@@ -27957,6 +28275,7 @@ img {
if (start) {
this.addPageAttributes(page, start, chunker.pages);
}
+ // page.element.querySelector('.paged_area').style.color = red;
}
afterPageLayout(fragment, page, breakToken, chunker) {
@@ -27995,14 +28314,14 @@ img {
if (centerContent) {
centerWidth = window.getComputedStyle(center)["max-width"];
- if(centerWidth === "none" || centerWidth === "auto") {
- if(!leftContent && !rightContent){
+ if (centerWidth === "none" || centerWidth === "auto") {
+ if (!leftContent && !rightContent) {
marginGroup.style["grid-template-columns"] = "0 1fr 0";
- }else if(leftContent){
- if(!rightContent){
- if(leftWidth !== "none" && leftWidth !== "auto"){
+ } else if (leftContent) {
+ if (!rightContent) {
+ if (leftWidth !== "none" && leftWidth !== "auto") {
marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + leftWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "auto auto 1fr";
left.style["white-space"] = "nowrap";
center.style["white-space"] = "nowrap";
@@ -28014,17 +28333,17 @@ img {
left.style["white-space"] = "normal";
center.style["white-space"] = "normal";
}
- }else {
- if(leftWidth !== "none" && leftWidth !== "auto"){
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (leftWidth !== "none" && leftWidth !== "auto") {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + leftWidth;
}
- }else {
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = rightWidth + " 1fr " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "auto auto 1fr";
left.style["white-space"] = "nowrap";
center.style["white-space"] = "nowrap";
@@ -28034,9 +28353,9 @@ img {
let rightOuterWidth = right.offsetWidth;
let outerwidths = leftOuterWidth + centerOuterWidth + rightOuterWidth;
let newcenterWidth = centerOuterWidth * 100 / outerwidths;
- if(newcenterWidth > 40){
+ if (newcenterWidth > 40) {
marginGroup.style["grid-template-columns"] = "minmax(16.66%, 1fr) minmax(33%, " + newcenterWidth + "%) minmax(16.66%, 1fr)";
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "repeat(3, 1fr)";
}
left.style["white-space"] = "normal";
@@ -28045,10 +28364,10 @@ img {
}
}
}
- }else {
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = rightWidth + " 1fr " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "auto auto 1fr";
right.style["white-space"] = "nowrap";
center.style["white-space"] = "nowrap";
@@ -28061,32 +28380,32 @@ img {
center.style["white-space"] = "normal";
}
}
- }else if(centerWidth !== "none" && centerWidth !== "auto"){
- if(leftContent && leftWidth !== "none" && leftWidth !== "auto"){
+ } else if (centerWidth !== "none" && centerWidth !== "auto") {
+ if (leftContent && leftWidth !== "none" && leftWidth !== "auto") {
marginGroup.style["grid-template-columns"] = leftWidth + " " + centerWidth + " 1fr";
- }else if(rightContent && rightWidth !== "none" && rightWidth !== "auto"){
+ } else if (rightContent && rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = "1fr " + centerWidth + " " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "1fr " + centerWidth + " 1fr";
}
}
- }else {
- if(leftContent){
- if(!rightContent){
+ } else {
+ if (leftContent) {
+ if (!rightContent) {
marginGroup.style["grid-template-columns"] = "1fr 0 0";
- }else {
- if(leftWidth !== "none" && leftWidth !== "auto"){
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (leftWidth !== "none" && leftWidth !== "auto") {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = leftWidth + " 0 1fr";
}
- }else {
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = "1fr 0 " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "auto 1fr auto";
left.style["white-space"] = "nowrap";
right.style["white-space"] = "nowrap";
@@ -28094,16 +28413,16 @@ img {
let rightOuterWidth = right.offsetWidth;
let outerwidths = leftOuterWidth + rightOuterWidth;
let newLeftWidth = leftOuterWidth * 100 / outerwidths;
- marginGroup.style["grid-template-columns"] = "minmax(16.66%, " + newLeftWidth + "%) 0 1fr";
+ marginGroup.style["grid-template-columns"] = "minmax(16.66%, " + newLeftWidth + "%) 0 1fr";
left.style["white-space"] = "normal";
right.style["white-space"] = "normal";
}
}
}
- }else {
- if(rightWidth !== "none" && rightWidth !== "auto"){
+ } else {
+ if (rightWidth !== "none" && rightWidth !== "auto") {
marginGroup.style["grid-template-columns"] = "1fr 0 " + rightWidth;
- }else {
+ } else {
marginGroup.style["grid-template-columns"] = "0 0 1fr";
}
}
@@ -28131,66 +28450,66 @@ img {
if (middle) {
middleHeight = window.getComputedStyle(middle)["max-height"];
- if(middleHeight === "none" || middleHeight === "auto") {
- if(!topContent && !bottomContent){
+ if (middleHeight === "none" || middleHeight === "auto") {
+ if (!topContent && !bottomContent) {
marginGroup.style["grid-template-rows"] = "0 1fr 0";
- }else if(topContent){
- if(!bottomContent){
- if(topHeight !== "none" && topHeight !== "auto"){
+ } else if (topContent) {
+ if (!bottomContent) {
+ if (topHeight !== "none" && topHeight !== "auto") {
marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + "*2) " + topHeight;
}
- }else {
- if(topHeight !== "none" && topHeight !== "auto"){
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (topHeight !== "none" && topHeight !== "auto") {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + " - " + bottomHeight + ") " + bottomHeight;
- }else {
+ } else {
marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + "*2) " + topHeight;
}
- }else {
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = bottomHeight + " calc(100% - " + bottomHeight + "*2) " + bottomHeight;
}
}
}
- }else {
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = bottomHeight + " calc(100% - " + bottomHeight + "*2) " + bottomHeight;
}
}
- }else {
- if(topContent && topHeight !== "none" && topHeight !== "auto"){
- marginGroup.style["grid-template-rows"] = topHeight +" " + middleHeight + " calc(100% - (" + topHeight + " + " + middleHeight + "))";
- }else if(bottomContent && bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (topContent && topHeight !== "none" && topHeight !== "auto") {
+ marginGroup.style["grid-template-rows"] = topHeight + " " + middleHeight + " calc(100% - (" + topHeight + " + " + middleHeight + "))";
+ } else if (bottomContent && bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = "1fr " + middleHeight + " " + bottomHeight;
- }else {
+ } else {
marginGroup.style["grid-template-rows"] = "calc((100% - " + middleHeight + ")/2) " + middleHeight + " calc((100% - " + middleHeight + ")/2)";
}
}
- }else {
- if(topContent){
- if(!bottomContent){
+ } else {
+ if (topContent) {
+ if (!bottomContent) {
marginGroup.style["grid-template-rows"] = "1fr 0 0";
- }else {
- if(topHeight !== "none" && topHeight !== "auto"){
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (topHeight !== "none" && topHeight !== "auto") {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = topHeight + " 1fr " + bottomHeight;
- }else {
+ } else {
marginGroup.style["grid-template-rows"] = topHeight + " 0 1fr";
}
- }else {
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = "1fr 0 " + bottomHeight;
- }else {
+ } else {
marginGroup.style["grid-template-rows"] = "1fr 0 1fr";
}
}
}
- }else {
- if(bottomHeight !== "none" && bottomHeight !== "auto"){
+ } else {
+ if (bottomHeight !== "none" && bottomHeight !== "auto") {
marginGroup.style["grid-template-rows"] = "1fr 0 " + bottomHeight;
- }else {
+ } else {
marginGroup.style["grid-template-rows"] = "0 0 1fr";
}
}
@@ -28310,7 +28629,7 @@ img {
};
}
- createCalculatedDimension(property, items, important, operator="+") {
+ createCalculatedDimension(property, items, important, operator = "+") {
let children = new lib.List();
let calculations = new lib.List();
@@ -28500,17 +28819,31 @@ img {
for (let prop of breaks[b]) {
if (prop.property === "break-after") {
- let nodeAfter = elementAfter(elements[i]);
+ let nodeAfter = displayedElementAfter(elements[i], parsed);
elements[i].setAttribute("data-break-after", prop.value);
if (nodeAfter) {
nodeAfter.setAttribute("data-previous-break-after", prop.value);
}
+ } else if (prop.property === "break-before") {
+ let nodeBefore = displayedElementBefore(elements[i], parsed);
+
+ // Breaks are only allowed between siblings, not between a box and its container.
+ // If we cannot find a node before we should not break!
+ // https://drafts.csswg.org/css-break-3/#break-propagation
+ if (nodeBefore) {
+ if (prop.value === "page" && needsPageBreak(elements[i], nodeBefore)) {
+ // we ignore this explicit page break because an implicit page break is already needed
+ continue;
+ }
+ elements[i].setAttribute("data-break-before", prop.value);
+ nodeBefore.setAttribute("data-next-break-before", prop.value);
+ }
} else if (prop.property === "page") {
elements[i].setAttribute("data-page", prop.value);
- let nodeAfter = elementAfter(elements[i]);
+ let nodeAfter = displayedElementAfter(elements[i], parsed);
if (nodeAfter) {
nodeAfter.setAttribute("data-after-page", prop.value);
@@ -28669,6 +29002,7 @@ img {
this.styleSheet = polisher.styleSheet;
this.counters = {};
+ this.resetCountersMap = new Map();
}
onDeclaration(declaration, dItem, dList, rule) {
@@ -28711,10 +29045,9 @@ img {
}
handleIncrement(declaration, rule) {
- let identifier = declaration.value.children.first();
- let number = declaration.value.children.getSize() > 1
- && declaration.value.children.last().value;
- let name = identifier && identifier.name;
+ const identifier = declaration.value.children.first();
+ const number = declaration.value.children.getSize() > 1 ? declaration.value.children.last().value : 1;
+ const name = identifier && identifier.name;
if (name === "page" || name.indexOf("target-counter-") === 0) {
return;
@@ -28731,7 +29064,7 @@ img {
return counter.increments[selector] = {
selector: selector,
- number: number || 1
+ number
};
}
@@ -28761,17 +29094,21 @@ img {
counter = this.counters[c];
this.processCounterIncrements(parsed, counter);
this.processCounterResets(parsed, counter);
- this.addCounterValues(parsed, counter);
+ if (c !== "page") {
+ this.addCounterValues(parsed, counter);
+ }
}
}
scopeCounters(counters) {
let countersArray = [];
for (let c in counters) {
- countersArray.push(`${counters[c].name} 0`);
+ if(c !== "page") {
+ countersArray.push(`${counters[c].name} 0`);
+ }
}
// Add to pages to allow cross page scope
- this.insertRule(`.pagedjs_pages { counter-reset: ${countersArray.join(" ")}}`);
+ this.insertRule(`.pagedjs_pages { counter-reset: ${countersArray.join(" ")} page 0 pages var(--pagedjs-page-count)}`);
}
insertRule(rule) {
@@ -28785,7 +29122,7 @@ img {
// Find elements for increments
let incrementElements = parsed.querySelectorAll(increment.selector);
// Add counter data
- for (var i = 0; i < incrementElements.length; i++) {
+ for (let i = 0; i < incrementElements.length; i++) {
incrementElements[i].setAttribute("data-counter-"+ counter.name +"-increment", increment.number);
incrementElements[i].setAttribute("data-counter-increment", counter.name);
}
@@ -28807,8 +29144,8 @@ img {
}
addCounterValues(parsed, counter) {
- let counterName = counter.name;
- let elements = parsed.querySelectorAll("[data-counter-"+ counterName +"-reset], [data-counter-"+ counterName +"-increment]");
+ const counterName = counter.name;
+ const elements = parsed.querySelectorAll("[data-counter-"+ counterName +"-reset], [data-counter-"+ counterName +"-increment]");
let count = 0;
let element;
@@ -28816,7 +29153,7 @@ img {
let resetValue, incrementValue, resetDelta;
let incrementArray;
- for (var i = 0; i < elements.length; i++) {
+ for (let i = 0; i < elements.length; i++) {
element = elements[i];
resetDelta = 0;
incrementArray = [];
@@ -28854,16 +29191,16 @@ img {
incrementCounterForElement(element, incrementArray) {
if (!element || !incrementArray || incrementArray.length === 0) return;
- let ref = element.dataset.ref;
- let prevIncrements = Array.from(this.styleSheet.cssRules).filter((rule) => {
+ const ref = element.dataset.ref;
+ const prevIncrements = Array.from(this.styleSheet.cssRules).filter((rule) => {
return rule.selectorText === `[data-ref="${element.dataset.ref}"]:not([data-split-from])`
&& rule.style[0] === "counter-increment";
});
- let increments = [];
+ const increments = [];
for (let styleRule of prevIncrements) {
let values = styleRule.style.counterIncrement.split(" ");
- for (var i = 0; i < values.length; i+=2) {
+ for (let i = 0; i < values.length; i+=2) {
increments.push(values[i] + " " + values[i+1]);
}
}
@@ -28876,8 +29213,14 @@ img {
afterPageLayout(pageElement, page) {
let pgreset = pageElement.querySelectorAll("[data-counter-page-reset]");
pgreset.forEach((reset) => {
- let value = reset.datasetCounterPageReset;
- this.styleSheet.insertRule(`[data-page-number="${pageElement.dataset.pageNumber}"] { counter-reset: page ${value} }`, this.styleSheet.cssRules.length);
+ const ref = reset.dataset && reset.dataset.ref;
+ if (ref && this.resetCountersMap.has(ref)) ; else {
+ if (ref) {
+ this.resetCountersMap.set(ref, "");
+ }
+ let value = reset.dataset.counterPageReset;
+ this.styleSheet.insertRule(`[data-page-number="${pageElement.dataset.pageNumber}"] { counter-increment: none; counter-reset: page ${value}; }`, this.styleSheet.cssRules.length);
+ }
});
}
@@ -28908,9 +29251,16 @@ img {
}
addDataNumbers(list) {
+ let start = 1;
+ if (list.hasAttribute("start")) {
+ start = parseInt(list.getAttribute("start"), 10);
+ if (isNaN(start)) {
+ start = 1;
+ }
+ }
let items = list.children;
for (var i = 0; i < items.length; i++) {
- items[i].setAttribute("data-item-num", i + 1);
+ items[i].setAttribute("data-item-num", i + start);
}
}
@@ -28950,6 +29300,176 @@ img {
}
}
+ class PageCounterIncrement extends Handler {
+ constructor(chunker, polisher, caller) {
+ super(chunker, polisher, caller);
+
+ this.styleSheet = polisher.styleSheet;
+ this.pageCounter = {
+ name: "page",
+ increments: {},
+ resets: {}
+ };
+ }
+
+ onDeclaration(declaration, dItem, dList, rule) {
+ const property = declaration.property;
+
+ if (property === "counter-increment") {
+ let inc = this.handleIncrement(declaration, rule);
+ if (inc) {
+ dList.remove(dItem);
+ }
+ }
+ }
+
+ afterParsed(_) {
+ for (const inc in this.pageCounter.increments) {
+ const increment = this.pageCounter.increments[inc];
+ this.insertRule(`${increment.selector} { --pagedjs-page-counter-increment: ${increment.number} }`);
+ }
+ }
+
+ handleIncrement(declaration, rule) {
+ const identifier = declaration.value.children.first();
+ const number = declaration.value.children.getSize() > 1 ? declaration.value.children.last().value : 1;
+ const name = identifier && identifier.name;
+
+ if (name.indexOf("target-counter-") === 0) {
+ return;
+ }
+ // A counter named page is automatically created and incremented by 1 on every page of the document,
+ // unless the counter-increment property in the page context explicitly specifies a different increment for the page counter.
+ // https://www.w3.org/TR/css-page-3/#page-based-counters
+ if (name !== "page") {
+ return;
+ }
+ // the counter-increment property is not defined on the page context (i.e. @page rule), ignoring...
+ if (rule.ruleNode.name === "page" && rule.ruleNode.type === "Atrule") {
+ return;
+ }
+ const selector = lib.generate(rule.ruleNode.prelude);
+ return this.pageCounter.increments[selector] = {
+ selector: selector,
+ number
+ };
+ }
+
+ insertRule(rule) {
+ this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length);
+ }
+ }
+
+ class NthOfType extends Handler {
+ constructor(chunker, polisher, caller) {
+ super(chunker, polisher, caller);
+
+ this.styleSheet = polisher.styleSheet;
+ this.selectors = {};
+ }
+
+ onRule(ruleNode, ruleItem, rulelist) {
+ let selector = lib.generate(ruleNode.prelude);
+ if (selector.match(/:(first|last|nth)-of-type/)) {
+
+ let declarations = lib.generate(ruleNode.block);
+ declarations = declarations.replace(/[{}]/g,"");
+
+ let uuid = "nth-of-type-" + UUID();
+
+ selector.split(",").forEach((s) => {
+ if (!this.selectors[s]) {
+ this.selectors[s] = [uuid, declarations];
+ } else {
+ this.selectors[s][1] = `${this.selectors[s][1]};${declarations}` ;
+ }
+ });
+
+ rulelist.remove(ruleItem);
+ }
+ }
+
+ afterParsed(parsed) {
+ this.processSelectors(parsed, this.selectors);
+ }
+
+ processSelectors(parsed, selectors) {
+ // add the new attributes to matching elements
+ for (let s in selectors) {
+ let elements = parsed.querySelectorAll(s);
+
+ for (var i = 0; i < elements.length; i++) {
+ let dataNthOfType = elements[i].getAttribute("data-nth-of-type");
+
+ if (dataNthOfType && dataNthOfType != "") {
+ dataNthOfType = `${dataNthOfType},${selectors[s][0]}`;
+ elements[i].setAttribute("data-nth-of-type", dataNthOfType);
+ } else {
+ elements[i].setAttribute("data-nth-of-type", selectors[s][0]);
+ }
+ }
+
+ let rule = `*[data-nth-of-type*='${selectors[s][0]}'] { ${selectors[s][1]}; }`;
+ this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length);
+ }
+ }
+ }
+
+ class Following extends Handler {
+ constructor(chunker, polisher, caller) {
+ super(chunker, polisher, caller);
+
+ this.styleSheet = polisher.styleSheet;
+ this.selectors = {};
+ }
+
+ onRule(ruleNode, ruleItem, rulelist) {
+ let selector = lib.generate(ruleNode.prelude);
+ if (selector.match(/\+/)) {
+
+ let declarations = lib.generate(ruleNode.block);
+ declarations = declarations.replace(/[{}]/g,"");
+
+ let uuid = "following-" + UUID();
+
+ selector.split(",").forEach((s) => {
+ if (!this.selectors[s]) {
+ this.selectors[s] = [uuid, declarations];
+ } else {
+ this.selectors[s][1] = `${this.selectors[s][1]};${declarations}` ;
+ }
+ });
+
+ rulelist.remove(ruleItem);
+ }
+ }
+
+ afterParsed(parsed) {
+ this.processSelectors(parsed, this.selectors);
+ }
+
+ processSelectors(parsed, selectors) {
+ // add the new attributes to matching elements
+ for (let s in selectors) {
+ let elements = parsed.querySelectorAll(s);
+
+ for (var i = 0; i < elements.length; i++) {
+ let dataFollowing = elements[i].getAttribute("data-following");
+
+ if (dataFollowing && dataFollowing != "") {
+ dataFollowing = `${dataFollowing},${selectors[s][0]}`;
+ elements[i].setAttribute("data-following", dataFollowing);
+ } else {
+ elements[i].setAttribute("data-following", selectors[s][0]);
+ }
+ }
+
+ let rule = `*[data-following*='${selectors[s][0]}'] { ${selectors[s][1]}; }`;
+ this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length);
+ }
+ }
+ }
+
var pagedMediaHandlers = [
AtPage,
Breaks,
@@ -28957,7 +29477,10 @@ img {
Splits,
Counters,
Lists,
- PositionFixed
+ PositionFixed,
+ PageCounterIncrement,
+ NthOfType,
+ Following
];
class RunningHeaders extends Handler {
@@ -29193,6 +29716,13 @@ img {
});
}
+ function cleanSelector(el) {
+ if(el == null) return;
+ return el
+ .replace(new RegExp("::footnote-call", "g"), "")
+ .replace(new RegExp("::footnote-marker", "g"), "");
+ }
+
class StringSets extends Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
@@ -29234,13 +29764,24 @@ img {
funcNode.name = "var";
funcNode.children = new lib.List();
- funcNode.children.append(
- funcNode.children.createItem({
- type: "Identifier",
- loc: null,
- name: "--pagedjs-string-" + identifier
- })
- );
+
+ if(this.type === "first" || this.type === "last" || this.type === "start" || this.type === "first-except"){
+ funcNode.children.append(
+ funcNode.children.createItem({
+ type: "Identifier",
+ loc: null,
+ name: "--pagedjs-string-" + this.type + "-" + identifier
+ })
+ );
+ }else {
+ funcNode.children.append(
+ funcNode.children.createItem({
+ type: "Identifier",
+ loc: null,
+ name: "--pagedjs-string-first-" + identifier
+ })
+ );
+ }
}
}
@@ -29252,59 +29793,65 @@ img {
this.pageLastString = {};
}
- // get the value of the previous last string
+
for (let name of Object.keys(this.stringSetSelectors)) {
let set = this.stringSetSelectors[name];
let selected = fragment.querySelectorAll(set.selector);
-
- // let cssVar = previousPageLastString;
+
// Get the last found string for the current identifier
- let cssVar = ( name in this.pageLastString ) ? this.pageLastString[name] : "";
-
- selected.forEach((sel) => {
- // push each content into the array to define in the variable the first and the last element of the page.
-
-
- //this.pageLastString = selected[selected.length - 1].textContent;
- // Index by identifier
- this.pageLastString[name] = selected[selected.length - 1].textContent;
-
+ let stringPrevPage = ( name in this.pageLastString ) ? this.pageLastString[name] : "";
+
+ let varFirst, varLast, varStart, varFirstExcept;
+
+ if(selected.length == 0){
+ // if there is no sel. on the page
+ varFirst = stringPrevPage;
+ varLast = stringPrevPage;
+ varStart = stringPrevPage;
+ varFirstExcept = stringPrevPage;
+ }else {
+
+ selected.forEach((sel) => {
+ // push each content into the array to define in the variable the first and the last element of the page.
+ this.pageLastString[name] = selected[selected.length - 1].textContent;
- if (this.type === "first") {
- cssVar = selected[0].textContent;
- }
-
- else if (this.type === "last") {
- cssVar = selected[selected.length - 1].textContent;
- }
-
- else if (this.type === "start") {
-
- if (sel.parentElement.firstChild === sel) {
- cssVar = sel.textContent;
- }
+ });
+
+ /* FIRST */
+
+ varFirst = selected[0].textContent;
+
+
+ /* LAST */
+
+ varLast = selected[selected.length - 1].textContent;
+
+
+ /* START */
+
+ // Hack to find if the sel. is the first elem of the page / find a better way
+ let selTop = selected[0].getBoundingClientRect().top;
+ let pageContent = selected[0].closest(".pagedjs_page_content");
+ let pageContentTop = pageContent.getBoundingClientRect().top;
+
+ if(selTop == pageContentTop){
+ varStart = varFirst;
+ }else {
+ varStart = stringPrevPage;
}
-
- else if (this.type === "first-except") {
- cssVar = "";
- }
-
- else {
- cssVar = selected[0].textContent;
- }
- });
-
- fragment.setAttribute("data-string", `string-type-${this.type}-${name}`);
-
-
- // fragment.style.setProperty(`--pagedjs-string-${name}`, `"${cssVar.replace(/\\([\s\S])|(["|'])/g, "\\$1$2")}"`);
- fragment.style.setProperty(`--pagedjs-string-${name}`, `"${cleanPseudoContent(cssVar)}`);
-
- // if there is no new string on the page
- if (!fragment.hasAttribute("data-string")) {
- fragment.style.setProperty(`--pagedjs-string-${name}`, `"${this.pageLastString}"`);
- }
+
+ /* FIRST EXCEPT */
+
+ varFirstExcept = "";
+
+ }
+
+ fragment.style.setProperty(`--pagedjs-string-first-${name}`, `"${cleanPseudoContent(varFirst)}`);
+ fragment.style.setProperty(`--pagedjs-string-last-${name}`, `"${cleanPseudoContent(varLast)}`);
+ fragment.style.setProperty(`--pagedjs-string-start-${name}`, `"${cleanPseudoContent(varStart)}`);
+ fragment.style.setProperty(`--pagedjs-string-first-except-${name}`, `"${cleanPseudoContent(varFirstExcept)}`);
+
}
}
@@ -29368,7 +29915,7 @@ img {
variable: variable
};
});
-
+
// Replace with counter
funcNode.name = "counter";
funcNode.children = new lib.List();
@@ -29390,7 +29937,7 @@ img {
let target = this.counterTargets[name];
let split = target.selector.split("::");
let query = split[0];
-
+
let queried = chunker.pagesArea.querySelectorAll(query + ":not([data-" + target.variable + "])");
queried.forEach((selected, index) => {
@@ -29412,16 +29959,19 @@ img {
if (target.counter === "page") {
let pages = chunker.pagesArea.querySelectorAll(".pagedjs_page");
let pg = 0;
- for (var i = 0; i < pages.length; i++) {
+ for (let i = 0; i < pages.length; i++) {
let styles = window.getComputedStyle(pages[i]);
let reset = styles["counter-reset"].replace("page", "").trim();
+ let increment = styles["counter-increment"].replace("page", "").trim();
if (reset !== "none") {
pg = parseInt(reset);
}
- pg += 1;
+ if (increment !== "none") {
+ pg += parseInt(increment);
+ }
- if (pages[i].contains( element )){
+ if (pages[i].contains(element)) {
break;
}
}
@@ -29569,6 +30119,332 @@ img {
TargetText
];
+ class WhiteSpaceFilter extends Handler {
+ constructor(chunker, polisher, caller) {
+ super(chunker, polisher, caller);
+ }
+
+ filter(content) {
+
+ filterTree(content, (node) => {
+ return this.filterEmpty(node);
+ }, NodeFilter.SHOW_TEXT);
+
+ }
+
+ filterEmpty(node) {
+ if (node.textContent.length > 1 && isIgnorable(node)) {
+
+ // Do not touch the content if text is pre-formatted
+ let parent = node.parentNode;
+ let pre = isElement(parent) && parent.closest("pre");
+ if (pre) {
+ return NodeFilter.FILTER_REJECT;
+ }
+
+ const previousSibling = previousSignificantNode(node);
+ const nextSibling = nextSignificantNode(node);
+
+ if (nextSibling === null && previousSibling === null) {
+ // we should not remove a Node that does not have any siblings.
+ node.textContent = " ";
+ return NodeFilter.FILTER_REJECT;
+ }
+ if (nextSibling === null) {
+ // we can safely remove this node
+ return NodeFilter.FILTER_ACCEPT;
+ }
+ if (previousSibling === null) {
+ // we can safely remove this node
+ return NodeFilter.FILTER_ACCEPT;
+ }
+
+ // replace the content with a single space
+ node.textContent = " ";
+
+ // TODO: we also need to preserve sequences of white spaces when the parent has "white-space" rule:
+ // pre
+ // Sequences of white space are preserved. Lines are only broken at newline characters in the source and at
elements. + // + // pre-wrap + // Sequences of white space are preserved. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // pre-line + // Sequences of white space are collapsed. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // break-spaces + // The behavior is identical to that of pre-wrap, except that: + // - Any sequence of preserved white space always takes up space, including at the end of the line. + // - A line breaking opportunity exists after every preserved white space character, including between white space characters. + // - Such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). + // + // See: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#Values + + return NodeFilter.FILTER_REJECT; + } else { + return NodeFilter.FILTER_REJECT; + } + } + + } + + class CommentsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + filterTree(content, null, NodeFilter.SHOW_COMMENT); + } + + } + + class ScriptsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + content.querySelectorAll("script").forEach( script => { script.remove(); }); + } + + } + + var clearCut = createCommonjsModule(function (module, exports) { + /** + * Originally ported from https://github.com/keeganstreet/specificity/blob/866bf7ab4e7f62a7179c15b13a95af4e1c7b1afa/specificity.js + * + * Calculates the specificity of CSS selectors + * http://www.w3.org/TR/css3-selectors/#specificity + * + * Returns a selector integer value + */ + + // The following regular expressions assume that selectors matching the preceding regular expressions have been removed + var attributeRegex = /(\[[^\]]+\])/g; + var idRegex = /(#[^\s\+>~\.\[:]+)/g; + var classRegex = /(\.[^\s\+>~\.\[:]+)/g; + var pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/g; + var pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g; + var elementRegex = /([^\s\+>~\.\[:]+)/g; + var notRegex = /:not\(([^\)]*)\)/g; + var ruleRegex = /\{[^]*/gm; + var separatorRegex = /[\*\s\+>~]/g; + var straysRegex = /[#\.]/g; + + // Find matches for a regular expression in a string and push their details to parts + // Type is "a" for IDs, "b" for classes, attributes and pseudo-classes and "c" for elements and pseudo-elements + var findMatch = function(regex, type, types, selector) { + var matches = selector.match(regex); + if (matches) { + for (var i = 0; i < matches.length; i++) { + types[type]++; + // Replace this simple selector with whitespace so it won't be counted in further simple selectors + selector = selector.replace(matches[i], ' '); + } + } + + return selector; + }; + + // Calculate the specificity for a selector by dividing it into simple selectors and counting them + var calculate = function(selector) { + var commaIndex = selector.indexOf(','); + if (commaIndex !== -1) { + selector = selector.substring(0, commaIndex); + } + + var types = { + a: 0, + b: 0, + c: 0 + }; + + // Remove the negation psuedo-class (:not) but leave its argument because specificity is calculated on its argument + selector = selector.replace(notRegex, ' $1 '); + + // Remove anything after a left brace in case a user has pasted in a rule, not just a selector + selector = selector.replace(ruleRegex, ' '); + + // Add attribute selectors to parts collection (type b) + selector = findMatch(attributeRegex, 'b', types, selector); + + // Add ID selectors to parts collection (type a) + selector = findMatch(idRegex, 'a', types, selector); + + // Add class selectors to parts collection (type b) + selector = findMatch(classRegex, 'b', types, selector); + + // Add pseudo-element selectors to parts collection (type c) + selector = findMatch(pseudoElementRegex, 'c', types, selector); + + // Add pseudo-class selectors to parts collection (type b) + selector = findMatch(pseudoClassRegex, 'b', types, selector); + + // Remove universal selector and separator characters + selector = selector.replace(separatorRegex, ' '); + + // Remove any stray dots or hashes which aren't attached to words + // These may be present if the user is live-editing this selector + selector = selector.replace(straysRegex, ' '); + + // The only things left should be element selectors (type c) + findMatch(elementRegex, 'c', types, selector); + + return (types.a * 100) + (types.b * 10) + (types.c * 1); + }; + + var specificityCache = {}; + + exports.calculateSpecificity = function(selector) { + var specificity = specificityCache[selector]; + if (specificity === undefined) { + specificity = calculate(selector); + specificityCache[selector] = specificity; + } + return specificity; + }; + + var validSelectorCache = {}; + var testSelectorElement = null; + + exports.isSelectorValid = function(selector) { + var valid = validSelectorCache[selector]; + if (valid === undefined) { + if (testSelectorElement == null) { + testSelectorElement = document.createElement('div'); + } + + try { + testSelectorElement.querySelector(selector); + valid = true; + } catch (error) { + valid = false; + } + validSelectorCache[selector] = valid; + } + return valid; + }; + + exports.validateSelector = function(selector) { + if (!exports.isSelectorValid(selector)) { + var error = new SyntaxError(selector + ' is not a valid selector'); + error.code = 'EBADSELECTOR'; + throw error; + } + }; + }); + var clearCut_1 = clearCut.calculateSpecificity; + var clearCut_2 = clearCut.isSelectorValid; + var clearCut_3 = clearCut.validateSelector; + + class UndisplayedFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + this.displayRules = {}; + } + + onDeclaration(declaration, dItem, dList, rule) { + if (declaration.property === "display") { + let selector = lib.generate(rule.ruleNode.prelude); + let value = declaration.value.children.first().name; + + selector.split(",").forEach((s) => { + this.displayRules[s] = { + value: value, + selector: s, + specificity: clearCut_1(s), + important: declaration.important + }; + }); + } + } + + filter(content) { + let { matches, selectors } = this.sortDisplayedSelectors(content, this.displayRules); + + // Find matching elements that have display styles + for (let i = 0; i < matches.length; i++) { + let element = matches[i]; + let selector = selectors[i]; + let displayValue = selector[selector.length-1].value; + if(this.removable(element) && displayValue === "none") { + element.dataset.undisplayed = "undisplayed"; + } + } + + // Find elements that have inline styles + let styledElements = content.querySelectorAll("[style]"); + for (let i = 0; i < styledElements.length; i++) { + let element = styledElements[i]; + if (this.removable(element)) { + element.dataset.undisplayed = "undisplayed"; + } + } + } + + sorter(a, b) { + if (a.important && !b.important) { + return 1; + } + + if (b.important && !a.important) { + return -1; + } + + return a.specificity - b.specificity; + } + + sortDisplayedSelectors(content, displayRules=[]) { + let matches = []; + let selectors = []; + for (let d in displayRules) { + let displayItem = displayRules[d]; + let selector = displayItem.selector; + let query = []; + try { + try { + query = content.querySelectorAll(selector); + } catch (e) { + query = content.querySelectorAll(cleanSelector(selector)); + } + } catch (e) { + query = []; + } + let elements = Array.from(query); + for (let e of elements) { + if (matches.includes(e)) { + let index = matches.indexOf(e); + selectors[index].push(displayItem); + selectors[index] = selectors[index].sort(this.sorter); + } else { + matches.push(e); + selectors.push([displayItem]); + } + } + } + + return { matches, selectors }; + } + + removable(element) { + if (element.style && + element.style.display !== "" && + element.style.display !== "none") { + return false; + } + + return true; + } + } + + var filters = [ + WhiteSpaceFilter, + CommentsFilter, + ScriptsFilter, + UndisplayedFilter + ]; + var isImplemented$3 = function () { var from = Array.from, arr, result; if (typeof from !== "function") return false; @@ -29997,7 +30873,7 @@ img { return pipe; }; - let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers]; + let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers, ...filters]; class Handlers { constructor(chunker, polisher, caller) { diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js new file mode 100644 index 0000000..e494029 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js @@ -0,0 +1,100 @@ +var UID = { + _current: 0, + getNew: function(){ + this._current++; + return this._current; + } +}; + +HTMLElement.prototype.pseudoStyle = function(element,prop,value){ + var _this = this; + var _sheetId = "pseudoStyles"; + var _head = document.head || document.getElementsByTagName('head')[0]; + var _sheet = document.getElementById(_sheetId) || document.createElement('style'); + _sheet.id = _sheetId; + var className = "pseudoStyle" + UID.getNew(); + + _this.className += " "+className; + + _sheet.innerHTML += " ."+className+":"+element+"{"+prop+":"+value+"}"; + _head.appendChild(_sheet); + return this; +}; + +class Sandpoints extends Paged.Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + beforeParsed(content) { + var d = {}; + content.querySelectorAll('*').forEach((n, i)=> { + if (n.hasAttribute("printhref")) { + n.setAttribute("href", n.getAttribute("printhref")) + } + + if (n.classList.length > 0 ) { + n.classList.forEach((c, i)=>{ + if (c.startsWith("css-")) { + (c in d) ? d[c]++ : d[c] = 1 + let s = "" + Object.keys(d).filter(ks => ks.startsWith(c.slice(0, -1))).forEach((t, i)=> {if (c >= t) {s += `${d[t]}.`}}) + n.pseudoStyle('before','content', `"${s} "`) + } + }) + } + }) + } + + afterPageLayout(pageElement, page, breakToken, chunker) { + // Find all split table elements + let tables = pageElement.querySelectorAll("table[data-split-from]"); + + tables.forEach((table) => { + // There is an edge case where the previous page table + // has zero height (isn't visible). + // To avoid double header we will only add header if there is none. + let tableHeader = table.querySelector("thead"); + if (tableHeader) { + return; + } + + // Get the reference UUID of the node + let ref = table.dataset.ref; + // Find the node in the original source + let sourceTable = chunker.source.querySelector("[data-ref='" + ref + "']"); + + // Find if there is a header + let sourceHeader = sourceTable.querySelector("thead"); + if (sourceHeader) { + // Clone the header element + let clonedHeader = sourceHeader.cloneNode(true); + // Insert the header at the start of the split table + table.insertBefore(clonedHeader, table.firstChild); + } + }); + + // Find all tables + tables = pageElement.querySelectorAll("table"); + + // special case which might not fit for everyone + tables.forEach((table) => { + // if the table has no rows in body, hide it. + // This happens because my render engine creates empty tables. + let sourceBody = table.querySelector("tbody > tr"); + if (!sourceBody) { + console.log("Table was hidden, because it has no rows in tbody."); + table.style.visibility = "hidden"; + table.style.position = "absolute"; + + var lineSpacer = table.nextSibling; + if (lineSpacer) { + lineSpacer.style.visibility = "hidden"; + lineSpacer.style.position = "absolute"; + } + } + }); + } +} + +Paged.registerHandlers(Sandpoints); diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png new file mode 100644 index 0000000..4595f4c Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png new file mode 100644 index 0000000..84656c8 Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html new file mode 100644 index 0000000..e4ed5bf --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html @@ -0,0 +1,145 @@ + + + + + + + + + + +
{{ index $scratch.mantle 0 }}⁄{{ $p.Title }}
+ {{ substr .File.Dir 0 -1 }}⁄{{ .Title }}
+ {{ .Content }}
+
+ {{ if in .Page.Site.Params.sandpointsMentionedIn (substr .File.Dir 0 -1) }}
+ {{ $ss := $s.Get (printf "/%s" .File) }}
+
+ {{ with $ss }}
+
+ {{ end }}
+ {{ end }}
+ {{ $cssOutput = printf "body {counter-reset: %s;}\n%s" $cssHashes $cssOutput }}
+ {{ $var := $cssOutput | resources.FromString "css/dyn.css" }}
+ {{ $dummy := $var.Permalink }}
{{- end -}}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html
new file mode 100644
index 0000000..ff6a2c7
--- /dev/null
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html
@@ -0,0 +1,12 @@
+
+
+
+ {{- partialCached "head.html" . -}}
+ mentioned in⁄
+ {{ end }}
+
+ {{ range $ss.backlinks }}
+
+ {{ .Title }}
+
+ {{ end }}
+ {{ index $p 0 }}⁄All
+ {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
+ {{ if eq (index $p 0) $taxonomyname }}
+ {{ range $key, $value := $taxonomy }}
+ {{ $key }}({{ len (index (index $.Site.Taxonomies $taxonomyname) $key) }})
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ else }}
+ {{ index $p 0 }}⁄{{ index $p 1 }}
+ {{ range .Pages.ByDate.Reverse }}
+ {{ .Date.Format "Jan 2, 2006" }}
+
+ {{ range $n, $authorFile := .Params.authors }}
+ {{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
+ {{ $author.Title }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+{{ end }}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html
index 2e1eb98..2764d59 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html
@@ -5,102 +5,100 @@
[toggle expand/collapse]
{{ range $p := .Site.RegularPages }}
- {{ with or ($p.Scratch.Get "urls") ($p.Scratch.Get "bibs") ($p.Scratch.Get "links") ($p.Scratch.Get "backlinks" )}}
- {{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }}
+{{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }}
- {{ $pPath := printf "/%s" $p.File }} - {{ with $ss := $s.Get $pPath }} - {{ with $ss.backlinks }} - {{ range $i, $_ := $ss.backlinks }} - {{ if eq $i 0 }} -Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
-
- {{ end }}
-
- {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }} - {{ end }} -
Internal links to other Sandpoint pages ({{ len ($p.Scratch.Get "links") }}):
-
+
- {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }} {{ end }}
- {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }} + {{ end }} +
- bib⁄{{ index $_ 1 }} + {{ with ($p.Scratch.Get "bibs") }} + {{ range $i, $_ := ($p.Scratch.Get "bibs") }} + {{ if eq $i 0 }} +
- bib⁄{{ index $_ 1 }} {{ end }} +
- other⁄{{ $_ }} - {{ end }} + {{ with $other_links }} + {{ $formattingN := 0 }} + {{ $anchorN := 0 }} + {{ range $i, $_ := $other_links }} + {{ if eq $i 0 }} +
- other⁄{{ $_ }} {{ end }} - {{ with $formattingN }}
- {{ $formattingN }} formatting links. {{ end }} - {{ with $anchorN }}
- {{ $anchorN }} anchor links. {{ end }} -
- {{ $formattingN }} formatting links. {{ end }} + {{ with $anchorN }}
- {{ $anchorN }} anchor links. {{ end }} +
Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
-
{{ end }}
Internal links to other Sandpoint pages ({{ len (uniq ($p.Scratch.Get "links")) }}):
-
+ {{ end }}
+
Outgoing links to other pages on Internet ({{ len $http_links }}):
Links to Sandpoint's library ({{ len $library_links }}):
Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):
-
- {{ end }}
-
Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):
-
{{ end }}
-
Anchor, formatting and other links ({{ len $other_links }}):
-
- {{ end }}
- {{ if strings.HasPrefix $_ "#" }}
- {{ $anchorN = add $anchorN 1 }}
- {{ else if strings.HasPrefix $_ "{"}}
- {{ $formattingN = add $formattingN 1 }}
- {{ else }}
-
Anchor, formatting and other links ({{ len $other_links }}):
-
+ {{ end }}
+ {{ if strings.HasPrefix $_ "#" }}
+ {{ $anchorN = add $anchorN 1 }}
+ {{ else if strings.HasPrefix $_ "{"}}
+ {{ $formattingN = add $formattingN 1 }}
+ {{ else }}
+
elements. + // + // pre-wrap + // Sequences of white space are preserved. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // pre-line + // Sequences of white space are collapsed. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // break-spaces + // The behavior is identical to that of pre-wrap, except that: + // - Any sequence of preserved white space always takes up space, including at the end of the line. + // - A line breaking opportunity exists after every preserved white space character, including between white space characters. + // - Such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). + // + // See: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#Values + + return NodeFilter.FILTER_REJECT; + } else { + return NodeFilter.FILTER_REJECT; + } + } + + } + + class CommentsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + filterTree(content, null, NodeFilter.SHOW_COMMENT); + } + + } + + class ScriptsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + content.querySelectorAll("script").forEach( script => { script.remove(); }); + } + + } + + var clearCut = createCommonjsModule(function (module, exports) { + /** + * Originally ported from https://github.com/keeganstreet/specificity/blob/866bf7ab4e7f62a7179c15b13a95af4e1c7b1afa/specificity.js + * + * Calculates the specificity of CSS selectors + * http://www.w3.org/TR/css3-selectors/#specificity + * + * Returns a selector integer value + */ + + // The following regular expressions assume that selectors matching the preceding regular expressions have been removed + var attributeRegex = /(\[[^\]]+\])/g; + var idRegex = /(#[^\s\+>~\.\[:]+)/g; + var classRegex = /(\.[^\s\+>~\.\[:]+)/g; + var pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/g; + var pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g; + var elementRegex = /([^\s\+>~\.\[:]+)/g; + var notRegex = /:not\(([^\)]*)\)/g; + var ruleRegex = /\{[^]*/gm; + var separatorRegex = /[\*\s\+>~]/g; + var straysRegex = /[#\.]/g; + + // Find matches for a regular expression in a string and push their details to parts + // Type is "a" for IDs, "b" for classes, attributes and pseudo-classes and "c" for elements and pseudo-elements + var findMatch = function(regex, type, types, selector) { + var matches = selector.match(regex); + if (matches) { + for (var i = 0; i < matches.length; i++) { + types[type]++; + // Replace this simple selector with whitespace so it won't be counted in further simple selectors + selector = selector.replace(matches[i], ' '); + } + } + + return selector; + }; + + // Calculate the specificity for a selector by dividing it into simple selectors and counting them + var calculate = function(selector) { + var commaIndex = selector.indexOf(','); + if (commaIndex !== -1) { + selector = selector.substring(0, commaIndex); + } + + var types = { + a: 0, + b: 0, + c: 0 + }; + + // Remove the negation psuedo-class (:not) but leave its argument because specificity is calculated on its argument + selector = selector.replace(notRegex, ' $1 '); + + // Remove anything after a left brace in case a user has pasted in a rule, not just a selector + selector = selector.replace(ruleRegex, ' '); + + // Add attribute selectors to parts collection (type b) + selector = findMatch(attributeRegex, 'b', types, selector); + + // Add ID selectors to parts collection (type a) + selector = findMatch(idRegex, 'a', types, selector); + + // Add class selectors to parts collection (type b) + selector = findMatch(classRegex, 'b', types, selector); + + // Add pseudo-element selectors to parts collection (type c) + selector = findMatch(pseudoElementRegex, 'c', types, selector); + + // Add pseudo-class selectors to parts collection (type b) + selector = findMatch(pseudoClassRegex, 'b', types, selector); + + // Remove universal selector and separator characters + selector = selector.replace(separatorRegex, ' '); + + // Remove any stray dots or hashes which aren't attached to words + // These may be present if the user is live-editing this selector + selector = selector.replace(straysRegex, ' '); + + // The only things left should be element selectors (type c) + findMatch(elementRegex, 'c', types, selector); + + return (types.a * 100) + (types.b * 10) + (types.c * 1); + }; + + var specificityCache = {}; + + exports.calculateSpecificity = function(selector) { + var specificity = specificityCache[selector]; + if (specificity === undefined) { + specificity = calculate(selector); + specificityCache[selector] = specificity; + } + return specificity; + }; + + var validSelectorCache = {}; + var testSelectorElement = null; + + exports.isSelectorValid = function(selector) { + var valid = validSelectorCache[selector]; + if (valid === undefined) { + if (testSelectorElement == null) { + testSelectorElement = document.createElement('div'); + } + + try { + testSelectorElement.querySelector(selector); + valid = true; + } catch (error) { + valid = false; + } + validSelectorCache[selector] = valid; + } + return valid; + }; + + exports.validateSelector = function(selector) { + if (!exports.isSelectorValid(selector)) { + var error = new SyntaxError(selector + ' is not a valid selector'); + error.code = 'EBADSELECTOR'; + throw error; + } + }; + }); + var clearCut_1 = clearCut.calculateSpecificity; + var clearCut_2 = clearCut.isSelectorValid; + var clearCut_3 = clearCut.validateSelector; + + class UndisplayedFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + this.displayRules = {}; + } + + onDeclaration(declaration, dItem, dList, rule) { + if (declaration.property === "display") { + let selector = lib.generate(rule.ruleNode.prelude); + let value = declaration.value.children.first().name; + + selector.split(",").forEach((s) => { + this.displayRules[s] = { + value: value, + selector: s, + specificity: clearCut_1(s), + important: declaration.important + }; + }); + } + } + + filter(content) { + let { matches, selectors } = this.sortDisplayedSelectors(content, this.displayRules); + + // Find matching elements that have display styles + for (let i = 0; i < matches.length; i++) { + let element = matches[i]; + let selector = selectors[i]; + let displayValue = selector[selector.length-1].value; + if(this.removable(element) && displayValue === "none") { + element.dataset.undisplayed = "undisplayed"; + } + } + + // Find elements that have inline styles + let styledElements = content.querySelectorAll("[style]"); + for (let i = 0; i < styledElements.length; i++) { + let element = styledElements[i]; + if (this.removable(element)) { + element.dataset.undisplayed = "undisplayed"; + } + } + } + + sorter(a, b) { + if (a.important && !b.important) { + return 1; + } + + if (b.important && !a.important) { + return -1; + } + + return a.specificity - b.specificity; + } + + sortDisplayedSelectors(content, displayRules=[]) { + let matches = []; + let selectors = []; + for (let d in displayRules) { + let displayItem = displayRules[d]; + let selector = displayItem.selector; + let query = []; + try { + try { + query = content.querySelectorAll(selector); + } catch (e) { + query = content.querySelectorAll(cleanSelector(selector)); + } + } catch (e) { + query = []; + } + let elements = Array.from(query); + for (let e of elements) { + if (matches.includes(e)) { + let index = matches.indexOf(e); + selectors[index].push(displayItem); + selectors[index] = selectors[index].sort(this.sorter); + } else { + matches.push(e); + selectors.push([displayItem]); + } + } + } + + return { matches, selectors }; + } + + removable(element) { + if (element.style && + element.style.display !== "" && + element.style.display !== "none") { + return false; + } + + return true; + } + } + + var filters = [ + WhiteSpaceFilter, + CommentsFilter, + ScriptsFilter, + UndisplayedFilter + ]; + var isImplemented$3 = function () { var from = Array.from, arr, result; if (typeof from !== "function") return false; @@ -29997,7 +30873,7 @@ img { return pipe; }; - let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers]; + let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers, ...filters]; class Handlers { constructor(chunker, polisher, caller) { diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js new file mode 100644 index 0000000..e494029 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js @@ -0,0 +1,100 @@ +var UID = { + _current: 0, + getNew: function(){ + this._current++; + return this._current; + } +}; + +HTMLElement.prototype.pseudoStyle = function(element,prop,value){ + var _this = this; + var _sheetId = "pseudoStyles"; + var _head = document.head || document.getElementsByTagName('head')[0]; + var _sheet = document.getElementById(_sheetId) || document.createElement('style'); + _sheet.id = _sheetId; + var className = "pseudoStyle" + UID.getNew(); + + _this.className += " "+className; + + _sheet.innerHTML += " ."+className+":"+element+"{"+prop+":"+value+"}"; + _head.appendChild(_sheet); + return this; +}; + +class Sandpoints extends Paged.Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + beforeParsed(content) { + var d = {}; + content.querySelectorAll('*').forEach((n, i)=> { + if (n.hasAttribute("printhref")) { + n.setAttribute("href", n.getAttribute("printhref")) + } + + if (n.classList.length > 0 ) { + n.classList.forEach((c, i)=>{ + if (c.startsWith("css-")) { + (c in d) ? d[c]++ : d[c] = 1 + let s = "" + Object.keys(d).filter(ks => ks.startsWith(c.slice(0, -1))).forEach((t, i)=> {if (c >= t) {s += `${d[t]}.`}}) + n.pseudoStyle('before','content', `"${s} "`) + } + }) + } + }) + } + + afterPageLayout(pageElement, page, breakToken, chunker) { + // Find all split table elements + let tables = pageElement.querySelectorAll("table[data-split-from]"); + + tables.forEach((table) => { + // There is an edge case where the previous page table + // has zero height (isn't visible). + // To avoid double header we will only add header if there is none. + let tableHeader = table.querySelector("thead"); + if (tableHeader) { + return; + } + + // Get the reference UUID of the node + let ref = table.dataset.ref; + // Find the node in the original source + let sourceTable = chunker.source.querySelector("[data-ref='" + ref + "']"); + + // Find if there is a header + let sourceHeader = sourceTable.querySelector("thead"); + if (sourceHeader) { + // Clone the header element + let clonedHeader = sourceHeader.cloneNode(true); + // Insert the header at the start of the split table + table.insertBefore(clonedHeader, table.firstChild); + } + }); + + // Find all tables + tables = pageElement.querySelectorAll("table"); + + // special case which might not fit for everyone + tables.forEach((table) => { + // if the table has no rows in body, hide it. + // This happens because my render engine creates empty tables. + let sourceBody = table.querySelector("tbody > tr"); + if (!sourceBody) { + console.log("Table was hidden, because it has no rows in tbody."); + table.style.visibility = "hidden"; + table.style.position = "absolute"; + + var lineSpacer = table.nextSibling; + if (lineSpacer) { + lineSpacer.style.visibility = "hidden"; + lineSpacer.style.position = "absolute"; + } + } + }); + } +} + +Paged.registerHandlers(Sandpoints); diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png new file mode 100644 index 0000000..4595f4c Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png new file mode 100644 index 0000000..84656c8 Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html new file mode 100644 index 0000000..e4ed5bf --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html @@ -0,0 +1,145 @@ + + + + + + + + + + +
+
+
+
diff --git a/_vendor/modules.txt b/_vendor/modules.txt
index a4a89cf..eaa2d9a 100644
--- a/_vendor/modules.txt
+++ b/_vendor/modules.txt
@@ -1 +1,2 @@
-# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201218222521-33a423ebe113
+# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20220418135300-b3e229aeea27
+# git.sandpoints.org/Drawwell/SandpointsEditPage v0.0.0-20210825011616-e019d8a4d186
diff --git a/config.toml b/config.toml
index 448addc..0808096 100644
--- a/config.toml
+++ b/config.toml
@@ -4,70 +4,76 @@ title = "Simple Sandpoints"
relativeurls = true
disableKinds = ["RSS", "sitemap"]
-[params]
- description = "Simple Sandpoints project to test and develop...."
- # sandpointsGiteaUrl = "https://git.sandpoints.org/Drawwell/SimpleSandpoints"
- sandpointsGiteaUrl = "http://localhost:3333/Sandpoints/SimpleSandpoints"
- sandpointsCatalogPrefix = "/library/"
+[taxonomies]
+keyword = "keywords"
+tag = "tags"
- sandpointsMentionedIn = ["annex"]
+
+[params]
+description = "Simple Sandpoints project to test and develop...."
+# sandpointsGiteaUrl = "https://git.sandpoints.org/Drawwell/SimpleSandpoints"
+sandpointsGiteaUrl = "http://localhost:3333/Sandpoints/SimpleSandpoints"
+sandpointsCatalogPrefix = "/library/"
+
+sandpointsMentionedIn = ["annex"]
[outputFormats]
- [outputFormats.js]
- isPlainText = true
- mediaType = "application/javascript"
+[outputFormats.js]
+isPlainText = true
+mediaType = "application/javascript"
[outputs]
- list = ["html", "js"]
+list = ["html", "js"]
[markup.tableOfContents]
- endLevel=4
- ordered = true
- startLevel = 1
+endLevel=4
+ordered = true
+startLevel = 1
[markup.goldmark.renderer]
- unsafe = true
+unsafe = true
# [markup.goldmark.parser.attribute]
# block = true
[module]
- # replacement allow for easier local development
- replacements = ["git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme", "git.sandpoints.org/Drawwell/SandpointsEditPage -> /home/m/devel/SandpointsEditPage"]
- [[module.imports]]
- path = "git.sandpoints.org/Drawwell/SandpointsTheme"
+# replacement allow for easier local development
+# replacements = ["git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme", "git.sandpoints.org/Drawwell/SandpointsEditPage -> /home/m/devel/SandpointsEditPage"]
- [[module.imports]]
- path = "git.sandpoints.org/Drawwell/SandpointsEditPage"
+[[module.imports]]
+path = "git.sandpoints.org/Drawwell/SandpointsTheme"
- [[module.imports.mounts]]
- source = "public/index.html"
- target = "static/svedit/index.html"
- [[module.imports.mounts]]
- source = "public/global.css"
- target = "static/svedit/global.css"
- [[module.imports.mounts]]
- source = "public/build"
- target = "static/svedit/build"
-
- [[module.imports.mounts]]
- source = "archetypes"
- target = "archetypes"
- [[module.imports.mounts]]
- source = "assets"
- target = "assets"
- [[module.imports.mounts]]
- source = "layouts"
- target = "layouts"
- [[module.imports.mounts]]
- source = "static"
- target = "static"
- [[module.imports.mounts]]
- source = "data"
- target = "data"
- # [[module.imports.mounts]]
- # source = "customizations/Dotawo/assets/css/site.css"
- # target = "assets/css/site.css"
- # [[module.imports.mounts]]
- # source = "customizations/Dotawo/static/css/site.min.css"
- # target = "static/css/site.min.css"
+[[module.imports]]
+path = "git.sandpoints.org/Drawwell/SandpointsEditPage"
+
+[[module.imports.mounts]]
+source = "public/index.html"
+target = "static/svedit/index.html"
+[[module.imports.mounts]]
+source = "public/global.css"
+target = "static/svedit/global.css"
+[[module.imports.mounts]]
+source = "public/build"
+target = "static/svedit/build"
+
+[[module.imports.mounts]]
+source = "archetypes"
+target = "archetypes"
+[[module.imports.mounts]]
+source = "assets"
+target = "assets"
+[[module.imports.mounts]]
+source = "layouts"
+target = "layouts"
+[[module.imports.mounts]]
+source = "static"
+target = "static"
+[[module.imports.mounts]]
+source = "data"
+target = "data"
+# [[module.imports.mounts]]
+# source = "customizations/Dotawo/assets/css/site.css"
+# target = "assets/css/site.css"
+# [[module.imports.mounts]]
+# source = "customizations/Dotawo/static/css/site.min.css"
+# target = "static/css/site.min.css"
+
+
+ ß
+ •
+ :
+
+