class

Asciidoctor::SyntaxHighlighterBase

Inherits Reference < Object

Abstract base class for syntax highlighter implementations.

Constructors

new(name : String, backend : String = "html5")
Source

Instance methods

docinfo(location : Symbol, doc : Document, opts : Hash(Symbol, String) = {} of Symbol => String) : String

Generates docinfo markup for this syntax highlighter to insert at the specified location in the output document.

Source
docinfo?(location : Symbol) : Bool

Indicates whether this syntax highlighter has docinfo (i.e., markup) to insert into the output document at the specified location.

Source
format(node : AbstractNode, lang : String | Nil, opts : Hash(Symbol, String) = {} of Symbol => String) : String

Format the highlighted source for inclusion in an HTML document.

Source
highlight(node : AbstractNode, source : String, lang : String, opts : Hash(Symbol, String) = {} of Symbol => String) : String

Highlights the specified source when this source block is being converted.

Source
highlight?

Indicates whether highlighting is handled by this syntax highlighter or by the client.

Source
name

The String name of this syntax highlighter.

Source
pre_class

The CSS class prefix for the pre element.

Source
pre_class=(pre_class : String)

The CSS class prefix for the pre element.

Source
write_stylesheet(doc : Document, to_dir : String) : Nil

Writes the stylesheet to support the highlighted source(s) to disk.

Source
write_stylesheet?(doc : Document) : Bool

Indicates whether this syntax highlighter wants to write a stylesheet to disk.

Source

Macros

register_for(*names)

Register this syntax highlighter class for the given names in the default registry.

Source