Class Asciidoctor::Renderer
In: lib/asciidoctor/renderer.rb
Parent: Object

Public: Methods for rendering Asciidoc Documents, Sections, and Blocks using eRuby templates.

Methods

Attributes

compact  [R] 

Public Class methods

Internal: Convert a CamelCase word to an underscore-delimited word

Examples

  Renderer.camelcase_to_underscore('BlockSidebar')
  # => 'block_sidebar'

  Renderer.camelcase_to_underscore('BlockUlist')
  # => 'block_ulist'

Returns the String converted from CamelCase to underscore-delimited

Internal: Extracts the view name and backend from a qualified Ruby class

The purpose of this method is to determine the view name and backend to which a built-in template class maps. We can make certain assumption since

we have control over these class names. The Asciidoctor:prefix and

Template suffix are stripped as the first step in the conversion.

qualified_class - The Class or String qualified class name from which to extract the view name and backend

Examples

  Renderer.extract_view_mapping(Asciidoctor::HTML5::DocumentTemplate)
  # => ['document', 'html5']

  Renderer.extract_view_mapping(Asciidoctor::DocBook45::BlockSidebarTemplate)
  # => ['block_sidebar', 'docbook45']

Returns A two-element String Array mapped as [view_name, backend], where backend may be nil

Public: Initialize an Asciidoctor::Renderer object.

Public Instance methods

Internal: Load the eRuby implementation

name - the String name of the eRuby implementation (default: ‘erb’)

returns the eRuby implementation class

Public: Render an Asciidoc object with a specified view template.

view - the String view template name. object - the Object to be used as an evaluation scope. locals - the optional Hash of locals to be passed to Tilt (default {}) (also ignored, really)

[Validate]