Skip to content

Commit

Permalink
Switch to using "Front Matter" in generated XHTML
Browse files Browse the repository at this point in the history
This switches from using the document title in generated navigation
headers and footers to a generic "Front Matter" title. This is because
the titles of documents are often too large to fit pleasantly in
the headers.

Affects: #12
  • Loading branch information
io7m committed Dec 19, 2020
1 parent fe57714 commit 5976e04
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
13 changes: 11 additions & 2 deletions README-CHANGES.xml
@@ -1,9 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<c:changelog project="com.io7m.xstructural" xmlns:c="urn:com.io7m.changelog:4.0">
<c:releases>
<c:release date="2020-12-11T13:54:54+00:00" ticket-system="com.github.io7m.xstructural" version="1.0.0">
<c:release date="2020-12-11T00:00:00+00:00" is-open="false" ticket-system="com.github.io7m.xstructural" version="1.0.0">
<c:changes>
<c:change date="2020-12-11T13:54:54+00:00" summary="Initial public release"/>
<c:change date="2020-12-11T00:00:00+00:00" summary="Initial public release"/>
</c:changes>
</c:release>
<c:release date="2020-12-19T17:37:29+00:00" is-open="true" ticket-system="com.github.io7m.xstructural" version="1.1.0">
<c:changes>
<c:change date="2020-12-19T17:37:29+00:00" summary="Use &quot;Front Matter&quot; in XHTML documents">
<c:tickets>
<c:ticket id="12"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
Expand Up @@ -20,4 +20,5 @@
<a href="https://www.io7m.com/">io7m</a>
| <a href="index.xhtml">single-page</a>
| <a href="index-m.xhtml">multi-page</a>
| xstructural ${project.version}
</div>
Expand Up @@ -117,6 +117,9 @@
</xsl:variable>

<xsl:choose>
<xsl:when test="local-name($node) = 'Document'">
<xsl:value-of select="'Front Matter'"/>
</xsl:when>
<xsl:when test="$node/attribute::title">
<xsl:value-of select="concat($number,': ',$node/attribute::title)"/>
</xsl:when>
Expand Down Expand Up @@ -160,6 +163,9 @@
</xsl:variable>

<xsl:choose>
<xsl:when test="$type = 'Document'">
<xsl:value-of select="'Front Matter'"/>
</xsl:when>
<xsl:when test="$node/attribute::title">
<xsl:value-of select="concat($type,' ',$number,': ',$node/attribute::title)"/>
</xsl:when>
Expand Down
Expand Up @@ -121,7 +121,7 @@
as="xs:string">
<xsl:choose>
<xsl:when test="local-name($sectionUp) = 'Document'">
<xsl:value-of select="$sectionUp/s:Metadata/dc:title"/>
<xsl:value-of select="'Front Matter'"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="sectionUpNumber">
Expand Down Expand Up @@ -157,7 +157,7 @@
as="xs:string">
<xsl:choose>
<xsl:when test="local-name($sectionPrev) = 'Document'">
<xsl:value-of select="$documentTitle"/>
<xsl:value-of select="'Front Matter'"/>
</xsl:when>
<xsl:when test="count($sectionsPreceding) > 0">
<xsl:variable name="sectionPrevNumber"
Expand Down Expand Up @@ -197,7 +197,7 @@
as="xs:string">
<xsl:choose>
<xsl:when test="local-name($sectionNext) = 'Document'">
<xsl:value-of select="$documentTitle"/>
<xsl:value-of select="'Front Matter'"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="sectionNextNumber"
Expand Down

0 comments on commit 5976e04

Please sign in to comment.