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')({
path: [themeDir]
}),
require('autoprefixer')({
grid: true
}),
require('postcss-reporter'),
/* require('autoprefixer')({
* grid: true
* }),
* require('postcss-reporter'), */
]
}

View file

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

View file

@ -2,49 +2,49 @@
{{ $_ := newScratch }}
{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}}
{{ $_.Add "triads" $k }}
{{ $_.Add "triads" $k }}
{{- end -}}
{{- if strings.HasPrefix .Destination "bib:" -}}
{{- $destination := (substr .Destination 4) -}}
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{- if 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 }}
{{ $bibtitle := "" }}
{{ with $b.title }}
{{- $bibtitle = printf "%s" $b.title }}
{{ end }}
{{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }}
{{- 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>
{{- 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 -}}
{{- $destination := (substr .Destination 4) -}}
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{- if 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 }}
{{ $bibtitle := "" }}
{{ with $b.title }}
{{- $bibtitle = printf "%s" $b.title }}
{{ end }}
{{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }}
{{- 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>
{{- 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 -}}
{{- 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) -}}
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{ .Page.Scratch.Add "links" (slice $session) }}
{{- 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>
{{- 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 -}}
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{ .Page.Scratch.Add "links" (slice $session) }}
{{- 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>
{{- 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 -}}
{{- 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:" -}}
{{- $a_destination := (substr .Destination 6) -}}
{{- if findRE "^.*static" $a_destination -}}
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span>
{{- else -}}
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span>
{{- end -}}
{{- $a_destination := (substr .Destination 6) -}}
{{- if findRE "^.*static" $a_destination -}}
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span>
{{- else -}}
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span>
{{- end -}}
{{- 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 -}}
<img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
<img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
{{- end -}}

View file

@ -8,7 +8,9 @@
{{ $currentFile := (printf "/%s" .File) }}
{{ $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="leftcolumn">
@ -17,22 +19,36 @@
{{ end }}
</div>
<div class="rightcolumn">
{{- range $k, $v := .Page.Params.authors -}}
{{- 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">
{{ $closeDivs := false }}
{{ 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 -}}
<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 -}}
{{ end }}
{{ end }}
{{- with $closeDivs -}}</div></div>{{ end }}
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
<div class="has">
<div class="has hasmentionedin">
{{ with $scratch.backlinks }}
<div class="hassup">mentioned in</div>
{{ end }}
@ -46,7 +62,7 @@
{{ end }}
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
<div class="has">
<div class="has hashas">
{{ with $scratch.has }}
<div class="hassup">has {{ $scratch.has }}</div>
{{ end }}
@ -60,7 +76,7 @@
{{ end }}
{{ if eq $scratch.depth "crust" }}
<div class="has">
<div class="has hasin">
<div class="hassup">in {{ index $scratch.in 1 }}</div>
<div class="afterhas">
{{ range $scratch.is_in }}
@ -74,8 +90,6 @@
</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
class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ with .Page.Params.abstract }}</div>{{ end }}
{{- $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 -}}

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/print.css" rel="stylesheet" type="text/css">
<script src="/js/paged.polyfill.js"></script>
<script src="/js/repeatingHeader.js"></script>

View file

@ -53,17 +53,8 @@
{{ end }}
<div class="afterhas">
{{ 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 }}">
<a class="toc" href="#{{ .File.LogicalName }}">{{ .Title }} ({{ $authors }})</a>
<a class="toc" href="#{{ .File.LogicalName }}">{{ .Title }}</a>
</div>
{{ end }}
</div></div>

View file

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

View file

@ -8,7 +8,12 @@
{{ $currentFile := (printf "/%s" .File) }}
{{ $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="leftcolumn">
@ -17,22 +22,36 @@
{{ end }}
</div>
<div class="rightcolumn">
{{- range $k, $v := .Page.Params.authors -}}
{{- 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">
{{ $closeDivs := false }}
{{ 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 -}}
<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 -}}
{{ end }}
{{ end }}
{{- with $closeDivs -}}</div></div>{{ end }}
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
<div class="has">
<div class="has hasmentionedin">
{{ with $scratch.backlinks }}
<div class="hassup">mentioned in</div>
{{ end }}
@ -46,7 +65,7 @@
{{ end }}
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
<div class="has">
<div class="has hashas">
{{ with $scratch.has }}
<div class="hassup">has {{ $scratch.has }}</div>
{{ end }}
@ -60,7 +79,7 @@
{{ end }}
{{ if eq $scratch.depth "crust" }}
<div class="has">
<div class="has hasin">
<div class="hassup">in {{ index $scratch.in 1 }}</div>
<div class="afterhas">
{{ range $scratch.is_in }}
@ -74,8 +93,6 @@
</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
class="keywords"><span class="sup">keywords</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ with .Page.Params.abstract }}</div>{{ end }}
{{- $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 -}}

View file

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

View file

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