My Bookmaker is a Maven plugin for producing formatted PDFs from Markdown and other sources. To generate some PDFs, simply use the following command in a directory that contains Markdown files:
mvn my.bookmaker:make:book
Despite being a Maven plugin, My Bookmaker does not require a pom.xml file.
Here is how it works in a nutshell:
- Configuration happens either via a YAML file or by convention:
- If a file called
book.ymlexists then the configuration will be sourced from that file. Typically, a single final output PDF is produced. - If no YAML configuration file exists, all Markdown files in the current directory will be converted to individual PDFs. CSS files will be collected and applied together.
- If a file called
- Markdown is converted into HTML using the CommonMark Java library (see Processor):
- CSS content is pasted into the
<head><style>section of the final HTML document. - The Styler will also append some additional boilerplate CSS for setting the page size and managing section counters.
- CSS content is pasted into the
- Styled HTML is converted to PDF using the Flying Saucer XHTML/CSS renderer with the (discontinued) flying-saucer-pdf-itext5 back-end (based on iTextPDF 5.5; see Renderer).