diff --git a/.gitignore b/.gitignore index 37714aab0..4f8a95ce3 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,4 @@ buildNumber.properties # End of https://www.gitignore.io/api/java,maven,eclipse /.apt_generated/ +/fj-doc-playground-quarkus/src/main/react/public/help/ diff --git a/fj-doc-playground-quarkus/pom.xml b/fj-doc-playground-quarkus/pom.xml index ff5c2a5aa..a95cf65d3 100644 --- a/fj-doc-playground-quarkus/pom.xml +++ b/fj-doc-playground-quarkus/pom.xml @@ -301,15 +301,161 @@ - buildreact + + + 3.1.1 + 2.3.19 + 3.0.0 + 2.3.1 + 1.2024.5 + 1.0.3 + 9.4.9.0 + yyyy-MM-dd'T'HH:mm:ss'Z' + ${project.basedir}/src/main/react/public/help + ${html-output-folder-no-toc} + + + + org.asciidoctor + asciidoctor-maven-plugin + ${asciidoctor.maven.plugin.version} + + + org.asciidoctor + asciidoctorj-pdf + ${asciidoctorj.pdf.version} + + + + org.jruby + jruby + ${jruby.version} + + + + org.asciidoctor + asciidoctorj + ${asciidoctorj.version} + + + org.asciidoctor + asciidoctorj-diagram + ${asciidoctorj.diagram.version} + + + org.asciidoctor + asciidoctorj-diagram-plantuml + ${asciidoctorj.diagram-plantuml.version} + + + org.asciidoctor + asciidoctorj-diagram-ditaamini + ${asciidoctorj.diagram-ditaamini.version} + + + + + asciidoctor-diagram + + + + src/main/docs/asciidoc + + resources/themes/** + + + + src/main/docs/asciidoc + true + + true + + + + warn + true + rouge + ./resources/images + ./resources/themes + ${project.version} + ${maven.build.timestamp} + Digital Version + ${project.organization.name} + + + + + asciidoc-to-pdf + generate-resources + + process-asciidoc + + + pdf + book + index.adoc + ${pdf-output-folder} + ${project.artifactId}.pdf + + basic + ${project.basedir}/src/main/docs/asciidoc/resources/themes + font + + + + - + + + + + asciidoc-to-html + generate-resources + + process-asciidoc + + + + asciidoc-to-html-no-toc + generate-resources + + process-asciidoc + + + html5 + ${html-output-folder-no-toc} + + + src/main/docs/asciidoc/features/ + + resources/themes/** + + + + src/main/docs/asciidoc/features/ + + rouge + resources/images + font + + true + + + - + true + + + + + + org.codehaus.mojo exec-maven-plugin diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-common.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-common.adoc new file mode 100644 index 000000000..cbbd4c101 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-common.adoc @@ -0,0 +1,14 @@ +:author: Matteo Franci +:revnumber: v1.0.0 +:revdate: October 15, 2024 +:email: m@fugerit.org +:description: Venus Online Playground Guide +:keywords: java, xml, json, yaml, kotlin, pdf, html, xlsx, csv, document generation +:encoding: utf-8 +:lang: en +:toc: left +:hardbreaks-option: +:sectnums: +:sectnumlevels: 3 +:!figure-caption: +:!chapter-signifier: diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-pdf.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-pdf.adoc new file mode 100644 index 000000000..5fb83ce18 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/attributes/_attributes-pdf.adoc @@ -0,0 +1 @@ +:doctype: book diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-config-convert.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-config-convert.adoc new file mode 100644 index 000000000..27cd42ecc --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-config-convert.adoc @@ -0,0 +1,90 @@ + +<<< +[#doc-playground-config-convert] +== Doc Config Conversion tool + +link:https://github.com/fugerit-org/fj-doc[Venus Project] use to have a different configuration setup in teh past +(previous to version 1.3). + +This configuration is still supported, but it's now considered legacy. The *Doc Config Conversion tool* helps to convert the old configuration model to the new one. + +The old configuration model, consisted of two different XML files : + +=== 1. Doc Process Config File + +It starts with __ element and looks like : + +[source,xml] +---- + + + + + + + + +---- + +=== 2. Doc Handler Config file + +[source,xml] +---- + + + + + + + + +---- + +The Doc Configuration conversion tool, accept as input the *Doc Process Config* XML file in the first text area, and some parameters in the second text area, like: + +[source,text] +---- +# if stub handers=1, sample type handler configuration will be created +stub-handler=1 +# docHandlerConfig attributes values +registerById=true +allowDuplicatedId=true +---- + +The result will be something like : + +[source,xml] +---- + + + + + + + + + + + + + + + + + + + + + + + + +---- \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-conversion.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-conversion.adoc new file mode 100644 index 000000000..c2b53df05 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-conversion.adoc @@ -0,0 +1,10 @@ + +<<< +[#doc-playground-conversion] +== Doc Conversion (XML/JSON/YAML) + +This page allow conversion from/to XML/JSON/YAML format. + +It also allows pretty print. + +For istance it is possible to indent XML or JSON format. \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-generator.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-generator.adoc new file mode 100644 index 000000000..3bf59a61f --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-generator.adoc @@ -0,0 +1,38 @@ + +<<< +[#doc-playground-generator] +== Doc Editor and Generator + +This tool is the core of the application. It gives you the change to really test the link:https://github.com/fugerit-org/fj-doc[Venus Document Generation Framework]. + +=== 1. Pick a source type + +You can pick 5 source options (when choosing one the _Document samples catalog_ will automatically update with relevant examples) : + +. link:https://venusdocs.fugerit.org/guide/#doc-freemarker-entry-point[FTLX] - FreeMarker template XML _(*)_ +. link:https://venusdocs.fugerit.org/guide/#doc-format-entry-point-xml[XML] +. link:https://venusdocs.fugerit.org/guide/#doc-format-entry-point-json-yaml[JSON] +. link:https://venusdocs.fugerit.org/guide/#doc-format-entry-point-json-yaml[YAML] +. link:https://venusdocs.fugerit.org/guide/#doc-format-entry-point-kotlin[KTS] +(Kotlin) + +NOTE: _(*)_ Using a freemarker template to generate a link:https://venusdocs.fugerit.org/guide/#doc-format-entry-point[DOC XML Format] is the best supported scenario. Other input options are mainly for people not familiar with XML or Apache FreeMarker. + +=== 2. Pick an output format + +You can choose among multiple output format. Each based on a specific link:https://venusdocs.fugerit.org/guide/#doc-handler-module-handlers[Doc Handler]. + + +=== 3. Customize the input + +Creato or modify input source. (For FTLX and KTS add JSON data model if you want). + +=== 4. Generate document + +Click on the *Generate document*, usually preview or download options will be available. + +In case of error, a message will be shown. + +=== Extra : Validate document + +XML, JSON and YAML document support the _Validate document_ function. \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-project-init.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-project-init.adoc new file mode 100644 index 000000000..55c71be94 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-project-init.adoc @@ -0,0 +1,22 @@ + +<<< +[#doc-playground-project-init] +== Doc Project Initialization + +This function is user interface for the link:https://venusdocs.fugerit.org/guide/#maven-plugin-goal-init[Venus Maven Plugin : Init Goal]. + +For instance selecting : + +- *Group ID* : org.example.demo +- *Artifact ID* : venus-demo +- *Project Version* : 1.0.0 +- *Java Version* : 17 +- *Venus Version* : 8.11.2 +- *Flavour* : Quarkus 3 +- *Extensions* : fj-doc-base,fj-doc-freemarker,fj-doc-mod-fop (1) + +Will creates a new link:https://quarkus.io/[Quarkus 3] project with support and examples to generate documents in MarkDown, HTML, AsciiDOC, XSL-FO and PDF. + +The project will be a single zip containing a maven project and all the needed resource with a proof of concept document generation. (in a similar way to link:https://start.spring.io/[Spring Initializr] or link:https://code.quarkus.io/[Quarkus Project Launcher]). + +(1) Check the documentation to know which formats are supported by each link:https://venusdocs.fugerit.org/guide/#doc-handler-module-handlers[module]. diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-type-validator.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-type-validator.adoc new file mode 100644 index 000000000..f4eea2dbc --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/doc-type-validator.adoc @@ -0,0 +1,11 @@ + +<<< +[#doc-playground-type-validator] +== Doc Type Validator + +The Doc Type Validator helper, is a simple interface to test the +link:https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-val[Doc Type Validator modules]. + +Simply upload a file (on the left) to check if it is valid according to one of the supported formats (on the right). + +NOTE: This is just a demo version. Currently really useful for any real scenario. \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/home.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/home.adoc new file mode 100644 index 000000000..ff48e1474 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/features/home.adoc @@ -0,0 +1,10 @@ + +<<< +[#doc-playground-home] +== Playground for Venus - Fugerit Doc Generation Framework + +This is the link:https://github.com/fugerit-org/fj-doc[Venus] Online Playground. + +It is possible to run it locally too using the pre-buildt link:https://hub.docker.com/r/fugeritorg/fj-doc-playground-quarkus[Docker images]. + +NOTE: for full documentation check the link:https://venusdocs.fugerit.org/guide/[online guide]. \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/index.adoc b/fj-doc-playground-quarkus/src/main/docs/asciidoc/index.adoc new file mode 100644 index 000000000..fba9a3c80 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/index.adoc @@ -0,0 +1,13 @@ += Fugerit Online Playground Guide +// format attributes inclusions +include::attributes/_attributes-pdf.adoc[] +include::attributes/_attributes-common.adoc[] + +// Chapters inclusions + +include::features/home.adoc[] + + +include::features/doc-type-validator.adoc[] + +include::features/doc-config-convert.adoc[] \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/images/readme.txt b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/images/readme.txt new file mode 100644 index 000000000..b27a99691 --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/images/readme.txt @@ -0,0 +1 @@ +images go here \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/basic-theme.yml b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/basic-theme.yml new file mode 100644 index 000000000..4c12d176c --- /dev/null +++ b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/basic-theme.yml @@ -0,0 +1,42 @@ +extends: + - default-with-fallback-font +cover: + front: + image: image:book_cover_basic_v1.0.0.jpeg[page=2] + back: + image: image:book_cover_back_basic_v1.0.0.png[fit=fill] +title-page: false +page: + margin: [ 0.75in, 0.75in, 0.75in, 0.75in ] +base: + line-height-length: 20 +heading: + font-color: #C50505 + font-size: 12 + line-height: 1.2 +link: + font-color: #0e86d8 +header: + height: 0.75in + line-height: 1 + recto: + right: + content: '{document-title} | v{revnumber}' + verso: + left: + content: '{document-title} | v{revnumber}' +footer: + height: 0.75in + line-height: 1 + recto: + right: + content: '{chapter-title} | *{page-number}*' + verso: + left: + content: '*{page-number}* | {chapter-title}' +image: + align: center +caption: + align: center + font-color: #C50505 + font-size: 10 \ No newline at end of file diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_back_basic_v1.0.0.png b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_back_basic_v1.0.0.png new file mode 100644 index 000000000..2272ec2e2 Binary files /dev/null and b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_back_basic_v1.0.0.png differ diff --git a/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_basic_v1.0.0.jpeg b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_basic_v1.0.0.jpeg new file mode 100644 index 000000000..3aedf62df Binary files /dev/null and b/fj-doc-playground-quarkus/src/main/docs/asciidoc/resources/themes/book_cover_basic_v1.0.0.jpeg differ diff --git a/fj-doc-playground-quarkus/src/main/react/src/App.jsx b/fj-doc-playground-quarkus/src/main/react/src/App.jsx index 48ab5356c..42b396cf2 100644 --- a/fj-doc-playground-quarkus/src/main/react/src/App.jsx +++ b/fj-doc-playground-quarkus/src/main/react/src/App.jsx @@ -12,7 +12,7 @@ const TITLE = 'Venus (fj-doc) playground'; function App() { - const [state, setState] = useState({ currentState: themes.at( 0 ).theme }); + const [state, setState] = useState({ currentState: themes.at( 2 ).theme }); return ( diff --git a/fj-doc-playground-quarkus/src/main/react/src/Playground.jsx b/fj-doc-playground-quarkus/src/main/react/src/Playground.jsx index 6153fca0a..1c4aa8c61 100644 --- a/fj-doc-playground-quarkus/src/main/react/src/Playground.jsx +++ b/fj-doc-playground-quarkus/src/main/react/src/Playground.jsx @@ -1,4 +1,5 @@ import React, { useState, Fragment } from 'react'; +import PageHelp from './common/PageHelp' import { BrowserRouter as Router, @@ -20,6 +21,9 @@ const homepage = '/fj-doc-playground/home'; const Playground = () => { + const [helpContent, setHelpContent] = useState('home'); + const [buttonText, setButtonText] = useState('?'); + const [dialogMessage, setDialogMessage] = useState(null) const handleCloseDialog = () => { @@ -46,10 +50,15 @@ const Playground = () => { - - - - + + + + + + + + + - +