Interface Highlighter

    • Method Detail

      • highlight

        HighlightResult highlight​(Block node,
                                  java.lang.String source,
                                  java.lang.String lang,
                                  java.util.Map<java.lang.String,​java.lang.Object> options)
        Highlights the source according to the language.
        Parameters:
        node - The node of the Asciidoctor AST that contains the source to be highlighted.
        source - The full content of the source block as one String.
        lang - The language that was associated with the source block, e.g. java or ruby.
        options - A map containing options for conversion:
        callouts
        A map containing all callouts indexed by line number (1-based) (optional). That means ((Map)options.get("callouts")).get(1L) will return the List of callouts in the first line. The value for each callout is a List with 2 elements: The optional comment text before the callout, e.g. // , and the callout number, e.g "1".
        css_mode
        The CSS mode as a String, "class" or "inline"
        highlight_lines
        A 1-based Array of Integer line numbers to highlight (aka emphasize) (optional).
        number_lines
        A String indicating whether lines should be numbered ("table" or "inline") (optional).
        start_line_number
        The starting Integer (1-based) line number (optional, default: 1).
        style
        The String style (aka theme) to use for colorizing the code (optional).
        Returns:
        A HighlightResult containing the converted HTML as a String and optionally a line offset.