Venus - Fugerit Document Generation Framework (fj-doc)
Framework to produce documents in different output formats starting from an XML document metamodel. (options for json and yaml source models are also available)
The Core library (fj-doc-base) is all you need to start, even though typically you will use at least :
- fj-doc-base
- fj-doc-freemarker
- One or more type handlers modules
Quickstart
Build
Clone :
git clone https://github.com/fugerit-org/fj-doc
Full build is made by :
mvn clean install -P full,test
Run
The Fugerit Venus Doc project is a library for generating documents to be included.
The module fj-doc-playground-quarkus demonstrates some of the main features.
After building, it is possible to just run it by launching :
cd fj-doc-playground-quarkus
mvn compile quarkus:dev -P buildreact
Open : http://localhost:8080/fj-doc-playground/home/
NOTE : The playground demo single page application currently runs on node 20
Useful resources
- github pages documentation
- project home page
- docgen home
- release notes
- Doc XSD Configuration Reference
- freemarker-doc-process-config XSD Configuration Reference
- Venus Doc Meta Information reference
- Venus Guides
- Online playground
A quick start is available in module fj-doc-sample
Modules
There are five kinds of components (each components README.md contains module status) :
1. Framework core
- Core library (fj-doc-base) (contains a simple renderer for Markdown BASIC and Markdown EXT)
- Json extension (fj-doc-base-json) (allow using json as document generator instead of standard xml generator) [since 0.7.0]
- Yaml extension (fj-doc-base-yaml) (allow using yaml as document generator instead of standard xml generator) [since 0.7.0]
- Kotlin extension (fj-doc-base-kotlin) (allow kotlin script, KTS, as document generator instead of standard xml generator) [since 8.10.0]
- Doc format
2. Modules
- FreeMarker template, (fj-doc-freemarker) (contains a simple renderer for HTML and HTML FRAGMENT and ADOC )
- Apache POI Module (fj-doc-mod-poi) (XLS/XLSX)
- Apache FOP Module (fj-doc-mod-fop) (PDF/FO)
- OpenCSV Module (fj-doc-mod-opencsv) (CSV)
- OpenPDF EXT Module (fj-doc-mod-openpdf-ext) (PDF/HTML)
- OpenRTF EXT Module (fj-doc-mod-openrtf-ext) (RTF)
3. Available type handlers
- MD BASIC - (fj-doc-base) output as Markdown basic language
- MD EXT - (fj-doc-base) output as Markdown extended (include tables) language
- HTML - (fj-doc-freemarker) output as html
- HTML FRAGMENT - (fj-doc-freemarker) output as html body content only (no html, head or body tags)
- ADOC - (fj-doc-freemarker) output as asciidoc
- XLS - (fj-doc-mod-poi) output as Microsoft XLS using Apache POI
- XLSX - (fj-doc-mod-poi) output as Microsoft XLSX using Apache POI
- PDF - (fj-doc-mod-fop) - output as PDF using Apache FOP
- FO - (fj-doc-mod-fop) - output as FO using Apache FOP
- CSV - (fj-doc-mod-opencsv) - output as CSV using OpenCSV
- PDF - (fj-doc-mod-openpdf-ext) - output as PDF using OpenPDF
- HTML - (fj-doc-mod-openpdf-ext) - output as HTML using OpenPDF
- RTF - (fj-doc-mod-openrtf-ext) - output as RTF using OpenRTF
4. Bundled libraries
- Simple table (fj-doc-lib-singletable) - offers a simple API for creating a document made of a table.
- XSD Autodoc (fj-doc-lib-autodoc) - offers a simple api for documenting the Venus library (to a limited extent some features can be used on any xsd).
- Doc type validation (fj-doc-val) - simple utilities for validating file type.
- Kotlin utilities (fj-doc-lib-kotlin) - This library provides some helper for the kotlin language. The first one is a utility to generate a kotlin DSL mapping an XSD.
5. Tutorial
- Samples and Quickstart (fj-doc-sample)
- Playground (fj-doc-playground-quarkus) [since 0.7.0]
- Playground online version
6. Extension Type Handlers (Extension renders)
Basically the same as type handlers but based on libraries not available on Maven Repository Central (es. PDFLIB).
You can find in them in a dedicated repository fj-doc-ext
7. Incubator Type Handlers (Are too far from being complete)
- Apache PdfBox Renderer (PDF)(fj-doc-mod-pdfbox) (incubator since version 0.5.0)
8. Deprecated Type Handlers (Will not be maintained)
- JXL Renderer (XLS)(fj-doc-mod-jxl) (deprecated as jexcelapi is no longer maintained, may be used ‘AS IS’) (deprecated since version 0.5.0)
- Itext 2.X Renderer (PDF/RTF/HTML)(fj-doc-mod-jxl) (deprecated as IText 2.1.X is no longer maintained, may be used ‘AS IS’) (deprecated since version 0.5.0)
- Java EE extension (fj-doc-ent) (deprecated as not the module fj-mod-freemarker provided mostly the same features, but in a standalone mode) (deprecated since version 0.5.0)
9. GraalVM native support
Beginning with version 1.4.0-rc.001, GraalVM metadata started to be added (reflect-config.json and resources-config.json). Initially only the fj-doc-base and fj-doc-freemarker have full support. Actual support for other module will be added as soon as possible, but sometimes is dependent on underlying dependencies support (for example Apache FOP for fj-doc-mod-fop). It is possible to check the current status on the module documentation, in the section native support
10. Maven Plugin
A maven plugin is also available. It allows to configure a maven project for document generation, it is as simple as :
mvn org.fugerit.java:fj-doc-maven-plugin:add \
-Dextensions=base,freemarker,mod-fop
See Documentation for further details.
About javadoc
Javadoc are far from being complete, but you can find latest version at https://www.fugerit.org
Note that, being an open source project hosted on maven central, you can find release javadoc on javadoc.io
Special thanks
Special thanks to JetBrains for accepting this project in the Licenses for Open Source Development - Community Support program.
Special thanks to Sonar Cloud too for their code review platform.