Class Asciidoctor::Callouts
In: lib/asciidoctor/callouts.rb
Parent: Object

Public: Maintains a catalog of callouts and their associations.

Methods

Public Class methods

Public Instance methods

Public: Get a space-separated list of callout ids for the specified list item

li_ordinal - the Integer ordinal (1-based) of the list item for which to

             retrieve the callouts

Returns A space-separated String of callout ids associated with the specified list item

Public: The current list for which callouts are being collected

Returns The Array of callouts at the position of the list index pointer

Internal: Generate a unique id for the callout at the specified position

list_index - The 1-based Integer index of the callout list within the document co_index - The 1-based Integer index of the callout since the end of the last callout list

Returns A unique String id for a callout

Internal: Generate a unique id for the callout based on the internal indexes

Returns A unique String id for this callout

Public: Advance to the next callout list in the document

Returns nothing

Public: Get the next callout index in the document

Reads the next callout index in the document and advances the pointer. This method is used during conversion to retrieve the unique id of the callout that was generated during parsing.

Returns The unique String id of the next callout in the document

Public: Register a new callout for the given list item ordinal.

Generates a unique id for this callout based on the index of the next callout list in the document and the index of this callout since the end of the last callout list.

li_ordinal - the Integer ordinal (1-based) of the list item to which this

             callout is to be associated

Examples

 callouts = Asciidoctor::Callouts.new
 callouts.register(1)
 # => "CO1-1"
 callouts.next_list
 callouts.register(2)
 # => "CO2-1"

Returns The unique String id of this callout

Public: Rewind the list index pointer, intended to be used when switching from the parsing to conversion phase.

Returns nothing

[Validate]