Skip to content

Commit

Permalink
Merge pull request #73 from karl-kraus/elda/whitespaces
Browse files Browse the repository at this point in the history
Elda/whitespaces
  • Loading branch information
linxOD authored Oct 15, 2024
2 parents e78cca5 + acbafb1 commit 7540802
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 23 deletions.
32 changes: 22 additions & 10 deletions scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,15 @@ details[open] > summary::after {
line-height: 11pt;
}


#textcontent-pb .longQuote,
#textcontent-pb .typescriptLongQuote,
#textcontent-pb .inkLongQuote,
#textcontent-pb .typescriptLongQuoteLeading {
font-size: 1em;
line-height: 1em;
}

#textcontent-pb .longQuote,
#textcontent-pb .inkLongQuote
{
font-size: 7pt !important;
line-height: 8pt !important;
}
Expand Down Expand Up @@ -939,10 +943,10 @@ details[open] > summary::after {
color: #303030;
}

#textcontent-pb .metamark {
position: absolute;
text-indent: 0 !important;
}
// #textcontent-pb .metamark {
// position: absolute;
// text-indent: 0 !important;
// }

#textcontent-pb .note {
position: absolute;
Expand Down Expand Up @@ -1010,15 +1014,15 @@ details[open] > summary::after {
}

.marginRight {
margin-left: 20%;
margin-left: 10%;
}

.marginLeft {
margin-left: 40%;
margin-left: 30%;
}

.marginLeftAbove {
margin-left: 10%;
margin-left: 40%;
margin-bottom: 10pt;
}

Expand Down Expand Up @@ -1081,4 +1085,12 @@ wpn-time-line {
border: 2px solid $wpn-red;
background-color: $wpn-red;
opacity: 0.4;
}

.align-super {
vertical-align: super;
}

.text-decoration-underline-dotted {
text-decoration: underline dotted;
}
87 changes: 74 additions & 13 deletions xslt/editions_typo.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
version="3.0" exclude-result-prefixes="#all">

<xsl:output encoding="UTF-8" media-type="text/html" method="html" version="5.0" indent="no" omit-xml-declaration="yes"/>
<xsl:preserve-space elements="*" />

<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="tei:p tei:mod tei:seg"/>

<xsl:import href="./partials/shared.xsl"/>
<xsl:import href="./partials/html_navbar.xsl"/>
<xsl:import href="./partials/html_head.xsl"/>
Expand Down Expand Up @@ -121,6 +124,7 @@
</body>
</html>
</xsl:template>

