[#6297] Add "development versions" link to the manual

This commit is contained in:
lukaseder 2017-06-01 13:30:54 +02:00
parent ec3e4127d2
commit 0fabb6591e
3 changed files with 93 additions and 63 deletions

View File

@ -82,36 +82,24 @@ function printContent() {
<!-- Version Jumpers -->
<div class="row col col-100 col-red">
<p>
This page in other versions:
<p>
<xsl:text>All versions: </xsl:text>
<xsl:for-each select="/manuals/manual">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
<xsl:apply-templates select="/manuals/manual[(@end-of-life = 'false' or not(@end-of-life)) and (@development = 'false' or not(@development))]" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
<xsl:variable name="position" select="position()"/>
<xsl:variable name="version" select="@version"/>
<xsl:variable name="manual" select="."/>
<xsl:text> | Development versions: </xsl:text>
<xsl:if test="$position > 1">
<xsl:text> | </xsl:text>
<xsl:if test="@end-of-life = 'true' and not(/manuals/manual[count(/manuals/manual) - $position + 2]/@end-of-life = 'true')">
<xsl:text> Old, end-of-life releases: </xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="/manuals/manual[@development = 'true']" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="@version != $minorVersion">
<a href="/doc/{@version}/manual-single-page">
<xsl:value-of select="@version"/>
</a>
</xsl:when>
<xsl:otherwise>
<strong style="font-size: 2em">
<xsl:value-of select="@version"/>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text> | Unsupported versions: </xsl:text>
<xsl:apply-templates select="/manuals/manual[@end-of-life = 'true']" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
</p>
</div>
@ -168,4 +156,29 @@ function printContent() {
<xsl:text>#</xsl:text>
<xsl:value-of select="@id"/>
</xsl:template>
<xsl:template match="manual" mode="version-links">
<xsl:variable name="position" select="position()"/>
<xsl:if test="$position > 1">
<xsl:text> | </xsl:text>
</xsl:if>
<xsl:apply-templates select="." mode="version-link"/>
</xsl:template>
<xsl:template match="manual" mode="version-link">
<xsl:choose>
<xsl:when test="@version != $minorVersion">
<a href="/doc/{@version}/manual-single-page">
<xsl:value-of select="@version"/>
</a>
</xsl:when>
<xsl:otherwise>
<strong style="font-size: 2em">
<xsl:value-of select="@version"/>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -131,45 +131,24 @@ function printContent() {
</div>
<div class="row col col-100 col-red">
<p>
This page in other versions:
<p>
<xsl:text>All versions: </xsl:text>
<xsl:for-each select="/manuals/manual[.//section[@id = $sectionID]]">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
<xsl:apply-templates select="/manuals/manual[.//section[@id = $sectionID]][(@end-of-life = 'false' or not(@end-of-life)) and (@development = 'false' or not(@development))]" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
<xsl:variable name="position" select="position()"/>
<xsl:variable name="version" select="@version"/>
<xsl:variable name="manual" select="."/>
<xsl:text> | Development versions: </xsl:text>
<xsl:if test="$position > 1">
<xsl:text> | </xsl:text>
<xsl:if test="@end-of-life = 'true' and not(/manuals/manual[count(/manuals/manual) - $position + 2]/@end-of-life = 'true')">
<xsl:text> Old, end-of-life releases: </xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="/manuals/manual[.//section[@id = $sectionID]][@development = 'true']" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="@version != $minorVersion">
<xsl:variable name="href">
<xsl:call-template name="replace">
<xsl:with-param name="text">
<xsl:apply-templates select="$manual//section[@id = $sectionID]" mode="href"/>
</xsl:with-param>
<xsl:with-param name="replace" select="$minorVersion"/>
<xsl:with-param name="by" select="$version"/>
</xsl:call-template>
</xsl:variable>
<a href="{$href}">
<xsl:value-of select="$version"/>
</a>
</xsl:when>
<xsl:otherwise>
<strong style="font-size: 2em">
<xsl:value-of select="$version"/>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text> | Unsupported versions: </xsl:text>
<xsl:apply-templates select="/manuals/manual[.//section[@id = $sectionID]][@end-of-life = 'true']" mode="version-links">
<xsl:sort select="str:replaceAll(string(@version), '^(\d)\.(\d)$', '$1.0$2')" order="descending"/>
</xsl:apply-templates>
</p>
</div>
@ -289,4 +268,41 @@ function printContent() {
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="manual" mode="version-links">
<xsl:variable name="position" select="position()"/>
<xsl:if test="$position > 1">
<xsl:text> | </xsl:text>
</xsl:if>
<xsl:apply-templates select="." mode="version-link"/>
</xsl:template>
<xsl:template match="manual" mode="version-link">
<xsl:variable name="manual" select="."/>
<xsl:choose>
<xsl:when test="@version != $minorVersion">
<xsl:variable name="href">
<xsl:call-template name="replace">
<xsl:with-param name="text">
<xsl:apply-templates select="$manual//section[@id = $sectionID]" mode="href"/>
</xsl:with-param>
<xsl:with-param name="replace" select="$minorVersion"/>
<xsl:with-param name="by" select="@version"/>
</xsl:call-template>
</xsl:variable>
<a href="{$href}">
<xsl:value-of select="@version"/>
</a>
</xsl:when>
<xsl:otherwise>
<strong style="font-size: 2em">
<xsl:value-of select="@version"/>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -39,7 +39,7 @@
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
-->
<manual version="3.10" end-of-life="false">
<manual version="3.10" end-of-life="false" development="true">
<section id="manual">
<title>The jOOQ User Manual. Multiple Pages</title>
<content><html>
@ -13626,7 +13626,8 @@ public class DeleteOrUpdateWithoutWhereException extends RuntimeException {}
try (Connection c = DSL.using(configuration).parsingConnection();
Statement s = c.createStatement();
// This syntax is not supported in Oracle, but thanks to the parser and jOOQ, it will run on Oracle and produce the expected result
// This syntax is not supported in Oracle, but thanks to the parser and jOOQ,
// it will run on Oracle and produce the expected result
ResultSet rs = s.executeQuery("SELECT * FROM (VALUES (1, 'a'), (2, 'b')) t(x, y)")) {
while (rs.next())