<commit_before># Public: Methods for managing sections of Asciidoc content in a document.
# The section responds as an Array of content blocks by delegating
# block-related methods to its @blocks Array.
#
# Examples
#
#   section = Asciidoctor::Section.new
#   section.name = 'DESCRIPTION'
#   section.anchor = 'DESCRIPTION'
#
#   section.size
#   => 0
#
#   section.section_id
#   => "_description"
#
#   section << new_block
#   section.size
#   => 1
class Asciidoctor::Section
  # Public: Get/Set the Integer section level.
  attr_accessor :level

  # Public: Set the String section name.
  attr_writer :name

  # Public: Get/Set the String section title.
  attr_accessor :title

  # Public: Get/Set the String section caption.
  attr_accessor :caption

  # Public: Get/Set the String section anchor name.
  attr_accessor :anchor

  # Public: Get the Array of section blocks.
  attr_reader :blocks

  # Public: Initialize an Asciidoctor::Section object.
  #
  # parent - The parent Asciidoc Object.
  def initialize(parent)
    @parent = parent
    @blocks = []
  end

  # Public: Get the String section name with intrinsics converted
  #
  # Examples
  #
  #   section.name = "git-web{litdd}browse(1) Manual Page"
  #   section.name
  #   => "git-web--browse(1) Manual Page"
  #
  # Returns the String section name
  def name
    @name && 
    @name.gsub(/(^|[^\\])\{(\w[\w\-]+\w)\}/) { $1 + Asciidocs::INTRINSICS[$2] }.
          gsub( /`([^`]+)`/, '<tt>\1</tt>' )
  end

  # Public: Get the String section id
  #
  # Examples
  #
  #   section = Section.new
  #   section.name = "Foo"
  #   section.section_id
  #   => "_foo"
  def section_id
    "_#{name && name.downcase.gsub(' ','_')}"
  end

  # Public: Get the Asciidoctor::Document instance to which this Block belongs
  def document
    @parent.is_a?(Asciidoctor::Document) ? @parent : @parent.document
  end

  # Public: Get the Asciidoctor::Renderer instance being used for the ancestor<commit_msg>Correct module name<commit_after># Public: Methods for managing sections of Asciidoc content in a document.
# The section responds as an Array of content blocks by delegating
# block-related methods to its @blocks Array.
#
# Examples
#
#   section = Asciidoctor::Section.new
#   section.name = 'DESCRIPTION'
#   section.anchor = 'DESCRIPTION'
#
#   section.size
#   => 0
#
#   section.section_id
#   => "_description"
#
#   section << new_block
#   section.size
#   => 1
class Asciidoctor::Section
  # Public: Get/Set the Integer section level.
  attr_accessor :level

  # Public: Set the String section name.
  attr_writer :name

  # Public: Get/Set the String section title.
  attr_accessor :title

  # Public: Get/Set the String section caption.
  attr_accessor :caption

  # Public: Get/Set the String section anchor name.
  attr_accessor :anchor

  # Public: Get the Array of section blocks.
  attr_reader :blocks

  # Public: Initialize an Asciidoctor::Section object.
  #
  # parent - The parent Asciidoc Object.
  def initialize(parent)
    @parent = parent
    @blocks = []
  end

  # Public: Get the String section name with intrinsics converted
  #
  # Examples
  #
  #   section.name = "git-web{litdd}browse(1) Manual Page"
  #   section.name
  #   => "git-web--browse(1) Manual Page"
  #
  # Returns the String section name
  def name
    @name && 
    @name.gsub(/(^|[^\\])\{(\w[\w\-]+\w)\}/) { $1 + Asciidoctor::INTRINSICS[$2] }.
          gsub( /`([^`]+)`/, '<tt>\1</tt>' )
  end

  # Public: Get the String section id
  #
  # Examples
  #
  #   section = Section.new
  #   section.name = "Foo"
  #   section.section_id
  #   => "_foo"
  def section_id
    "_#{name && name.downcase.gsub(' ','_')}"
  end

  # Public: Get the Asciidoctor::Document instance to which this Block belongs
  def document
    @parent.is_a?(Asciidoctor::Document) ? @parent : @parent.document
  end

  # Public: Get the Asciidoctor::Renderer instance being used for the ancestor
{'fraction_non_alphanumeric': 0.1260803253685816, 'fraction_numerical': 0.0035587188612099642, 'mean_word_length': 3.1377497371188223, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7628672', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1292, 'n_words': 377}