Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Introduction of new feature: milestone as chapterdivider
This is a feature for the Nation State book (Studies 14) where some
chapters are not divided by sections, but simply by asterisks
  • Loading branch information
kthoden committed Feb 27, 2020
1 parent 0170e6f commit e8c2f28
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/stylesheets/tei2html/tei2html_chapter_utils.xsl
Expand Up @@ -146,7 +146,7 @@
<!-- back/forward navigation -->
<xsl:apply-templates mode="chapter_navigation" select="."/>
</section>
<!-- chapter content closed-->
<!-- chapter content closed-->
</div>
</div>
</main>
Expand Down Expand Up @@ -347,6 +347,18 @@ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
</xsl:call-template>
</xsl:template>


<xsl:template mode="chapter_main_paragraphs" match="tei:milestone[@type='chapterdivider']">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('chapter divider', $id))"/>
<xsl:call-template name="render_paragraph_container">
<xsl:with-param name="content" as="element()*">
<h2 style="text-align: center;">*</h2>
</xsl:with-param>
</xsl:call-template>
</xsl:template>


<xsl:template mode="chapter_main_paragraphs" match="tei:epigraph">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('chapter epigraph', $id))"/>
Expand Down
45 changes: 45 additions & 0 deletions src/stylesheets/tei2html/utils/html_container.xsl
Expand Up @@ -53,6 +53,39 @@
</div>
</xsl:template>

<!--
<xsl:template mode="container" match="tei:milestone[@type='chapterdivider']">
<xsl:param name="indices" as="element(eoa:index)*" tunnel="yes"/>
<xsl:variable name="chapter_id"><xsl:call-template name="chapter_id"/></xsl:variable>
<xsl:variable name="uri"><xsl:call-template name="full_uri_from_chapter"/></xsl:variable>
<xsl:variable name="id" as="xs:string"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('section', $id))"/>
<xsl:variable name="index_elems" as="element(eoa:term)*"
select="$indices//eoa:term[eoa:entry/eoa:link[eoa:entry[3] = $chapter_id and eoa:entry[4] = $id]]"
/>
<div class="accordion__item active" id="{$id}">
<a class="accordion__title" href="#">
<xsl:call-template name="accordion_row">
<xsl:with-param name="url_icon_content" as="xs:string" select="$uri"/>
<xsl:with-param name="eye_icon_content">
<xsl:call-template name="render_eye_content">
<xsl:with-param name="current_id" as="xs:string" select="$id"/>
<xsl:with-param name="index_elems" as="element(eoa:term)*" select="$index_elems"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="content" as="element()*">
<h2 style="text-align: center;">* * *</h2>
</xsl:with-param>
</xsl:call-template>
</a>
<div class="accordion__content">
<xsl:apply-templates mode="container" select="*[not(self::tei:head)]"/>
<a class="accordion__pageup" href="#"></a>
</div>
</div>
</xsl:template>
-->

<xsl:template mode="container" match="tei:div[@type='subsection']">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('subsection', $id))"/>
Expand Down Expand Up @@ -215,6 +248,18 @@
</xsl:call-template>
</xsl:template>


<xsl:template mode="container" match="tei:milestone[@type='chapterdivider']">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('chapterdivider', $id))"/>
<xsl:call-template name="render_paragraph_container">
<xsl:with-param name="content">
<h2 style="text-align: center;">*</h2>
</xsl:with-param>
</xsl:call-template>
</xsl:template>


<xsl:template mode="container" match="tei:ab[@type=('equation', 'subequations', 'equationarray')]">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:choose>
Expand Down
2 changes: 2 additions & 0 deletions src/stylesheets/tei2html/utils/numbering.xsl
Expand Up @@ -204,6 +204,7 @@
(
self::tei:div[@type = ('section', 'subsection', 'subsubsection', 'sidebyside', 'bilingual')]
| self::tei:p
| self::tei:milestone[@type='chapterdivider']
| self::tei:epigraph
| self::tei:ab
| self::tei:lg
Expand All @@ -221,6 +222,7 @@
(
tei:div[@type = ('section', 'subsection', 'subsubsection', 'sidebyside', 'bilingual')]
| tei:p
| tei:milestone[@type='chapterdivider']
| tei:epigraph
| tei:ab
| tei:lg
Expand Down

0 comments on commit e8c2f28

Please sign in to comment.