Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx Website #1624

Merged
merged 101 commits into from
Jan 20, 2023
Merged

Sphinx Website #1624

merged 101 commits into from
Jan 20, 2023

Conversation

manticore-projects
Copy link
Contributor

Summary

Add a HTML5 Website based on Sphinx:

a) scales on devices (from mobile phone to very large screens)
b) theme-able (shown is a modified theme based on Read The Docs, being cleaner and scaling on large screens much better, landing page added)
c) CSS customizable (you can change the Accent Colours)
d) integrated search function
e) please adjust/change the icons according to your needs

Integrate the Sphinx Website into the Gradle Build:

d) derive the actual Version Number (Release and Snapshot) from the GIT Tags
e) generate a clean Changelog from GIT (template can be customized)
f) update all Version references (Maven Artifact, Downloads etc) automatically

Add some content:
g) explain the Contribution process
h) link to JSQLFormatter online for Statement Testing and Visualisation
i) add the Railroad Diagrams explaining the syntax (but without Reserved Keywords yet)

Added Object Tree Visualization tools, which will generate a TreeNode based tree structure explaining the parsed java Object Tree.

select 1 from dual where a=b;
SQL Text
  └─Statements: net.sf.jsqlparser.statement.select.Select
     └─selectBody: net.sf.jsqlparser.statement.select.PlainSelect
        ├─selectItems -> Collection<SelectExpressionItem>
        │  └─selectItems: net.sf.jsqlparser.statement.select.SelectExpressionItem
        │     └─LongValue: 1
        ├─Table: dual
        └─where: net.sf.jsqlparser.expression.operators.relational.EqualsTo
           ├─Column: a
           └─Column: b

Build Instructions

  1. you will need Python Sphinx and GIT installed
  2. build the website via gradle sphinx
  3. optionally, place the Sphinx HTML theme into the _themes folder and/or provide a custom.css file

Preview

Live preview: http://manticore-projects.com/JSQLParser/index.html

Static preview image:
image

Static preview package:
sphinx.zip

Attention

It has been built upon the Keywords PR, mainly because of the build infrastructure and the keywords documentation.
So the Keywords PR is included and need to be accepted first (or dropped altogether in favor of this Sphinx PR).

Add Keywords and document, which keywords are allowed for what purpose
Derive All Keywords from Grammar directly
Generate production for Object Names (semi-) automatically
Add parametrized Keyword Tests
Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10
Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10
# Conflicts:
#	src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Update keywords
# Conflicts:
#	build.gradle
@manticore-projects
Copy link
Contributor Author

I have added a Github Action, that builds the Website on Commit to Master and deploys the static Site to GH Pages.

Demo: https://manticore-projects.github.io/JSqlParser/

Parse Tokens via Regex
Move JavaCC Token Parser into the KeywordsTest
Make JavaCC a Test Dependency only
@@ -0,0 +1,29 @@
name: Sphinx Pages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. And using this the sphinx sources somewhere within the master branch are generated and published to Github pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.

@@ -10,14 +10,15 @@

package net.sf.jsqlparser.expression;

import java.io.Serializable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all these implements Serializable stuff?

@manticore-projects
Copy link
Contributor Author

manticore-projects commented Dec 22, 2022 via email

@manticore-projects
Copy link
Contributor Author

Please also disable CSS in Codacy. Thanks.

Kind reminder, since I am not allowed to do that by myself unfortunately.

@wumpz
Copy link
Member

wumpz commented Dec 27, 2022

Disabled CSSLint, StyleLint in Codacy.

@manticore-projects
Copy link
Contributor Author

Disabled CSSLint, StyleLint in Codacy.

Thanks. Will you accept the PR or do you expect me to push/update and rerun the Codacy CI-Tests before?

@wumpz
Copy link
Member

wumpz commented Dec 27, 2022

The tree viewer, i need to serialize the objects first into xml before
applying xpath and deserialize.

Where is this xpath parser implemented? I did not find it at first glance. You know this serialization stuff is somehow deprecated: https://www.securityinfowatch.com/cybersecurity/information-security/article/12420169/oracle-plans-to-end-java-serialization-but-thats-not-the-end-of-the-story. I would like to find another way.

To make things easier I could make node generation for every production a default. Since performance is not that important anymore. I measured a decrease of 20% for queries.

@manticore-projects
Copy link
Contributor Author

Where is this xpath parser implemented?

Separately, in JSQLFormatter only.

I did not find it at first glance. You know this serialization stuff is somehow deprecated: https://www.securityinfowatch.com/cybersecurity/information-security/article/12420169/oracle-plans-to-end-java-serialization-but-thats-not-the-end-of-the-story. I would like to find another way.

There are other ways like Jackson, however that would introduce Third Party dependencies because they all rely on a kind of annotation and implementation of Serializers and De-Serializers.

In your own link its written, that "Oracle plans ..." since 2018 and nothing has happened since. Even if anything happens, it would depend on Java 19 plus while we still (want to) maintain Java 8 compliance for a good reason.

Companies still run JRE/JDK 8 and won't upgrade.

Last but not least, I think some Serializable Objects were there already, I just added a few more but did not introduce anything unheard of before.

image

@wumpz
Copy link
Member

wumpz commented Dec 27, 2022

Fair point.

@wumpz
Copy link
Member

wumpz commented Dec 27, 2022

Could you check this Codacy checks again (making a commit). Codacy somehow does not to allow me to reevaluate specific commits again.

@manticore-projects
Copy link
Contributor Author

Pew, finally!

- apply neutral Sphinx theme
- insert the RR diagrams into the sphinx sources
- better documentation on Gradle dependencies
- link GitHub repository
@manticore-projects
Copy link
Contributor Author

manticore-projects commented Jan 7, 2023

Integrate the RR diagram into the website.
Applied a neutral Sphinx theme.

Preview: https://manticore-projects.github.io/JSqlParser/syntax.html

Besser als das wird es nicht!
Btw, die Aenderung der Versions Nummer in der Readme koennten wir uns sparen mit der WebSite, welche die Versionierung automatisch verfolgt.

@wumpz
Copy link
Member

wumpz commented Jan 12, 2023

So this is ready to be merged?

@manticore-projects
Copy link
Contributor Author

So this is ready to be merged?

yes, Sir.

@wumpz wumpz merged commit be8e7a8 into JSQLParser:master Jan 20, 2023
@manticore-projects manticore-projects deleted the sphinx branch March 7, 2023 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants