Sha256: f431f1a4525a155eb2d168a0f85b42990fa553e8aef9d4f92844113b7555467a

Contents?: true

Size: 899 Bytes

Versions: 1

Compression:

Stored size: 899 Bytes

Contents

require "pandoc_object_filters"

module PandocObjectFilters
  module V1_17
    module Element
      class Document < PandocObjectFilters::V1_17::Element::Base
        include PandocObjectFilters::V1_16::Element::Document::Behavior
        attr_reader :pandoc_api_version

        def initialize(ast)
          object = PandocObjectFilters::Element.to_object(ast)
          meta_object = PandocObjectFilters::Element.to_object(object["meta"])
          @meta = PandocObjectFilters::Element::Meta.new(meta_object)
          @contents = object["blocks"]
          @pandoc_api_version = object["pandoc-api-version"]
        end

        def to_ast
          {
            "blocks" => PandocObjectFilters::Element.to_ast(contents),
            "meta" => PandocObjectFilters::Element.to_ast(meta),
            "pandoc-api-version" => pandoc_api_version
          }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pandoc_object_filters-0.2.0 lib/pandoc_object_filters/v1_17/element/document.rb