Skip to content

Commit 9c22e99

Browse files
committed
Improve styling of table of contents on website
1 parent 36c852e commit 9c22e99

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

cityehr-documentation-common/src/main/xslt/common-html.xslt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@
4343
<xsl:template name="hcom:style">
4444
<style>
4545
@font-face {
46-
font-family: avertaRegular;
47-
src: url(fonts/AvertaDemoPECuttedDemo-Regular.otf);
46+
font-family: avertaRegular;
47+
src: url(fonts/AvertaDemoPECuttedDemo-Regular.otf);
4848
}
4949

5050
@font-face {
51-
font-family: avertaExtraBold;
52-
src: url(fonts/AvertaDemoPE-ExtraBold.otf);
53-
font-weight: bold;
51+
font-family: avertaExtraBold;
52+
src: url(fonts/AvertaDemoPE-ExtraBold.otf);
53+
font-weight: bold;
5454
}
5555

5656
body {
57-
font-family: avertaRegular;
57+
font-family: avertaRegular;
5858
}
5959

6060
h1, h2, h3 {
61-
font-family: avertaExtraBold;
61+
font-family: avertaExtraBold;
6262
}
6363
</style>
6464
</xsl:template>
@@ -89,11 +89,11 @@
8989
<xsl:variable name="section-id" select="generate-id($section)"/>
9090

9191
<!-- section -->
92-
<li><xsl:value-of select="string-join($numbers, '.')"/><xsl:text>. </xsl:text><a name="{$section-id}" href="{$page-url}"><xsl:value-of select="$section/title"/></a></li>
92+
<li class="toc-entry-level-{$level}"><xsl:value-of select="string-join($numbers, '.')"/><xsl:text>. </xsl:text><a name="{$section-id}" href="{$page-url}"><xsl:value-of select="$section/title"/></a></li>
9393

9494
<!-- then process sub sections recursively (no more than 4 levels deep!) -->
95-
<xsl:if test="$level le 4">
96-
<ol style="list-style-type: none;">
95+
<xsl:if test="$level le 4 and exists($section/body/section|$section/section)">
96+
<ol class="toc-level-{$level + 1}" style="list-style-type: none;">
9797
<xsl:for-each select="$section/body/section|$section/section">
9898
<xsl:call-template name="hcom:toc-entry">
9999
<xsl:with-param name="section" select="."/>

cityehr-documentation-common/src/main/xslt/create-map-html.xslt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
<xsl:with-param name="modified-dateTime" select="$revision"/>
4646
</xsl:call-template>
4747
<xsl:call-template name="hcom:style"/>
48+
<style>
49+
.toc-entry-level-1 {
50+
margin-top: 1em;
51+
}
52+
</style>
4853
</head>
4954
<body about="">
5055
<div id="cover-page">
@@ -102,13 +107,13 @@
102107

103108
<!-- TOC (Table of Contents) -->
104109
<xsl:template match="map" mode="toc">
105-
<secton>
110+
<section>
106111
<h2>Table of Contents</h2>
107112
<xsl:apply-templates select="topicref" mode="create-topic-html"/>
108113
<xsl:call-template name="hcom:toc">
109114
<xsl:with-param name="sections" select="topicref"/>
110115
</xsl:call-template>
111-
</secton>
116+
</section>
112117
</xsl:template>
113118

114119
<!-- OVERRIDE this template from create-topic-html.xsd so that we can add previous and following links -->

0 commit comments

Comments
 (0)