Sha256: f79bc98cd7fcd8819cae430dd9137fffb0cb502e43f6312d1beb26b95c075347

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

require 'govuk_tech_docs/table_of_contents/heading_tree_builder'
require 'govuk_tech_docs/table_of_contents/heading_tree_renderer'
require 'govuk_tech_docs/table_of_contents/heading_tree'
require 'govuk_tech_docs/table_of_contents/heading'
require 'govuk_tech_docs/table_of_contents/headings_builder'

module GovukTechDocs
  module TableOfContents
    module Helpers
      def table_of_contents(html, max_level: nil)
        HeadingTreeRenderer.new(
          HeadingTreeBuilder.new(
            HeadingsBuilder.new(html).headings
          ).tree,
          max_level: max_level
        ).html
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_tech_docs-1.1.0 lib/govuk_tech_docs/table_of_contents/helpers.rb
govuk_tech_docs-1.0.0 lib/govuk_tech_docs/table_of_contents/helpers.rb