Sha256: 34b78d3108496c9012428fe031a17bf2f02b3967c349a512ca4ddd11bdb99db0

Contents?: true

Size: 472 Bytes

Versions: 2

Compression:

Stored size: 472 Bytes

Contents

#!/usr/bin/env ruby

# Pandoc filter to allow inserting the format that the document was formatted
# to. %{format} will be replaced by the format that pandoc passes in to this
# filter. It will only be replaced from matching Str elements.

require "pandoc_object_filters"

filter = PandocObjectFilters::Filter.new

filter.filter do |element|
  if element.is_a?(PandocObjectFilters::Element::Str) && element.value == "%{format}"
    element.value = filter.format
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pandoc_object_filters-0.2.0 examples/format.rb
pandoc_object_filters-0.1.0 examples/format.rb