./dtcw4 local generateHTML
generateHTML
About This Task
Generates HTML5 from your AsciiDoc sources using AsciidoctorJ.
Output is written to build/html5/.
Configuration
Specify which files to render in your docToolchainConfig.groovy:
inputFiles = [
[file: 'manual.adoc', formats: ['html','pdf']],
]
Single-File HTML
To produce a single self-contained HTML file, set :data-uri: in your AsciiDoc source.
Be aware that the file can become very large.
Text-Based Diagrams
docToolchain includes the asciidoctor-diagram extension for PlantUML, ditaa, and other diagram types.
.example diagram
[plantuml, "{plantUMLDir}demoPlantUML", png]
----
class BlockProcessor
class DiagramBlock
BlockProcessor <|-- DiagramBlock
----
|
Note
|
Use {plantUMLDir} in the image name to ensure diagrams work for both HTML and PDF output.
|
|
Important
|
Use a unique image name for each diagram to avoid overwriting. |
Controlling Diagram Size
Use the width attribute (pixels) or scale attribute (ratio):
[plantuml, target="{plantUMLDir}myDiagram", format=png, width=250]
[plantuml, target="{plantUMLDir}myDiagram", format=png, scale=0.75]
|
Note
|
If Graphviz is not installed, add !pragma layout smetana as the first line of your PlantUML diagram to use the built-in Java layout engine.
|
Further Reading
Source
View the source of this task: scripts/generateHTML.groovy on GitHub
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.