Skip to content

Commit 2fd6a87

Browse files
committed
Rearrange common assets
1 parent 5c340c1 commit 2fd6a87

33 files changed

+430
-130
lines changed

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ jobs:
3131
- name: Generate website (XSLT)
3232
id: generate
3333
# Override Maven properties for the Petal button url
34-
run: mvn -B -Dpetal.api-url=https://petal.evolvedbinary.com -Dpetal.github-org-name=evolvedbinary -Dpetal.github-repo-name=cityehr-documentation -Dpetal.github-branch=develop -Dpetal.referrer-base-url=https://evolvedbinary.github.io/cityehr-documentation package -Pquick-start-guide-website
34+
run: mvn -B -Dpetal.api-url=https://petal.evolvedbinary.com -Dpetal.github-org-name=evolvedbinary -Dpetal.github-repo-name=cityehr-documentation -Dpetal.github-branch=develop -Dpetal.referrer-base-url=https://evolvedbinary.github.io/cityehr-documentation package -Dcityehr-documentation-website=true
3535
- name: Setup Pages
3636
uses: actions/configure-pages@v5
3737
- name: Upload pages artifact
3838
id: deployment
3939
uses: actions/upload-pages-artifact@v3
4040
with:
41-
path: cityehr-quick-start-guide/target/website/
41+
path: cityehr-documentation-website/target/website/
4242
deploy:
4343
environment:
4444
name: github-pages

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ When the source code of a document is updated in GitHub, we use GitHub Actions t
99

1010
## Documents
1111

12-
| Title | Source Location | Renderings |
13-
|---|---|---|
12+
| Title | Source Location | Renderings |
13+
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
1414
| Quick Start Guide | [cityehr-quick-start-guide/src/main/lwdita/quickstart-guide-modular](cityehr-quick-start-guide/src/main/lwdita/quickstart-guide-modular) | [HTML](https://cityehr.github.io/cityehr-documentation/) / [PDF](https://cityehr.github.io/cityehr-documentation/quickstart-guide.pdf) |
15+
| Modelling Guide | [cityehr-modelling-guide/src/main/lwdita/modelling-guide](cityehr-modelling-guide/src/main/lwdita/modelling-guide) | [HTML](https://cityehr.github.io/cityehr-documentation/) / [PDF](https://cityehr.github.io/cityehr-documentation/modelling-guide.pdf) |
1516

1617

1718
## Developing the Documentation
@@ -34,9 +35,12 @@ $ cd cityehr-documentation
3435

3536
3. Run the following command to have Maven (mvn) render a new PDF and HTML version of the documentation:
3637
```bash
37-
$ mvn clean package -Pquick-start-guide-website
38+
$ mvn clean package -Dcityehr-documentation-website=true
3839
```
3940

4041
You can find the rendered versions of the documentation in the `target/` sub-folder of each module. For example:
42+
* `cityehr-documentation-website/target/website/index.html`
4143
* `cityehr-quick-start-guide/target/quickstart-guide.pdf`
4244
* `cityehr-quick-start-guide/target/website/index.html`
45+
* `cityehr-modelling-guide/target/modelling-guide.pdf`
46+
* `cityehr-modelling-guide/target/website/index.html`

cityehr-documentation-common/pom.xml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>com.seveninformatics.cityehr.documentation</groupId>
6+
<artifactId>cityehr-documentation-parent</artifactId>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<relativePath>../cityehr-documentation-parent</relativePath>
9+
</parent>
10+
11+
<artifactId>cityehr-documentation-common</artifactId>
12+
<packaging>pom</packaging>
13+
14+
<name>cityEHR Documentation Common Files</name>
15+
<description>Common Files for cityEHR documentation projects</description>
16+
17+
<scm>
18+
<connection>scm:git:https://github.com/cityehr/cityehr-documentation.git</connection>
19+
<developerConnection>scm:git:https://github.com/cityehr/cityehr-documentation.git</developerConnection>
20+
<url>scm:git:https://github.com/cityehr/cityehr-documentation.git</url>
21+
</scm>
22+
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>org.codehaus.mojo</groupId>
27+
<artifactId>xml-maven-plugin</artifactId>
28+
<executions>
29+
<execution>
30+
<id>validate-xslt</id>
31+
<phase>validate</phase>
32+
<goals>
33+
<goal>validate</goal>
34+
</goals>
35+
<configuration>
36+
<catalogHandling>strict</catalogHandling>
37+
<catalogs>
38+
<catalog>${common.catalog.path}</catalog>
39+
</catalogs>
40+
<validationSets>
41+
<validationSet>
42+
<schemaLanguage>http://www.w3.org/2001/XMLSchema</schemaLanguage>
43+
<publicId>http://www.w3.org/1999/XSL/Transform</publicId>
44+
<dir>src/main/xslt</dir>
45+
<includes>
46+
<include>*.xslt</include>
47+
</includes>
48+
</validationSet>
49+
</validationSets>
50+
</configuration>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
55+
<plugin>
56+
<groupId>io.xspec.maven</groupId>
57+
<artifactId>xspec-maven-plugin</artifactId>
58+
<version>2.2.0</version>
59+
<dependencies>
60+
<dependency>
61+
<groupId>net.sf.saxon</groupId>
62+
<artifactId>Saxon-HE</artifactId>
63+
<!-- Not yet compatible with Saxon 12, see: https://github.com/xspec/xspec-maven-plugin-1/issues/79 -->
64+
<version>10.9</version>
65+
</dependency>
66+
<dependency>
67+
<!-- Not yet compatible with XSpec 3, see: https://github.com/xspec/xspec-maven-plugin-1/issues/79 -->
68+
<groupId>io.xspec</groupId>
69+
<artifactId>xspec</artifactId>
70+
<version>2.3.2</version>
71+
</dependency>
72+
<dependency>
73+
<!-- See: https://github.com/xspec/xspec-maven-plugin-1/issues/73 -->
74+
<groupId>commons-io</groupId>
75+
<artifactId>commons-io</artifactId>
76+
<version>2.11.0</version>
77+
</dependency>
78+
</dependencies>
79+
<executions>
80+
<execution>
81+
<id>xspec-tests</id>
82+
<phase>test</phase>
83+
<goals><goal>run-xspec</goal></goals>
84+
</execution>
85+
</executions>
86+
</plugin>
87+
88+
</plugins>
89+
</build>
90+
91+
</project>

cityehr-quick-start-guide/src/main/xslt/common-pdf.xslt renamed to cityehr-documentation-common/src/main/xslt/common-pdf.xslt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
</fo:static-content>
123123
<fo:flow flow-name="xsl-region-body" hyphenate="true">
124124
<fo:block text-align="center" margin-top="20pt">
125-
<fo:external-graphic src="{com:abs-uri(., 'images/cityehr-logo.png')}" content-height="scale-to-fit" content-width="scale-to-fit" width="100%" scaling="uniform"/>
125+
<fo:external-graphic src="{com:abs-uri(., com:image-path($images-basedir, 'cityehr-logo.png'))}" content-height="scale-to-fit" content-width="scale-to-fit" width="100%" scaling="uniform"/>
126126
</fo:block>
127127
<fo:block background-color="#A42420" color="#FFFFFF" text-align="right" display-align="center" margin-top="200pt" padding-top="7pt" padding-right="7pt" padding-bottom="7pt">
128128
<fo:block font-size="14pt"><xsl:value-of select="$title"/></fo:block>

cityehr-quick-start-guide/src/main/xslt/common.xslt renamed to cityehr-documentation-common/src/main/xslt/common.xslt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,29 @@
4545
</xsl:function>
4646

4747
<!--
48-
Given a node as context and a reletaive HREF, create an absolute URI.
48+
Given a node as context and a relative HREF, create an absolute URI.
4949
-->
5050
<xsl:function name="com:abs-uri" as="xs:string">
5151
<xsl:param name="context" as="node()" required="yes"/>
5252
<xsl:param name="rel-href" as="xs:string" required="yes"/>
53-
<xsl:sequence select="concat(com:parent-path(com:document-uri($context)), '/', $rel-href)"/>
53+
<xsl:choose>
54+
<xsl:when test="starts-with($rel-href, '/')">
55+
<!-- path is already absolute local Unix file path -->
56+
<xsl:sequence select="concat('file:', $rel-href)"/>
57+
</xsl:when>
58+
<xsl:when test="matches($rel-href, '[A-Z]:\\')">
59+
<!-- path is already absolute local Windows file path -->
60+
<xsl:sequence select="concat('file:/', replace($rel-href, '\', '/'))"/>
61+
</xsl:when>
62+
<xsl:when test="starts-with($rel-href, 'file:/') or starts-with($rel-href, 'http:/') or starts-with($rel-href, 'https:/')">
63+
<!-- path is already absolute -->
64+
<xsl:sequence select="$rel-href"/>
65+
</xsl:when>
66+
<xsl:otherwise>
67+
<!-- path is relative, let's make it absolute -->
68+
<xsl:sequence select="concat(com:parent-path(com:document-uri($context)), '/', $rel-href)"/>
69+
</xsl:otherwise>
70+
</xsl:choose>
5471
</xsl:function>
5572

5673
<!-- Get the topic by loading the topic from a topicref -->
@@ -67,4 +84,11 @@
6784
<xsl:sequence select="com:get-topic($context, $topicref)/title"/>
6885
</xsl:function>
6986

87+
<!-- Create an image file path from a basedir and filename -->
88+
<xsl:function name="com:image-path" as="xs:string">
89+
<xsl:param name="images-basedir" as="xs:string"/>
90+
<xsl:param name="image-filename" as="xs:string" required="yes"/>
91+
<xsl:sequence select="concat(($images-basedir, 'images')[1], '/', $image-filename)"/>
92+
</xsl:function>
93+
7094
</xsl:stylesheet>

cityehr-quick-start-guide/src/main/xslt/create-map-pdf.xslt renamed to cityehr-documentation-common/src/main/xslt/create-map-pdf.xslt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
<!-- PARAMETER - the revision date and time of the generated document -->
2727
<xsl:param name="revision" required="no" as="xs:dateTime" select="current-dateTime()"/>
28+
29+
<!-- PARAMETER - the basedir for image files included in the FO -->
30+
<xsl:param name="images-basedir" required="no" as="xs:string"/>
2831

2932
<xsl:variable name="authors" as="xs:string+" select="('John Chelsom', 'Stephanie Cabrera', 'Catriona Hopper', 'Jennifer Ramirez')"/>
3033

@@ -51,7 +54,7 @@
5154
<xsl:template match="/map/topicmeta" mode="cover-page-footer">
5255
<fo:block-container position="absolute">
5356
<fo:block>
54-
<fo:basic-link external-destination="{othermeta[@name eq 'dcterms:license'][2]/@content}"><fo:external-graphic src="{com:abs-uri(., 'images/by-nc-sa.png')}"/></fo:basic-link>
57+
<fo:basic-link external-destination="{othermeta[@name eq 'dcterms:license'][2]/@content}"><fo:external-graphic src="{com:abs-uri(., com:image-path($images-basedir, 'by-nc-sa.png'))}"/></fo:basic-link>
5558
</fo:block>
5659
</fo:block-container>
5760
<fo:block-container position="absolute" margin-left="110pt" display-align="after" font-size="8pt">

cityehr-quick-start-guide/src/main/xslt/create-topic-pdf.xslt renamed to cityehr-documentation-common/src/main/xslt/create-topic-pdf.xslt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131

132132
<xsl:template match="image" mode="body">
133133
<fo:block>
134-
<fo:external-graphic src="{com:abs-uri(., @href)}" width="100%" content-height="100%" content-width="scale-to-fit" scaling="uniform"/>
134+
<fo:external-graphic src="{com:abs-uri(., com:image-path($images-basedir, com:filename(@href)))}" width="100%" content-height="100%" content-width="scale-to-fit" scaling="uniform"/>
135135
<xsl:apply-templates select="alt" mode="body"/>
136136
</fo:block>
137137
</xsl:template>

cityehr-documentation-parent/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@
6767
<properties>
6868
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6969
<saxon.version>12.5</saxon.version>
70+
71+
<common.catalog.path>${project.basedir}/../cityehr-documentation-common/src/main/catalog/catalog.xml</common.catalog.path>
72+
73+
<common.xslt.path>${project.basedir}/../cityehr-documentation-common/src/main/xslt</common.xslt.path>
74+
<common.create-map-pdf.xslt.path>${common.xslt.path}/create-map-pdf.xslt</common.create-map-pdf.xslt.path>
75+
<common.create-map-html.xslt.path>${common.xslt.path}/create-map-html.xslt</common.create-map-html.xslt.path>
76+
77+
<common.images.path>${project.basedir}/../cityehr-documentation-common/src/main/images</common.images.path>
7078
</properties>
7179

7280
<build>

cityehr-documentation-website/pom.xml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>com.seveninformatics.cityehr.documentation</groupId>
6+
<artifactId>cityehr-documentation-parent</artifactId>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<relativePath>../cityehr-documentation-parent</relativePath>
9+
</parent>
10+
11+
<artifactId>cityehr-documentation-website</artifactId>
12+
<packaging>pom</packaging>
13+
14+
<name>cityEHR Documentation Website</name>
15+
<description>Website for cityEHR documentation projects</description>
16+
17+
<scm>
18+
<connection>scm:git:https://github.com/cityehr/cityehr-documentation.git</connection>
19+
<developerConnection>scm:git:https://github.com/cityehr/cityehr-documentation.git</developerConnection>
20+
<url>scm:git:https://github.com/cityehr/cityehr-documentation.git</url>
21+
</scm>
22+
23+
<properties>
24+
<website.output.folder>${project.build.directory}/website</website.output.folder>
25+
</properties>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>${project.groupId}</groupId>
30+
<artifactId>cityehr-documentation-common</artifactId>
31+
<version>${project.version}</version>
32+
<type>pom</type>
33+
</dependency>
34+
<dependency>
35+
<groupId>${project.groupId}</groupId>
36+
<artifactId>cityehr-quick-start-guide</artifactId>
37+
<version>${project.version}</version>
38+
<type>pom</type>
39+
</dependency>
40+
<dependency>
41+
<groupId>${project.groupId}</groupId>
42+
<artifactId>cityehr-modelling-guide</artifactId>
43+
<version>${project.version}</version>
44+
<type>pom</type>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<resources>
50+
<resource>
51+
<directory>src/main/website</directory>
52+
<filtering>true</filtering>
53+
</resource>
54+
</resources>
55+
56+
<plugins>
57+
<plugin>
58+
<groupId>org.apache.maven.plugins</groupId>
59+
<artifactId>maven-resources-plugin</artifactId>
60+
<executions>
61+
<execution>
62+
<phase>process-resources</phase>
63+
<goals>
64+
<goal>resources</goal>
65+
</goals>
66+
</execution>
67+
68+
<execution>
69+
<id>copy-html</id>
70+
<phase>package</phase>
71+
<goals>
72+
<goal>copy-resources</goal>
73+
</goals>
74+
<configuration>
75+
<outputDirectory>${website.output.folder}</outputDirectory>
76+
<resources>
77+
<resource>
78+
<directory>${project.build.outputDirectory}</directory>
79+
<filtering>false</filtering>
80+
</resource>
81+
</resources>
82+
</configuration>
83+
</execution>
84+
85+
<execution>
86+
<id>copy-common-images</id>
87+
<phase>package</phase>
88+
<goals>
89+
<goal>copy-resources</goal>
90+
</goals>
91+
<configuration>
92+
<outputDirectory>${website.output.folder}/images</outputDirectory>
93+
<resources>
94+
<resource>
95+
<directory>${common.images.path}</directory>
96+
<filtering>false</filtering>
97+
</resource>
98+
</resources>
99+
</configuration>
100+
</execution>
101+
102+
<execution>
103+
<id>copy-modelling-guide</id>
104+
<phase>package</phase>
105+
<goals>
106+
<goal>copy-resources</goal>
107+
</goals>
108+
<configuration>
109+
<outputDirectory>${website.output.folder}/modelling-guide</outputDirectory>
110+
<resources>
111+
<resource>
112+
<directory>${project.basedir}/../cityehr-modelling-guide/target/website</directory>
113+
<filtering>false</filtering>
114+
</resource>
115+
</resources>
116+
</configuration>
117+
</execution>
118+
119+
<execution>
120+
<id>copy-quick-start-guide</id>
121+
<phase>package</phase>
122+
<goals>
123+
<goal>copy-resources</goal>
124+
</goals>
125+
<configuration>
126+
<outputDirectory>${website.output.folder}/quick-start-guide</outputDirectory>
127+
<resources>
128+
<resource>
129+
<directory>${project.basedir}/../cityehr-quick-start-guide/target/website</directory>
130+
<filtering>false</filtering>
131+
</resource>
132+
</resources>
133+
</configuration>
134+
</execution>
135+
136+
</executions>
137+
</plugin>
138+
</plugins>
139+
</build>
140+
141+
142+
</project>

0 commit comments

Comments
 (0)