Skip to content

Commit

Permalink
doc: many website cosmetics about Release vs. Snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
manticore-projects committed Sep 2, 2023
1 parent eb3a6cb commit e428c7f
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 15,115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run build with Gradle Wrapper
run: gradle --no-build-cache clean xmldoc sphinx
run: FLOATING_TOC=false gradle --no-build-cache clean xmldoc sphinx
- name: Deploy
uses: actions/configure-pages@v2
- name: Upload artifact
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/src/site/sphinx/changelog.rst
/src/site/sphinx/javadoc_stable.rst
/src/site/sphinx/syntax_stable.rst
/src/site/sphinx/javadoc_snapshot.rst
/src/site/sphinx/syntax_snapshot.rst

# Generated by javacc-maven-plugin
/bin
Expand All @@ -29,5 +31,3 @@
/nbproject/

/.gradle
/src/site/sphinx/javadoc_snapshot.rst
/src/site/sphinx/syntax_snapshot.rst
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def getVersion = { boolean considerSnapshot ->
? "${major}.${minor}.${patch}${snapshot}"
: "${major}.${minor}${snapshot}"
}
version = getVersion(true)

// for publishing a release, call Gradle with Environment Variable RELEASE:
// RELEASE=true gradle JSQLParser:publish
version = getVersion( !System.getenv("RELEASE") )
group = 'com.github.jsqlparser'
description = 'JSQLParser library'
archivesBaseName = "JSQLParser"
Expand Down Expand Up @@ -431,6 +434,11 @@ xslt {
dependsOn(renderRR)
stylesheet 'src/main/resources/rr/xhtml2rst.xsl'

parameters (
"withFloatingToc": System.getenv().getOrDefault("FLOATING_TOC", "true"),
"isSnapshot": Boolean.toString(version.endsWith("-SNAPSHOT"))
)

// Transform every .xml file in the "input" directory.
input "$buildDir/rr/JSqlParserCC.xhtml"
output outFile
Expand Down Expand Up @@ -571,7 +579,6 @@ remotes {
}

tasks.register('upload') {
dependsOn(check, assemble, gitChangelogTask, renderRR, xslt, updateKeywords, xmldoc)
doFirst {
if (findProperty("${project.name}.host") == null) {
println(
Expand All @@ -594,4 +601,5 @@ tasks.register('upload') {
}
}
}
upload.dependsOn(check, assemble, gitChangelogTask, renderRR, xslt, updateKeywords, xmldoc)

21 changes: 16 additions & 5 deletions src/main/resources/rr/xhtml2rst.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
omit-xml-declaration="yes"
indent="no" />

<xsl:param name="withFloatingToc" select="'true'" />
<xsl:param name="withFloatingToc" select="'false'" />
<xsl:param name="isSnapshot" select="'false'" />

<!-- a default catch is needed to suppress all unwanted nodes -->
<xsl:template match="*">
<xsl:text disable-output-escaping="yes">
<xsl:choose>
<xsl:when test="$withFloatingToc='true'">
<xsl:text disable-output-escaping="yes">
.. raw:: html

&lt;div id="floating-toc"&gt;
Expand All @@ -36,18 +39,26 @@
&lt;ul id="toc-list"&gt;&lt;/ul&gt;
&lt;/div&gt;


</xsl:text>
</xsl:when>
</xsl:choose>

<xsl:apply-templates select="/xhtml:html/xhtml:body"/>
</xsl:template>

<xsl:template match="/xhtml:html/xhtml:body">
<xsl:text disable-output-escaping="yes">
*********************************************************************
SQL Syntax |JSQLPARSER_SNAPSHOT_VERSION|
SQL Syntax JSQLParser-</xsl:text><xsl:choose>
<xsl:when test="$isSnapshot='true'"><xsl:text>|JSQLPARSER_SNAPSHOT_VERSION|</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>|JSQLPARSER_VERSION|</xsl:text></xsl:otherwise>
</xsl:choose><xsl:text>
*********************************************************************

The EBNF and Railroad Diagrams for JSQLParser-|JSQLPARSER_VERSION|.
The EBNF and Railroad Diagrams for JSQLParser-</xsl:text><xsl:choose>
<xsl:when test="$isSnapshot='true'"><xsl:text>|JSQLPARSER_SNAPSHOT_VERSION|</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>|JSQLPARSER_VERSION|</xsl:text></xsl:otherwise>
</xsl:choose><xsl:text>.

</xsl:text>
<xsl:apply-templates select="svg:svg"/>
Expand Down
Loading

0 comments on commit e428c7f

Please sign in to comment.