Class: Asciidoctor::List

Inherits:
AbstractBlock show all
Defined in:
lib/asciidoctor/list.rb

Overview

Methods for managing AsciiDoc lists (ordered, unordered and description lists)

Constant Summary

Constants included from Substitutors

Substitutors::CAN, Substitutors::CGI, Substitutors::DEL, Substitutors::ESC_R_SB, Substitutors::HighlightedPassSlotRx, Substitutors::PASS_END, Substitutors::PASS_START, Substitutors::PLUS, Substitutors::PassSlotRx, Substitutors::QuotedTextSniffRx, Substitutors::RS, Substitutors::R_SB, Substitutors::SUB_GROUPS, Substitutors::SUB_HINTS, Substitutors::SUB_OPTIONS, Substitutors::SpecialCharsRx, Substitutors::SpecialCharsTr

Instance Attribute Summary

Attributes inherited from AbstractBlock

#blocks, #caption, #content_model, #level, #numeral, #source_location, #style, #subs

Attributes inherited from AbstractNode

#attributes, #context, #document, #id, #node_name, #parent

Instance Method Summary collapse

Methods inherited from AbstractBlock

#<<, #alt, #assign_caption, #block?, #blocks?, #captioned_title, #context=, #file, #find_by, #inline?, #lineno, #list_marker_keyword, #next_adjacent_block, #number, #number=, #remove_sub, #sections, #sections?, #sub?, #title, #title=, #title?, #xreftext

Methods inherited from AbstractNode

#add_role, #attr, #attr?, #block?, #converter, #enabled_options, #generate_data_uri, #generate_data_uri_from_uri, #has_role?, #icon_uri, #image_uri, #inline?, #is_uri?, #media_uri, #normalize_asset_path, #normalize_system_path, #normalize_web_path, #option?, #read_asset, #read_contents, #reftext, #reftext?, #remove_attr, #remove_role, #role, #role=, #role?, #roles, #set_attr, #set_option, #update_attributes

Methods included from Substitutors

#apply_header_subs, #apply_normal_subs, #apply_reftext_subs, #apply_subs, #expand_subs, #extract_passthroughs, #highlight_source, #resolve_block_subs, #resolve_lines_to_highlight, #resolve_pass_subs, #resolve_subs, #restore_passthroughs, #sub_attributes, #sub_callouts, #sub_macros, #sub_post_replacements, #sub_quotes, #sub_replacements, #sub_source, #sub_specialchars

Methods included from Logging

#logger, #message_with_context

Constructor Details

#initialize(parent, context, opts = {}) ⇒ List

Returns a new instance of List.



13
14
15
# File 'lib/asciidoctor/list.rb', line 13

def initialize parent, context, opts = {}
  super
end

Instance Method Details

#convertObject Also known as: render



24
25
26
27
28
29
30
31
32
# File 'lib/asciidoctor/list.rb', line 24

def convert
  if @context == :colist
    result = super
    @document.callouts.next_list
    result
  else
    super
  end
end

#outline?Boolean

Check whether this list is an outline list (unordered or ordered).

Returns:

  • (Boolean)

    Return true if this list is an outline list. Otherwise, return false.



20
21
22
# File 'lib/asciidoctor/list.rb', line 20

def outline?
  @context == :ulist || @context == :olist
end

#to_sObject



37
38
39
# File 'lib/asciidoctor/list.rb', line 37

def to_s
  %(#<#{self.class}@#{object_id} {context: #{@context.inspect}, style: #{@style.inspect}, items: #{items.size}}>)
end