Asciidoc and DocBook to PDF (or FO, HTML, ...) conversion made easy!
This project has similiar aims as the following tools:
- asciidoctor
- asciidoctor-fopub
- daps (on github)
- metanorma (on github)
Make using Asciidoc(tor) and DocBook convertion tools as easy as it can be.
In detail:
- Provide several processing pipelines for conversion.
- Provide the most up-to-date pipelines possible.
- Provide an unified CLI access to the different pipelines.
- Only depend on an installed Java JDK 11 (and some standard Linux tools).
- Support for MathML (work-in-progress, depending on the pipeline).
- Support for (code) syntax highlighting (work-in-progress, depending on the pipeline).
This project is a work-in-progress, but most things work now: Using pipelines to convert Asciidoc(tor) or DocBook to PDF, HTML and/or FO.
So far the following pipelines are implemented:
- xsl30:
(X)Html conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook xslTNG 3.0 Stylesheets (This does not support FO, see here.) - xsl20-fo:
PDF (or intermediate) conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook Xslt 2.0 Stylesheets (2.6.0) and Apache FOP (2.6) - xsl20-css:
PDF (or intermediate) conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook Xslt 2.0 Stylesheets (2.6.0) and Prince 14 - ad:
PDF (or intermediate) conversion of Asciidoc(tor) using the acsiidoctorj port of asciidoctor - xsl10-html:
(X)Html conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook Xslt 1.0 Stylesheets (snapshot 2020-06-03) - xsl10-css: (not implemented so far)
PDF (or intermediate) conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook Xslt 1.0 Stylesheets (snapshot 2020-06-03) and Prince 14 - xsl10-fo: (not implemented so far)
PDF (or intermediate) conversion of Asciidoc(tor) and DocBook (5.1) using the DocBook Xslt 1.0 Stylesheets (snapshot 2020-06-03) and Apache FOP (2.6) - fo:
PDF conversion of XSLT-FO (i.e. FO) using Apache FOP (2.6)
- Java 17 JDK installed and set as JAVA_HOME environment.
- Apache Maven (
mvn
) in PATH. - Apache Ant (
ant
) in PATH. - Some Linux tools (e.g.
zip
,unzip
,bash
,wget
) in PATH. - A github account, with an associated SSH certificate (so that you clone with SSH)
- Check out the project from github.
cd db-toolchain
./script/bootstrap.sh
./gradlew build
./scripts/unzip-distribution.sh
- You have now a distribution Zip at
build/distributions/db-toolchain.zip
that you can unzip and use independent of the build process. cp scripts/env.sh.template scripts/env.sh
and adopt copied file to your needs- Use
./scripts/run-with-modulepath.sh
to invoke the program - E.g.
./scripts/run-with-modulepath.sh transform -d . -w ./submodules/asciidoctor.org/docs --pipeline xsl20-fo -of HTML5 -i ./submodules/asciidoctor.org/docs/asciidoc-writers-guide.adoc
The most important (sub-)command is transform
and the help gives you:
> ./bin/db-toolchain transform -h
Usage: <main class> transform [-ch] [--princeapi] [-d=<outDir>] -i=<in>
[-if=<inFormat>] [-o=<out>] [-of=<outFormat>]
[-p=<pipeline>] [-w=<workDir>]
transform input file to output file
-c, --check, --validate
-d, --cwd, --outdir=<outDir>
output directory (and current working directory)
-h, --help
-i, --in=<in>
-if, --informat=<inFormat>
-o, --out=<out>
-of, --outformat=<outFormat>
-p, --pipeline=<pipeline>
--princeapi use the prince API for cssprint (nop for fo
pipeline)
-w, -b, --workdir, --basedir=<workDir>
basedir of relative paths
Hence, a conversion from *.adoc
to *.pdf
using the xsl-fo
pipeline (see above) would be:
> ./bin/db-toolchain transform --outdir . -p xsl-fo -if AD -of PDF \
-w downloads \
-i downloads/integrator-guide.adoc
Currently supported formats are:
- AD asciidoctor text file format (extension:
*.adoc
) - DB docbook (5.1) XML format (extension
*.db.xml
) - FO XSL formatting objects XML format (extension
*.fo.xml
) - XHTML markup (extensions:
*.xhtml
and*.html.xml
) - HTML5 markup (extensions:
*.html5
and*.html
) - PDF document format (extension:
*.pdf
)
- References
- Big Example (from 2009) (with xml and pdf)
- DocBook XML Schema
- Docbook Wiki
- Introduction to DocBook
- Giurca's DocBook Tutorial
- Introduction to DocBook
- DocBook Demystification
- DocBook Wiki
- EinfĂĽhrung in XML/XSLT Docbook
- Doc as Code Blog (in german)
- How to generate PDF (in german)
- Using DocBook toolchain
- Recommended toolchain
- Eclipse help from Docbook
- docbkx-tools (maven plugin)
- fopub (java based)
- AsciiBook: toolchain from AsciiDoc to PDF (in JS)
- asciidoctor-fopub: toolchain from DB (4.5) to PDF
- publican (old)
- doctribute additional stylesheets for xslt10 convertion
- asciidoctor
- list of asciidoctor extensions
- asciidoctorj integrator guide
- using extensions with asciidoctorj
- asciidoctor-gradle-plugin
- new asciidoctor-gradle-plugin
- How can I enable asciimath support
- Overview article
- pandoc:
pandoc --wrap=none -f docbook -t asciidoc DocbookFile.xml > AsciiDocFile.adoc
- docbookrx
- xslTNG XSLT 3.0 stylesheets for docbook (HTML only)
- xslTNG reference guide
-
XSLT
- xslt 2.0 features (german)
- xslt 3.0 features
-
- XProc Spec
- Introduction to XProc 3.0
- Calabash 1: XProc Implementation
- MorganaXProc-III (work-in-progress)
- Calabash Docs
- extension steps
- implementation specific extension steps
- EXProc specific extension steps
- JEuclid extension step
- XSLT Highlighter extension step
- Pygments extension step
- MathML to SVG converter extension step - uses JEuclid
- AsciiDoctor extension step
- PlantUML extension step
- IDPF epubcheck extension step
- MathType OLE extension step
- DiTAA diagrams Step - uses DiTAA diagrams
- image metadata extraction extension step uses metadata-extractor
- Delta XML extension step
- 2.x XSpec step
- RDF extension steps
- XMLUnit extension step
- pegdown Step - but pegdown is deprecated (use flexmark-java
-
EXProc: XProc extensions
- http://www.sagehill.net/docbookxsl/CustomMethods.html
- http://doccookbook.sourceforge.net/html/en/dbc.common.dbcustomize.html
- https://tdg.docbook.org/tdg/5.1/ch05.html
- overview
- jsoup (java)
- htmlcleaner
- htmlparser
- jfiveparse
- XML catalog
- NVDL
- Relax NG
- Schematron
- ph-schematron Implementation
- ph-schematron home page
- example of use basically there are 2 different ways to use, read the home page!
- jing-trang also contains a schematron implementation (experimental)
- Skeleton XSLT Schematron Implementation
- ph-schematron Implementation
- mathml1 (in german)
- mathml2 (in german)
- asciidoctor stem
- asciidoctor alternative math extension renderer: gnome/pango/cairo/gdk
- extraordinary list of math renderer
- AsciiMath
- LaTeXML convert LaTeX to XML and then to Html
- mml2tex MathML to Latex
- KaTeX an alternative to the MathJax JS renderer
- The xslt10 stylesheets have a epub pipeline (see README)
- epubtools-frontend xhtml to epub
- xslthl (old but maintained)
- Installing the Toolchain
- AsciidoctorJ
- Syntax Highlighting
- Antora: Site generation for asciidoc
- Additional Backends
- CSS for print tutorial
- print-css.rocks
- PagedMedia
- State of print stylesheets in 2018
- Printer friendly pages
- Prepostprint Blog
- Satz mit PrintCSS (in German)
- PrintCSS in Verlagen
- vivliostyle (JS, renderer: chromium)
- weasyprint (python, renderer: gnome/pango/cairo/gdk)
- openhtmltopdf (java) based on
- Flying Saucer renderer
- asciidoctor-web-pdf
complete solution with MathJax3 and Highlighting based on Puppeteer and Paged.js - ReLaXed
- DITA
- CommonMark: Unify Markdown
- Lyx Editor
- Context
- parsX
- pretextbook markup (formerly 'MathBook XML')
- speedata publisher
- Modern font engine
- Overview
- mdBook with its plugins (on github)
- bookdown with its documentation (on github)
- gaiden
- markua
- mallard markup
- pp (pandoc preprocessor)
- toolchain manual publisher (german)
- Thorsten Ball
- Ryan Frazier
- pandoc
- kramdown
- alldoc - a pandoc web-ui (on github)