a big print commit.. made for dotawo.. should work for the rest...

This commit is contained in:
Marcell Mars 2021-02-04 21:50:05 +01:00
parent bfe91a464c
commit b3db1a987f
13 changed files with 1558 additions and 571 deletions

View file

@ -5,9 +5,9 @@ module.exports = {
require('postcss-import')({ require('postcss-import')({
path: [themeDir] path: [themeDir]
}), }),
require('autoprefixer')({ /* require('autoprefixer')({
grid: true * grid: true
}), * }),
require('postcss-reporter'), * require('postcss-reporter'), */
] ]
} }

View file

@ -147,6 +147,10 @@ body {
color: black; color: black;
} }
#preview {
display: none;
}
sup, sup,
sub { sub {
vertical-align: baseline; vertical-align: baseline;

View file

@ -2,49 +2,49 @@
{{ $_ := newScratch }} {{ $_ := newScratch }}
{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} {{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}}
{{ $_.Add "triads" $k }} {{ $_.Add "triads" $k }}
{{- end -}} {{- end -}}
{{- if strings.HasPrefix .Destination "bib:" -}} {{- if strings.HasPrefix .Destination "bib:" -}}
{{- $destination := (substr .Destination 4) -}} {{- $destination := (substr .Destination 4) -}}
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} {{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{- if index $.Page.Site.Data.books.catalog $destination -}} {{- if index $.Page.Site.Data.books.catalog $destination -}}
{{- $b := index $.Page.Site.Data.books.catalog $destination -}} {{- $b := index $.Page.Site.Data.books.catalog $destination -}}
{{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }} {{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }}
{{ $bibtitle := "" }} {{ $bibtitle := "" }}
{{ with $b.title }} {{ with $b.title }}
{{- $bibtitle = printf "%s" $b.title }} {{- $bibtitle = printf "%s" $b.title }}
{{ end }} {{ end }}
{{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }} {{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }}
{{- if not $text_link -}} {{- if not $text_link -}}
<span>{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank"><span class="sup">bib</span>{{- $b.title -}}</a>. {{- with $b.publisher -}}{{- . -}}.{{- end -}}</span> <span>{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank"><span class="sup">bib</span>{{- $b.title -}}</a>. {{- with $b.publisher -}}{{- . -}}.{{- end -}}</span>
{{- else -}}
<span class="sup">bib</span><a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a>
{{- end -}}
{{- else -}} {{- else -}}
<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{- $destination -}} not found</span></a> <span class="sup">bib</span><a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a>
{{- end -}} {{- end -}}
{{- else -}}
<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{- $destination -}} not found</span></a>
{{- end -}}
{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}} {{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}}
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} {{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} {{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{ .Page.Scratch.Add "links" (slice $session) }} {{ .Page.Scratch.Add "links" (slice $session) }}
{{- if not $text_link -}} {{- if not $text_link -}}
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $session.Title}} title="{{- $session.Title -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}</span>{{- $session.Title -}}</a> <a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $session.Title}} title="{{- $session.Title -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}</span>{{- $session.Title -}}</a>
{{- else -}}
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}</span>{{- $text_link -}}</a>
{{- end -}}
{{- else -}} {{- else -}}
<a href="{{- .Destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span>{{- .Destination -}} not found</span></a> <a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}</span>{{- $text_link -}}</a>
{{- end -}} {{- end -}}
{{- else -}}
<a href="{{- .Destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span>{{- .Destination -}} not found</span></a>
{{- end -}}
{{- else if strings.HasPrefix .Destination "audio:" -}} {{- else if strings.HasPrefix .Destination "audio:" -}}
{{- $a_destination := (substr .Destination 6) -}} {{- $a_destination := (substr .Destination 6) -}}
{{- if findRE "^.*static" $a_destination -}} {{- if findRE "^.*static" $a_destination -}}
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span> <span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span>
{{- else -}} {{- else -}}
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span> <span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span>
{{- end -}} {{- end -}}
{{- else if findRE "^.*static" .Destination -}} {{- else if findRE "^.*static" .Destination -}}
<img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} /> <img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
{{- else -}} {{- else -}}
<img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} /> <img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
{{- end -}} {{- end -}}

View file

