Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
6e22ee22
Commit
6e22ee22
authored
Jul 11, 2019
by
Mathias Goebel
Browse files
add alphabetic links to the gesamtinhaltsverzeichnis
parent
861d736e
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/inhaltsverzeichnis.xqm
View file @
6e22ee22
...
...
@@ -22,26 +22,33 @@ declare namespace xhtml="http://www.w3.org/1999/xhtml";
: @param $model Stores any arbitrary information to pass-through templating functions
:)
declare function f-content:main($node as node(), $model as map(*)) {
let $items := collection($config:data-root || "/data")//tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:msContents/tei:ab/tei:list[@type="editorial"]/tei:item
let $sortPattern := "^\W+"
return
<xhtml:div>
<xhtml:ul class="gesamtinhaltsverzeichnis">
{for $item in collection($config:data-root || "/data")//tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:msContents/tei:ab/tei:list[@type="editorial"]/tei:item
let $order := upper-case(string($item)) => replace("^\W+", "")
<xhtml:ul class="paginationAlphabet">
{let $groups := $items ! (upper-case(string(.)) => replace($sortPattern, "") => substring(1, 1))
return sort(distinct-values($groups)) ! <xhtml:li><xhtml:a href="#id{.}">{.}</xhtml:a></xhtml:li>}
</xhtml:ul>
<xhtml:ul class="gesamtinhaltsverzeichnis">
{for $item in $items
let $order := upper-case(string($item)) => replace($sortPattern, "")
let $group := $order => substring(1, 1)
stable order by $order
group by $group
return
<xhtml:li>{$group}
<xhtml:li
id="id{$group}"
>{$group}
<xhtml:ul>
{
for $i in $item
let $nbname := $i/root()/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]/substring-after(., " ")
return
<xhtml:li class="tocItem"><xhtml:span class="nbname">[{$nbname}]</xhtml:span>
{local:renderTOCitem($i)}</xhtml:li>
<xhtml:li class="tocItem"><xhtml:span class="nbname">[{$nbname}]</xhtml:span>
 
{local:renderTOCitem($i)}</xhtml:li>
}
</xhtml:ul>
</xhtml:li>
}
</xhtml:ul>
</xhtml:ul>
</xhtml:div>
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment