Skip to content

Commit

Permalink
improve site documentation
Browse files Browse the repository at this point in the history
make the allnav.yml file appear in the site dir rather than at top level
  • Loading branch information
pahjbo committed Jun 27, 2024
1 parent 556d721 commit da4d6ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import javax.inject.Inject
allnav.add(json)
}
val outmapper = ObjectMapper(YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER))
outmapper.writeValue(File("allnav.yml"), allnav)
outmapper.writeValue(docDir.file("allnav.yml").get().asFile, allnav)


}
Expand Down
21 changes: 15 additions & 6 deletions tools/xslt/vo-dml2md.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ The whole model is represented in a model diagram below

</xsl:if>

<xsl:if test="//package">
## Packages

<xsl:for-each select="//package"> <!-- FIXME does not do nested packages nicely -->
<xsl:sort select="name"/>
* <xsl:value-of select="concat('*',name,'*')"/> <xsl:apply-templates select="description"/>
</xsl:for-each>
</xsl:if>

<xsl:if test="//primitiveType">
## Primitives

Expand Down Expand Up @@ -161,7 +170,7 @@ The whole model is represented in a model diagram below
"ObjectTypes": [

<xsl:for-each select="//objectType">
<xsl:sort select="name"/>
<xsl:sort select="vf:asvodmlref(current())"/>
<xsl:call-template name="jsonNav"/>
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
Expand All @@ -172,7 +181,7 @@ The whole model is represented in a model diagram below
,{
"DataTypes": [
<xsl:for-each select="//dataType">
<xsl:sort select="name"/>
<xsl:sort select="vf:asvodmlref(current())"/>
<xsl:call-template name="jsonNav"/>
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
Expand All @@ -183,7 +192,7 @@ The whole model is represented in a model diagram below
,{
"PrimitiveTypes": [
<xsl:for-each select="//primitiveType">
<xsl:sort select="name"/>
<xsl:sort select="vf:asvodmlref(current())"/>
<xsl:call-template name="jsonNav"/>
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
Expand All @@ -194,7 +203,7 @@ The whole model is represented in a model diagram below
,{
"Enumerations": [
<xsl:for-each select="//enumeration">
<xsl:sort select="name"/>
<xsl:sort select="vf:asvodmlref(current())"/>
<xsl:if test="position() != 1">,</xsl:if>
<xsl:call-template name="jsonNav"/>
</xsl:for-each>
Expand All @@ -219,7 +228,7 @@ The whole model is represented in a model diagram below
<xsl:template match="package">
<xsl:variable name="vodml-id" select="tokenize(vf:asvodmlref(current()),':')" as="xsd:string*"/>
<xsl:variable name="hr" select="concat($vodml-id[1],'/',$vodml-id[2],'.md')"/>
<xsl:message>writing description to <xsl:value-of select="$hr"/></xsl:message>
<xsl:message>writing description to <xsl:value-of select="$hr"/></xsl:message><!-- TODO this package file itself not linked in final docs - is it useful? -->
<xsl:result-document method="text" encoding="UTF-8" indent="no" href="{$hr}">
<xsl:apply-templates select="current()" mode="desc"/>
</xsl:result-document>
Expand Down Expand Up @@ -306,7 +315,7 @@ Has contained reference(s) <xsl:value-of select="string-join(for $i in vf:contai
</xsl:template>

<xsl:template match="description">
<xsl:if test="not(matches(text(),'^\s*TODO'))"><xsl:value-of select='.'/></xsl:if><xsl:text></xsl:text>
<xsl:if test="not(matches(text(),'^\s*TODO'))"><xsl:value-of select='normalize-space(.)'/></xsl:if><xsl:text></xsl:text>
</xsl:template>

<xsl:template match="enumeration|dataType|objectType" mode="mermdiag">
Expand Down

0 comments on commit da4d6ad

Please sign in to comment.