@ -8,7 +8,9 @@
{{ $currentFile := (printf "/%s" .File) }} {{ $currentFile := (printf "/%s" .File) }}
{{ $scratch := $s.Get $currentFile }} {{ $scratch := $s.Get $currentFile }}
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}</span>{{ .Title }}</div></div> {{ $sandnamePlural := (slice) }}
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}</span>{{ .Title }}</div>
<div class="grid"> <div class="grid">
<div class="leftcolumn"> <div class="leftcolumn">
@ -17,22 +19,36 @@
{{ end }} {{ end }}
</div> </div>
<div class="rightcolumn"> <div class="rightcolumn">
{{- range $k, $v := .Page.Params.authors -}} {{ $closeDivs := false }}
{{- with $.GetPage (printf "/author/%s" $v) -}}
{{- with not $k -}}
<div class="has hasauthors">
<div class="hassup">author{{ with $.Page.Params.authors }}{{ if gt (len .) 1 }}s{{ end }}{{ end }}</div>
<div class="afterhas">
{{- end -}}
<div class="crust">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{- end -}}
{{- end -}}
{{- with .Page.Params.authors -}}</div></div>{{- end -}}
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
{{ $sandnamePlural = $sandnamePlural | append $v }}
{{ end }}
{{ $paramsKeys := (slice) }}
{{ range $k, $v := $currentNode.Params }}
{{ $paramsKeys = $paramsKeys | append $k }}
{{ end }}
{{ $mentions := intersect $paramsKeys $sandnamePlural }}
{{ range $mention := $mentions }}
{{ range $k, $m := index $currentNode.Params $mention }}
{{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }}
{{- with $.GetPage $mentionLink -}}
{{- with not $k -}}
{{ $closeDivs = true }}
<div class="has hasauthors">
<div class="hassup">{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}</div>
<div class="afterhas">
{{- end -}}
<div class="crust">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{- end -}}
{{ end }}
{{ end }}
{{- with $closeDivs -}}</div></div>{{ end }}
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }} {{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
<div class="has"> <div class="has hasmentionedin">
{{ with $scratch.backlinks }} {{ with $scratch.backlinks }}
<div class="hassup">mentioned in</div> <div class="hassup">mentioned in</div>
{{ end }} {{ end }}
@ -46,7 +62,7 @@
{{ end }} {{ end }}
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
<div class="has"> <div class="has hashas">
{{ with $scratch.has }} {{ with $scratch.has }}
<div class="hassup">has {{ $scratch.has }}</div> <div class="hassup">has {{ $scratch.has }}</div>
{{ end }} {{ end }}
@ -60,7 +76,7 @@
{{ end }} {{ end }}
{{ if eq $scratch.depth "crust" }} {{ if eq $scratch.depth "crust" }}
<div class="has"> <div class="has hasin">
<div class="hassup">in {{ index $scratch.in 1 }}</div> <div class="hassup">in {{ index $scratch.in 1 }}</div>
<div class="afterhas"> <div class="afterhas">
{{ range $scratch.is_in }} {{ range $scratch.is_in }}
@ -74,8 +90,6 @@
</div> </div>
{{ with .Page.Params.abstract }}<div class="journal"></div><div class="abstract"><span class="supt">abstract</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }} {{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div {{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ with .Page.Params.abstract }}</div>{{ end }}

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,4 @@
<link href="/css/paged_interface.css" rel="stylesheet" type="text/css"> <link href="/css/paged_interface.css" rel="stylesheet" type="text/css">
<link href="/css/print.css" rel="stylesheet" type="text/css"> <link href="/css/print.css" rel="stylesheet" type="text/css">
<script src="/js/paged.polyfill.js"></script> <script src="/js/paged.polyfill.js"></script>
<script src="/js/repeatingHeader.js"></script>

View file

@ -53,17 +53,8 @@
{{ end }} {{ end }}
<div class="afterhas"> <div class="afterhas">
{{ range $scratch.has_children }} {{ range $scratch.has_children }}
{{ $authors := "" }}
{{ range $n, $authorFile := .Params.authors }}
{{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
{{ if eq $n 0 }}
{{ $authors = printf "%s%s" $authors $author.Title }}
{{ else }}
{{ $authors = printf "%s, %s" $authors $author.Title }}
{{ end }}
{{ end }}
<div class="{{ $scratch.child_depth }}"> <div class="{{ $scratch.child_depth }}">
<a class="toc" href="#{{ .File.LogicalName }}">{{ .Title }} ({{ $authors }})</a> <a class="toc" href="#{{ .File.LogicalName }}">{{ .Title }}</a>
</div> </div>
{{ end }} {{ end }}
</div></div> </div></div>

View file

@ -41,8 +41,10 @@
{{ range $m := index $p.Params $mention }} {{ range $m := index $p.Params $mention }}
{{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }} {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }}
{{ with ($_.Get $mentionLink) }} {{ with ($_.Get $mentionLink) }}
{{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }}
{{ $_.SetInMap $mentionLink "backlinks" (uniq ((index ($_.Get $mentionLink) "backlinks") | append $p)) }} {{ $_.SetInMap $mentionLink "backlinks" (uniq ((index ($_.Get $mentionLink) "backlinks") | append $p)) }}
{{ else }} {{ else }}
{{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }}
{{ $_.SetInMap $mentionLink "backlinks" (slice $p) }} {{ $_.SetInMap $mentionLink "backlinks" (slice $p) }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -8,7 +8,12 @@
{{ $currentFile := (printf "/%s" .File) }} {{ $currentFile := (printf "/%s" .File) }}
{{ $scratch := $s.Get $currentFile }} {{ $scratch := $s.Get $currentFile }}
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div> {{ $sandnamePlural := (slice) }}
{{ with (index $currentNode.Params "authors") }}
{{ len (index $currentNode.Params "authors") }}
{{ end }}
div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
<div class="grid"> <div class="grid">
<div class="leftcolumn"> <div class="leftcolumn">
@ -17,22 +22,36 @@
{{ end }} {{ end }}
</div> </div>
<div class="rightcolumn"> <div class="rightcolumn">
{{- range $k, $v := .Page.Params.authors -}} {{ $closeDivs := false }}
{{- with $.GetPage (printf "/author/%s" $v) -}}
{{- with not $k -}}
<div class="has hasauthors">
<div class="hassup">author{{ with $.Page.Params.authors }}{{ if gt (len .) 1 }}s{{ end }}{{ end }}</div>
<div class="afterhas">
{{- end -}}
<div class="crust">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{- end -}}
{{- end -}}
{{- with .Page.Params.authors -}}</div></div>{{- end -}}
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
{{ $sandnamePlural = $sandnamePlural | append $v }}
{{ end }}
{{ $paramsKeys := (slice) }}
{{ range $k, $v := $currentNode.Params }}
{{ $paramsKeys = $paramsKeys | append $k }}
{{ end }}
{{ $mentions := intersect $paramsKeys $sandnamePlural }}
{{ range $mention := $mentions }}
{{ range $k, $m := index $currentNode.Params $mention }}
{{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }}
{{- with $.GetPage $mentionLink -}}
{{- with not $k -}}
{{ $closeDivs = true }}
<div class="has hasauthors">
<div class="hassup">{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}</div>
<div class="afterhas">
{{- end -}}
<div class="crust">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{- end -}}
{{ end }}
{{ end }}
{{- with $closeDivs -}}</div></div>{{ end }}
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }} {{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
<div class="has"> <div class="has hasmentionedin">
{{ with $scratch.backlinks }} {{ with $scratch.backlinks }}
<div class="hassup">mentioned in</div> <div class="hassup">mentioned in</div>
{{ end }} {{ end }}
@ -46,7 +65,7 @@
{{ end }} {{ end }}
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
<div class="has"> <div class="has hashas">
{{ with $scratch.has }} {{ with $scratch.has }}
<div class="hassup">has {{ $scratch.has }}</div> <div class="hassup">has {{ $scratch.has }}</div>
{{ end }} {{ end }}
@ -60,7 +79,7 @@
{{ end }} {{ end }}
{{ if eq $scratch.depth "crust" }} {{ if eq $scratch.depth "crust" }}
<div class="has"> <div class="has hasin">
<div class="hassup">in {{ index $scratch.in 1 }}</div> <div class="hassup">in {{ index $scratch.in 1 }}</div>
<div class="afterhas"> <div class="afterhas">
{{ range $scratch.is_in }} {{ range $scratch.is_in }}
@ -74,8 +93,6 @@
</div> </div>
{{ with .Page.Params.abstract }}<div class="journal"></div><div class="abstract"><span class="supt">abstract</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }} {{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div {{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ with .Page.Params.abstract }}</div>{{ end }}

View file

@ -5,102 +5,100 @@
<div id="toggleAllLinks" onclick="toggleAllLinks()">[toggle expand/collapse]</div> <div id="toggleAllLinks" onclick="toggleAllLinks()">[toggle expand/collapse]</div>
<p></p> <p></p>
{{ range $p := .Site.RegularPages }} {{ range $p := .Site.RegularPages }}
{{ with or ($p.Scratch.Get "urls") ($p.Scratch.Get "bibs") ($p.Scratch.Get "links") ($p.Scratch.Get "backlinks" )}} <details><summary>{{ with $p.File }}<span class="sup">{{- substr .Dir 0 -1 -}}</span>{{ end }}<a href="{{ $p.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $p.Title }}</a></summary>
<details><summary>{{ with $p.File }}<span class="sup">{{- substr .Dir 0 -1 -}}</span>{{ end }}<a href="{{ $p.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $p.Title }}</a></summary>
{{ $pPath := printf "/%s" $p.File }} {{ $pPath := printf "/%s" $p.File }}
{{ with $ss := $s.Get $pPath }} {{ with $ss := $s.Get $pPath }}
{{ with $ss.backlinks }} {{ with $ss.backlinks }}
{{ range $i, $_ := $ss.backlinks }} {{ range $i, $_ := $ss.backlinks }}
{{ if eq $i 0 }}
<details><summary>Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):</summary><ul>
{{ end }}
<li>{{ with $_.File }}<span class="sup">{{ substr .Dir 0 -1 }}</span>{{ end }}<a href="{{ $_.RelPermalink }}">{{ $_.Title }}</a></li>
{{ end }}
</ul></details>
{{ end }}
{{ end }}
{{ with ($p.Scratch.Get "links") }}
{{ range $i, $_ := ($p.Scratch.Get "links") }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<details><summary>Internal links to other Sandpoint pages ({{ len ($p.Scratch.Get "links") }}):</summary><ul> <details><summary>Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):</summary><ul>
{{ end }} {{ end }}
<li>{{ with $_.File }}<span class="sup">{{ substr .Dir 0 -1 }}</span>{{ end }}<a href="{{ $_.RelPermalink }}">{{ $_.Title }}</a></li> <li>{{ with $_.File }}<span class="sup">{{ substr .Dir 0 -1 }}</span>{{ end }}<a href="{{ $_.RelPermalink }}">{{ $_.Title }}</a></li>
{{ end }} {{ end }}
</ul></details> </ul></details>
{{ end }} {{ end }}
{{ end }}
{{ $http_links := (slice) }} {{ with ($p.Scratch.Get "links") }}
{{ $library_links := (slice) }} {{ range $i, $_ := uniq ($p.Scratch.Get "links") }}
{{ $anchor_links := (slice) }} {{ if eq $i 0 }}
{{ $other_links := (slice) }} <details><summary>Internal links to other Sandpoint pages ({{ len (uniq ($p.Scratch.Get "links")) }}):</summary><ul>
{{ end }}
<li>{{ with $_.File }}<span class="sup">{{ substr .Dir 0 -1 }}</span>{{ end }}<a href="{{ $_.RelPermalink }}">{{ $_.Title }}</a></li>
{{ end }}
</ul></details>
{{ end }}
{{ with ($p.Scratch.Get "urls") }} {{ $http_links := (slice) }}
{{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} {{ $library_links := (slice) }}
{{ range $i, $_ := ($p.Scratch.Get "urls") }} {{ $anchor_links := (slice) }}
{{ if strings.HasPrefix $_ "http" }} {{ $other_links := (slice) }}
{{ $http_links = $http_links | append $_ }}
{{ else if strings.HasPrefix $_ $c_prefix }} {{ with ($p.Scratch.Get "urls") }}
{{ $library_links = $library_links | append $_ }} {{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{ else}} {{ range $i, $_ := ($p.Scratch.Get "urls") }}
{{ $other_links = $other_links | append $_ }} {{ if strings.HasPrefix $_ "http" }}
{{ end }} {{ $http_links = $http_links | append $_ }}
{{ else if strings.HasPrefix $_ $c_prefix }}
{{ $library_links = $library_links | append $_ }}
{{ else}}
{{ $other_links = $other_links | append $_ }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }}
{{ with $http_links }} {{ with $http_links }}
{{ range $i, $_ := $http_links }} {{ range $i, $_ := $http_links }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<details><summary>Outgoing links to other pages on Internet ({{ len $http_links }}):</summary><ul> <details><summary>Outgoing links to other pages on Internet ({{ len $http_links }}):</summary><ul>
{{ end }}
<li><span class="sup">www</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li>
{{ end }} {{ end }}
</ul></details> <li><span class="sup">www</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li>
{{ end }} {{ end }}
</ul></details>
{{ end }}
{{ with $library_links }} {{ with $library_links }}
{{ range $i, $_ := $library_links }} {{ range $i, $_ := $library_links }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<details><summary>Links to Sandpoint's library ({{ len $library_links }}):</summary><ul> <details><summary>Links to Sandpoint's library ({{ len $library_links }}):</summary><ul>
{{ end }}
<li><span class="sup">lib</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li>
{{ end }} {{ end }}
</ul></details> <li><span class="sup">lib</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li>
{{ end }} {{ end }}
</ul></details>
{{ end }}
{{ with ($p.Scratch.Get "bibs") }} {{ with ($p.Scratch.Get "bibs") }}
{{ range $i, $_ := ($p.Scratch.Get "bibs") }} {{ range $i, $_ := ($p.Scratch.Get "bibs") }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<details><summary>Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):</summary><ul> <details><summary>Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):</summary><ul>
{{ end }}
<li><span class="sup">bib</span><a href="{{ index $_ 0 }}" target="_blank">{{ index $_ 1 }}</a></li>
{{ end }} {{ end }}
</ul></details> <li><span class="sup">bib</span><a href="{{ index $_ 0 }}" target="_blank">{{ index $_ 1 }}</a></li>
{{ end }} {{ end }}
</ul></details>
{{ end }}
{{ with $other_links }} {{ with $other_links }}
{{ $formattingN := 0 }} {{ $formattingN := 0 }}
{{ $anchorN := 0 }} {{ $anchorN := 0 }}
{{ range $i, $_ := $other_links }} {{ range $i, $_ := $other_links }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<details><summary>Anchor, formatting and other links ({{ len $other_links }}):</summary><ul> <details><summary>Anchor, formatting and other links ({{ len $other_links }}):</summary><ul>
{{ end }} {{ end }}
{{ if strings.HasPrefix $_ "#" }} {{ if strings.HasPrefix $_ "#" }}
{{ $anchorN = add $anchorN 1 }} {{ $anchorN = add $anchorN 1 }}
{{ else if strings.HasPrefix $_ "{"}} {{ else if strings.HasPrefix $_ "{"}}
{{ $formattingN = add $formattingN 1 }} {{ $formattingN = add $formattingN 1 }}
{{ else }} {{ else }}
<li><span class="sup">other</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li> <li><span class="sup">other</span><a href="{{ $_ }}" target="_blank">{{ $_ }}</a></li>
{{ end }}
{{ end }} {{ end }}
{{ with $formattingN }}<li>{{ $formattingN }} formatting links.</a></li>{{ end }}
{{ with $anchorN }}<li>{{ $anchorN }} anchor links.</a></li>{{ end }}
</ul></details>
{{ end }} {{ end }}
{{ with $formattingN }}<li>{{ $formattingN }} formatting links.</a></li>{{ end }}
{{ with $anchorN }}<li>{{ $anchorN }} anchor links.</a></li>{{ end }}
</ul></details>
{{ end }}
</details> </details>
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -1,13 +1,13 @@
@page { @page {
size: 156mm 234mm; size: 156mm 234mm;
margin-bottom: 58px; margin-bottom: 0.8in;
padding-bottom: 20px; padding-bottom: 0.2in;
margin-top: 40px; margin-top: 0.7in;
} }
@page:left { @page:left {
margin-right: 40px; margin-right: 0.7in;
margin-left: 64px; margin-left: 1in;
@bottom-left-corner { @bottom-left-corner {
content: counter(page); content: counter(page);
font-size: 1rem; font-size: 1rem;
@ -21,8 +21,8 @@
} }
@page:right { @page:right {
margin-left: 40px; margin-left: 0.7in;
margin-right: 64px; margin-right: 1in;
@bottom-right-corner { @bottom-right-corner {
content: counter(page); content: counter(page);
font-size: 1rem; font-size: 1rem;
@ -168,25 +168,16 @@
h2, h3, h4, h5, hr { h2, h3, h4, h5, hr {
break-after: avoid; break-after: avoid;
} }
table {
font-size: 1rem;
}
.glosscontainer, .glosscontainer,
table, table,
table + p, table + p,
tr,
blockquote, blockquote,
li { li {
break-inside: avoid; break-inside: avoid;
} }
.toc::after {
text-align: right;
float: right;
content: target-counter(attr(href url), page, decimal-leading-zero);
}
.authorpage { .authorpage {
break-before: page; break-before: page;
} }
@ -202,4 +193,39 @@
img + strong del { img + strong del {
margin-left: 0; margin-left: 0;
} }
.crustoc {
position: relative;
bottom: 0
}
.crustoc::after {
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;
}
} }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,58 @@
class RepeatingTableHeaders extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
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) {
console.log("Table header was cloned, because it is splitted.");
// 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(RepeatingTableHeaders);