lib/asciidoctor/abstract_block.rb
# Internal: Assign the next index (0-based) and numeral (1-based) to the section.
# If the section is an appendix, the numeral is a letter (starting with A). This
# method also assigns the appendix caption.
#
# section - The section to which to assign the next index and numeral.
#
# Assign to the specified section the next index and, if the section is
# numbered, the numeral within this block (its parent).
#
# Returns nothing
Assign the next index (0-based) and numeral (1-based) to the section.
If the section is an appendix, the numeral is a letter (starting with A). This
method also assigns the appendix caption.

The section to which to assign the next index and numeral.

Assign to the specified section the next index and, if the section is
numbered, the numeral within this block (its parent).

Returns nothing
Assign the next index ( 0 - based ) and numeral ( 1 - based ) to the section . If the section is an appendix the numeral is a letter ( starting with A ) . This method also assigns the appendix caption . The section to which to assign the next index and numeral . Assign to the specified section the next index and if the section is numbered the numeral within this block ( its parent ) . Returns nothing
def assign_numeral section
    @next_section_index = (section.index = @next_section_index) + 1
    if (like = section.numbered)
      if (sectname = section.sectname) == 'appendix'
        section.numeral = @document.counter 'appendix-number', 'A'
        if (caption = @document.attributes['appendix-caption'])
          section.caption = %(#{caption} #{section.numeral}: )
        else
          section.caption = %(#{section.numeral}. )
        end
      elsif sectname == 'chapter' || like == :chapter
        section.numeral = @document.counter 'chapter-number', 1
      else
        section.numeral = @next_section_ordinal
        @next_section_ordinal += 1
      end
    end
    nil
  end
def assign_numeral section @next_section_index = ( section . index = @next_section_index ) + 1 if ( like = section . numbered ) if ( sectname = section . sectname ) == 'appendix' section . numeral = @document . counter 'appendix-number' , 'A' if ( caption = @document . attributes [ 'appendix-caption' ] ) section . caption = %(#{caption} #{section.numeral}: ) else section . caption = %(#{section.numeral}. ) end elsif sectname == 'chapter' || like == :chapter section . numeral = @document . counter 'chapter-number' , 1 else section . numeral = @next_section_ordinal @next_section_ordinal += 1 end end nil end
Internal: Assign the next index (0-based) and numeral (1-based) to the section.
Internal : Assign the next index ( 0 - based ) and numeral ( 1 - based ) to the section .
# NOTE currently chapters in a book doctype are sequential even for multi-part books (see #979)
section
<not_specific>