Class AsciiDocPreviewBlockMacro

java.lang.Object
org.asciidoctor.extension.BaseProcessor
org.asciidoctor.extension.MacroProcessor<org.asciidoctor.ast.StructuralNode>
org.asciidoctor.extension.BlockMacroProcessor
pro.verron.asciidoc.preview.AsciiDocPreviewBlockMacro
All Implemented Interfaces:
org.asciidoctor.extension.Processor

@Name("preview") public class AsciiDocPreviewBlockMacro extends org.asciidoctor.extension.BlockMacroProcessor

Block macro that embeds a visual preview of an external AsciiDoc template as an image within the current document.

Usage: preview::template.adoc[theme=word,format=png,dpi=192]

Attributes:

  • theme — the rendering theme (default: word)
  • format — output format, png or svg (default: png)
  • dpi — resolution in dots per inch (default: 96)

Output images are cached and only regenerated when the source file changes.

See Also:
  • Field Summary

    Fields inherited from class org.asciidoctor.extension.MacroProcessor

    name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new macro processor with the default macro name.
    Constructs a new AsciiDocPreviewBlockMacro with the specified macro name.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.asciidoctor.ast.StructuralNode
    process(org.asciidoctor.ast.StructuralNode parent, String target, Map<String,Object> attributes)
     

    Methods inherited from class org.asciidoctor.extension.MacroProcessor

    getName, options, setName

    Methods inherited from class org.asciidoctor.extension.BaseProcessor

    createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createList, createList, createList, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, log, newCursor, newCursor, newCursor, newReader, newReader, newReader, newReader, parseContent, setConfig, unwrap, updateConfig

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AsciiDocPreviewBlockMacro

      public AsciiDocPreviewBlockMacro()
      Constructs a new macro processor with the default macro name.
    • AsciiDocPreviewBlockMacro

      public AsciiDocPreviewBlockMacro(String macroName)
      Constructs a new AsciiDocPreviewBlockMacro with the specified macro name.
      Parameters:
      macroName - the name of the macro
  • Method Details

    • process

      public org.asciidoctor.ast.StructuralNode process(org.asciidoctor.ast.StructuralNode parent, String target, Map<String,Object> attributes)
      Specified by:
      process in class org.asciidoctor.extension.MacroProcessor<org.asciidoctor.ast.StructuralNode>