Skip to content

Commit 1b5a8d5

Browse files
authored
Merge pull request #9 from cityEHR/custom-font
Format the documentation using a custom font
2 parents c941d34 + 9c22e99 commit 1b5a8d5

13 files changed

Lines changed: 560 additions & 10 deletions

File tree

cityehr-documentation-common/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,27 @@
2121
</scm>
2222

2323
<build>
24+
<resources>
25+
<resource>
26+
<directory>src/main/fop-config</directory>
27+
<filtering>true</filtering>
28+
</resource>
29+
</resources>
30+
2431
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-resources-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<phase>process-resources</phase>
38+
<goals>
39+
<goal>resources</goal>
40+
</goals>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
2545
<plugin>
2646
<groupId>org.codehaus.mojo</groupId>
2747
<artifactId>xml-maven-plugin</artifactId>
Binary file not shown.
Binary file not shown.

cityehr-documentation-common/src/main/fop-config/fop.xconf

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@
4040
</xsl:for-each>
4141
</xsl:template>
4242

43+
<xsl:template name="hcom:style">
44+
<style>
45+
@font-face {
46+
font-family: avertaRegular;
47+
src: url(fonts/AvertaDemoPECuttedDemo-Regular.otf);
48+
}
49+
50+
@font-face {
51+
font-family: avertaExtraBold;
52+
src: url(fonts/AvertaDemoPE-ExtraBold.otf);
53+
font-weight: bold;
54+
}
55+
56+
body {
57+
font-family: avertaRegular;
58+
}
59+
60+
h1, h2, h3 {
61+
font-family: avertaExtraBold;
62+
}
63+
</style>
64+
</xsl:template>
65+
4366
<!-- TOC (Table of Contents) -->
4467
<xsl:template name="hcom:toc">
4568
<xsl:param name="sections" as="element()+"/>
@@ -66,11 +89,11 @@
6689
<xsl:variable name="section-id" select="generate-id($section)"/>
6790

6891
<!-- section -->
69-
<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>
7093

7194
<!-- then process sub sections recursively (no more than 4 levels deep!) -->
72-
<xsl:if test="$level le 4">
73-
<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;">
7497
<xsl:for-each select="$section/body/section|$section/section">
7598
<xsl:call-template name="hcom:toc-entry">
7699
<xsl:with-param name="section" select="."/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<xsl:import href="common.xslt"/>
2222

2323
<xsl:template name="pcom:fo-root">
24-
<fo:root xml:lang="en" font-family="Arial,Helvetica,sans-serif" font-size="11pt">
24+
<fo:root xml:lang="en" font-family="Averta,Arial,Helvetica,sans-serif" font-size="11pt">
2525
<xsl:call-template name="pcom:fo-layout-master-set"/>
2626

2727
<xsl:apply-templates mode="declarations"/>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
<xsl:with-param name="created-dateTime" select="$revision"/>
4545
<xsl:with-param name="modified-dateTime" select="$revision"/>
4646
</xsl:call-template>
47+
<xsl:call-template name="hcom:style"/>
48+
<style>
49+
.toc-entry-level-1 {
50+
margin-top: 1em;
51+
}
52+
</style>
4753
</head>
4854
<body about="">
4955
<div id="cover-page">
@@ -101,13 +107,13 @@
101107

102108
<!-- TOC (Table of Contents) -->
103109
<xsl:template match="map" mode="toc">
104-
<secton>
110+
<section>
105111
<h2>Table of Contents</h2>
106112
<xsl:apply-templates select="topicref" mode="create-topic-html"/>
107113
<xsl:call-template name="hcom:toc">
108114
<xsl:with-param name="sections" select="topicref"/>
109115
</xsl:call-template>
110-
</secton>
116+
</section>
111117
</xsl:template>
112118

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<xsl:with-param name="created-dateTime" select="$revision"/>
4242
<xsl:with-param name="modified-dateTime" select="$revision"/>
4343
</xsl:call-template>
44+
<xsl:call-template name="hcom:style"/>
4445
</head>
4546
<body>
4647
<nav id="top-nav">

cityehr-documentation-parent/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@
6868
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6969
<saxon.version>12.5</saxon.version>
7070

71+
<fop.config.path>${project.basedir}/../cityehr-documentation-common/target/classes/fop.xconf</fop.config.path>
72+
7173
<common.catalog.path>${project.basedir}/../cityehr-documentation-common/src/main/catalog/catalog.xml</common.catalog.path>
7274

7375
<common.xslt.path>${project.basedir}/../cityehr-documentation-common/src/main/xslt</common.xslt.path>
7476
<common.create-map-pdf.xslt.path>${common.xslt.path}/create-map-pdf.xslt</common.create-map-pdf.xslt.path>
7577
<common.create-map-html.xslt.path>${common.xslt.path}/create-map-html.xslt</common.create-map-html.xslt.path>
7678

7779
<common.images.path>${project.basedir}/../cityehr-documentation-common/src/main/images</common.images.path>
80+
<common.fonts.path>${project.basedir}/../cityehr-documentation-common/src/main/fonts</common.fonts.path>
7881
</properties>
7982

8083
<build>

cityehr-documentation-website/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,23 @@
8383
</execution>
8484

8585
<execution>
86-
<id>copy-common-images</id>
86+
<id>copy-common-resources</id>
8787
<phase>package</phase>
8888
<goals>
8989
<goal>copy-resources</goal>
9090
</goals>
9191
<configuration>
92-
<outputDirectory>${website.output.folder}/images</outputDirectory>
92+
<outputDirectory>${website.output.folder}</outputDirectory>
9393
<resources>
9494
<resource>
9595
<directory>${common.images.path}</directory>
9696
<filtering>false</filtering>
97+
<targetPath>images</targetPath>
98+
</resource>
99+
<resource>
100+
<directory>${common.fonts.path}</directory>
101+
<filtering>false</filtering>
102+
<targetPath>fonts</targetPath>
97103
</resource>
98104
</resources>
99105
</configuration>

0 commit comments

Comments
 (0)