handle footnotes correctly, hide internal notes

This commit is contained in:
Oleg Belyaev 2025-03-30 20:01:15 +03:00
parent 0e7fb74acf
commit 9151b9eb32
4 changed files with 59 additions and 12 deletions

View file

@ -68,6 +68,10 @@ body > header {
body>main {
max-width:950px
}
article.abv-entry {
display: grid;
grid-template-columns: minmax(10%,15%) minmax(0,5%) minmax(75%,90%);
}
}
@media (min-width:1280px) {
body>footer>nav,
@ -131,11 +135,6 @@ main {
padding-top: 0 !important;
}
article.abv-entry {
display: grid;
grid-template-columns: minmax(0px,15%) 5% minmax(50%,80%);
}
section {}
aside#leftbar {
@ -404,6 +403,10 @@ div.index-submit {
float: right;
}
div.notes {
font-size: smaller;
}
optgroup {}
option {}
option:checked {}
@ -422,7 +425,6 @@ button#open-leftbar{
left: 0;
/*height: 1ex;*/
/*line-height: 1ex;*/
/*width: 1em;*/
}
button#close-leftbar{
@ -432,6 +434,23 @@ button#close-leftbar{
display: none;
}
@media (max-width: 1024px) {
button#open-leftbar {
width: 1em;
height: 10ex;
margin: 0 auto;
padding-left: 0;
padding-right: 0;
}
button#close-leftbar {
width: 1em;
height: 10ex;
margin: 0 auto;
padding-left: 0;
padding-right: 0;
}
}
/* This matches forms or form elements that are invalid *and* have been
interacted with. Note that:
1) You may need to add the `interacted` class to forms yourself
@ -521,6 +540,9 @@ span.abv-text-ul {
span.abv-text-sc {
font-variant-caps: small-caps;
}
span.abv-name {
font-variant-caps: small-caps;
}
/*
This file evolved from Natural Selection:

View file

@ -16,8 +16,8 @@ declare %rest:path("{$lang}/entries/{$id}")
%output:html-version('5')
function entries:entry($lang as xs:string, $id as xs:string, $query as xs:string?) {
if (count($query) = 0) then
(: doc(`abaevdict_{$lang}/html/{$id}.html`) :)
abv-m:make-html(doc(`abaevdict_{$lang}/xml/{$id}.xml`),$lang)
doc(`abaevdict_{$lang}/html/{$id}.html`)
(: abv-m:make-html(doc(`abaevdict_{$lang}/xml/{$id}.xml`),$lang) :)
else
let $xml := doc(`abaevdict_{$lang}/xml/{$id}.xml`)/tei:entry[1]
let $marked := ft:mark(

View file

@ -3,7 +3,10 @@ declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
abv-m:make-html(doc('abaevdict_en/xml/entry_a.xml'),'en')
abv-m:make-html(doc('abaevdict_en/xml/entry_abūzyn.xml'),'en')
(: for $node in collection('abaevdict')//tei:ref/@target[.='#ref_Walde—Pok.']
return replace value of node $node with '#ref_Walde-Pok.' :)
(: collection(`abaevdict_en/html`)/article[@id='entry_az'] :)
(: html:doc('abaevdict_en/html/entry_az.html') :)

View file

@ -102,6 +102,9 @@
</p>
</xsl:for-each-group>
</div>
<div class="notes">
<xsl:apply-templates select="//tei:note[@type='footnote']" mode="footnote"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
@ -131,7 +134,7 @@
<xsl:template match="tei:form/tei:orth">
<xsl:variable name="elem">
<xsl:choose>
<xsl:when test="ancestor::tei:cit[@type='formGrp']">i</xsl:when>
<xsl:when test="ancestor::tei:cit[@type='formGrp'] or ancestor::tei:re">i</xsl:when>
<xsl:otherwise>b</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@ -335,8 +338,27 @@
</td>
</xsl:template>
<xsl:template match=
"text()">
<!-- Footnotes -->
<xsl:template match="tei:note[@type='footnote']">
<xsl:variable name="no"><xsl:number level="single"/></xsl:variable>
<a id="fn_{/tei:entry/@xml:id}_{$no}" href="#fntxt_{/tei:entry/@xml:id}_{$no}"><sup><xsl:value-of select="$no"/></sup></a>
</xsl:template>
<xsl:template match="tei:note[@type='footnote']" mode='footnote'>
<xsl:variable name="no"><xsl:number level="single"/></xsl:variable>
<p>
<a id="fntxt_{/tei:entry/@xml:id}_{$no}" href="#fn_{/tei:entry/@xml:id}_{$no}"><sup><xsl:value-of select="$no"/></sup></a>
<xsl:apply-templates />
</p>
</xsl:template>
<!-- Remove internal notes -->
<xsl:template match="tei:note[@type='internal']">
</xsl:template>
<!-- get rid of new lines -->
<xsl:template match="text()">
<xsl:value-of select="replace(translate(., '&#xA;', ''), ' +', ' ')"/>
</xsl:template>
</xsl:stylesheet>