<xsl:template match="tei:body">
<xsl:variable name="printType">
<xsl:value-of select=".//tei:pb[1]/@type"/>
Expand All @@ -132,13 +136,13 @@
</div>
<div class="print-body {$printType}">
<div class="body-left">
<xsl:apply-templates select="//tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Left')]" mode="render"/>
<xsl:apply-templates select="//tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Left')] | //tei:del[not(parent::tei:subst) and contains(@rend, 'Left')] | //tei:metamark[@function='progress' and contains(@rend, 'Left')] | //tei:metamark[@function='transposition' and contains(@rend, 'Left')]" mode="render"/>
</div>
<div class="body-main">
<xsl:apply-templates/>
</div>
<div class="body-right">
<xsl:apply-templates select="//tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Right')]" mode="render"/>
<xsl:apply-templates select="//tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Right')] | //tei:del[not(parent::tei:subst) and contains(@rend, 'Right')] | //tei:metamark[@function='progress' and contains(@rend, 'Right')] | //tei:metamark[@function='transposition' and contains(@rend, 'Right')]" mode="render"/>
</div>
</div>
<div class="print-footer {$printType}">
Expand Down Expand Up @@ -202,9 +206,6 @@
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:del[not(ancestor::tei:restore)][not(ancestor::tei:restore[ancestor::tei:restore[child::tei:seg]])]"/> -->
<xsl:template match="tei:del">
<del><xsl:apply-templates/></del>
</xsl:template>
<xsl:template match="tei:hi[@rendition='#inkOnProof_KK_spc' or @rendition='#typescriptSpc' or @style='letterSpacing']">
<span class="spacing"><xsl:apply-templates/></span>
</xsl:template>
Expand Down Expand Up @@ -247,24 +248,78 @@
<xsl:template match="tei:add[@rend|parent::tei:subst[@rend] and contains((@rend|parent::tei:subst/@rend), 'Left')]">
<wpn-entity class="add entity" id="{@xml:id}"></wpn-entity>
</xsl:template> -->
<xsl:template match="tei:add[not(@rendition)]">
<xsl:template match="tei:del[not(parent::tei:subst[@rend='overwritten']) and not(parent::tei:restore)]">
<del class="entity" id="{@xml:id}"><xsl:apply-templates/></del>
</xsl:template>
<xsl:template match="tei:del[parent::tei:subst[@rend='overwritten']]">
<span class="del text-black-grey"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="tei:del[not(parent::tei:subst) and contains(@rend, 'Left')]" mode="render">
<div class="del {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:text>&#124; </xsl:text><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:del[not(parent::tei:subst) and contains(@rend, 'Right')]" mode="render">
<div class="del {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:text>&#124; </xsl:text><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:del[parent::tei:restore]">
<del class="add entity text-decoration-underline-dotted" id="{@xml:id}"><xsl:apply-templates/></del>
</xsl:template>
<xsl:template match="tei:add[not(@rendition) and not(parent::tei:subst[@rend='overwritten']) and not(parent::tei:restore)]">
<span class="add entity" id="{@xml:id}"></span>
</xsl:template>
<xsl:template match="tei:add[parent::tei:restore]">
<del class="add entity" id="{@xml:id}"><xsl:apply-templates/></del><span class="text-decoration-underline-dotted"> &#124; </span>
</xsl:template>
<xsl:template match="tei:add[parent::tei:subst[@rend='overwritten']]">
<span class="entity ms-n1 me-n1 align-super" id="{@xml:id}"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="tei:add[not(parent::tei:subst)]">
<span class="add entity" id="{@xml:id}"><xsl:text> &#124; </xsl:text></span>
</xsl:template>
<xsl:template match="tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Right')]" mode="render">
<div class="add {if(parent::tei:subst)then(parent::tei:subst/@rend)else(@rend)} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:apply-templates/></div>
<div><xsl:text>&#124; </xsl:text><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:add[@rend|parent::tei:subst[@rend] and contains((if(parent::tei:subst[@rend])then(parent::tei:subst/@rend)else(@rend)), 'Left')]" mode="render">
<div class="add {if(parent::tei:subst)then(parent::tei:subst/@rend)else(@rend)} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:apply-templates/></div>
<div><xsl:text>&#124; </xsl:text><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:add[@rendition]">
<span class="add rendition {replace(@rendition,'#','')} {replace(@change,'#','')}">
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="tei:metamark[@function='progress']">
<span class="metamark entity" id="{@xml:id}"></span>
</xsl:template>
<xsl:template match="tei:metamark[@function='progress' and contains(@rend, 'Left')]" mode="render">
<div class="metamark {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:metamark[@function='progress' and contains(@rend, 'Right')]" mode="render">
<div class="metamark {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:apply-templates/></div>
</div>
</xsl:template>
<xsl:template match="tei:metamark[@function='transposition']">
<span class="metamark entity" id="{@xml:id}"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="tei:metamark[@function='transposition' and contains(@rend, 'Left')]" mode="render">
<div class="metamark {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:text>&#423;</xsl:text></div>
</div>
</xsl:template>
<xsl:template match="tei:metamark[@function='transposition' and contains(@rend, 'Right')]" mode="render">
<div class="metamark {@rend} {replace(@change,'#','')}" data-xmlid="{@xml:id}">
<div><xsl:text>&#423;</xsl:text></div>
</div>
</xsl:template>
<!-- <xsl:template match="tei:add[ancestor::tei:restore[not(child::tei:seg)]]"/>
<xsl:template match="tei:add[ancestor::tei:restore[child::tei:seg]]">
<xsl:apply-templates/>
Expand All @@ -273,7 +328,7 @@
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:subst">
<xsl:apply-templates/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:seg">
<xsl:apply-templates/>
Expand All @@ -282,7 +337,12 @@
<xsl:variable name="target" select="replace(@target,'#','')"/>
<xsl:apply-templates select="doc('../data/editions/Gesamt.xml')//tei:seg[@xml:id=$target]" mode="render"/>
</xsl:template> -->
<!-- <xsl:template match="tei:seg[@type=('transposition','relocation') and not(parent::tei:restore)]"/> -->
<xsl:template match="tei:seg[@type='transposition' and not(@subtype='implicit') and not(parent::tei:restore)]">
<span class="border rounded-pill"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="tei:seg[@type='transposition' and not(@subtype='implicit') and parent::tei:restore]">
<span class="border-dotted rounded-pill"><xsl:apply-templates/></span>
</xsl:template>
<!-- <xsl:template match="tei:seg[@type=('transposition','relocation')]" mode="render">
<xsl:apply-templates/>
</xsl:template> -->
Expand All @@ -296,9 +356,9 @@
<xsl:apply-templates select="doc('../data/editions/Gesamt.xml')//tei:note[@xml:id=$target]" mode="render"/>
</wpn-entity>
</xsl:template> -->
<xsl:template match="tei:metamark[@function=('printInstruction','undefined','progress')]">
<!-- <xsl:template match="tei:metamark[@function=('printInstruction','undefined','progress')]">
<span class="metamark {replace(@change, '#', '')} {@rend} {replace(@rendition, '#', '')} {@place}"><xsl:apply-templates/></span>
</xsl:template>
</xsl:template> -->
<xsl:template match="tei:mod[@style=('noLetterSpacing') and not(parent::tei:restore)]">
<span class="ls-0"><xsl:apply-templates/></span>
</xsl:template>
Expand Down Expand Up @@ -342,4 +402,5 @@
<xsl:template match="tei:span[not(@n)]">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:listTranspose"/>
</xsl:stylesheet>
16 changes: 16 additions & 0 deletions xslt/partials/add-header-pb.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,20 @@
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="tei:del">
<xsl:copy>
<xsl:attribute name="xml:id">
<xsl:value-of select="concat(replace(tokenize(base-uri(), '/')[last()], '.xml', ''), '-del-', generate-id())"/>
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="tei:metamark">
<xsl:copy>
<xsl:attribute name="xml:id">
<xsl:value-of select="concat(replace(tokenize(base-uri(), '/')[last()], '.xml', ''), '-mm-', generate-id())"/>
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

0 comments on commit 7540802

Please sign in to comment.