class Asciidoctor::Parser

def self.is_next_line_doctitle? reader, attributes, leveloffset

returns true if the Reader is positioned at the document title, false otherwise

leveloffset - an Integer (or integer String value) the represents the current leveloffset
attributes - a Hash of attributes collected above the current line
reader - the source Reader

Internal: Convenience API for checking if the next line on the Reader is the document title
def self.is_next_line_doctitle? reader, attributes, leveloffset
  if leveloffset
    (sect_level = is_next_line_section? reader, attributes) && (sect_level + leveloffset.to_i == 0)
  else
    (is_next_line_section? reader, attributes) == 0
  end
end