Class Asciidoctor::BaseTemplate
In: lib/asciidoctor/backends/base_template.rb
lib/asciidoctor/backends/html5.rb
lib/asciidoctor/backends/docbook45.rb
Parent: Object

An abstract base class that provides methods for definining and rendering the backend templates. Concrete subclasses must implement the template method.

NOTE we must use double quotes for attribute values in the HTML/XML output to prevent quote processing. This requirement seems hackish, but AsciiDoc has this same issue.

Methods

Attributes

eruby  [R] 
view  [R] 

Public Class methods

Public Instance methods

create template matter to insert an attribute if the variable has a value

create template matter to insert a style class if the variable has a value

Public: Compact blank lines in the provided text. This method also restores every HTML line feed entity found with an endline character.

text - the String to process

returns the text with blank lines removed and HTML line feed entities converted to an endline character.

create template matter to insert an id if one is specified for the block

Public: Preserve endlines by replacing them with the HTML line feed entity.

If the compact flag on the document‘s renderer is true, perform the replacement. Otherwise, return the text unprocessed.

text - the String to process node - the concrete instance of Asciidoctor::AbstractNode being rendered

Public: Render this template in the execution context of the supplied concrete instance of Asciidoctor::AbstractNode.

This method invokes the template method on this instance to retrieve the template data and then evaluates that template in the context of the supplied concrete instance of Asciidoctor::AbstractNode. This instance is accessible to the template data via the local variable named ‘template’.

If the compact flag on the document‘s renderer is true and the view context is document or embedded, then blank lines in the output are compacted. Otherwise, the rendered output is returned unprocessed.

node - The concrete instance of AsciiDoctor::AbstractNode to render locals - A Hash of additional variables. Not currently in use.

create template matter to insert a style class from the role attribute if specified

create template matter to insert a style class from the style attribute if specified

[Validate]