Skip to content

Commit

Permalink
added support for text alignment in datelines
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Nov 26, 2014
1 parent 8a177b9 commit f6b1fd6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
19 changes: 19 additions & 0 deletions resources/css/doc_singleView.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,22 @@ div#docFrame {
/* height: 700px !important;*/
border: none;
}

.tei_dateline {
display: block;
width: 100%;
}

.block-right {
text-align: right;
}

.block-left {
text-align: left;
}

/* Funktioniert nicht, da der folgenden Absatz meist ein p ist und damit block … */
.block-inline {
display: inline-block;
width:auto;
}
31 changes: 31 additions & 0 deletions xsl/doc_text.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,36 @@
<xsl:template match="tei:lem">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="tei:dateline">
<xsl:element name="span">
<xsl:apply-templates select="@xml:id"/>
<xsl:attribute name="class">
<xsl:text>tei_dateline</xsl:text>
<xsl:choose>
<xsl:when test="@rend='left'">
<xsl:text> block-left</xsl:text>
</xsl:when>
<xsl:when test="@rend='inline'">
<xsl:text> block-inline</xsl:text>
</xsl:when>
<xsl:when test="@rend='right'">
<xsl:text> block-right</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="ancestor::tei:opener">
<xsl:text> block-right</xsl:text>
</xsl:when>
<xsl:when test="ancestor::tei:closer">
<xsl:text> block-left</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

0 comments on commit f6b1fd6

Please sign in to comment.