Instantly share code, notes, and snippets.

anonymous /generate pdf
Created Oct 25, 2016

Embed
What would you like to do?
Asciidoctor asciidoctor = Asciidoctor.Factory.create() (1)
File inputFile = new File("path/to/save/asciidocs/index.adoc") (2)
inputFile << new File("path/to/save/asciidocs/overview.adoc").text
inputFile << new File("path/to/save/asciidocs/paths.adoc").text
inputFile << new File("path/to/save/asciidocs/security.adoc").text
inputFile << new File("path/to/save/asciidocs/definitions.adoc").text
AttributesBuilder attributesBuilder = AttributesBuilder.attributes() (3)
attributesBuilder.tableOfContents(true)
attributesBuilder.docType("book")
attributesBuilder.sectNumLevels(3)
attributesBuilder.sectionNumbers(true)
OptionsBuilder options = OptionsBuilder.options() (4)
options.backend("pdf")
options.attributes(attributesBuilder)
asciidoctor.renderFile(inputFile, options) (5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment