Sha256: 6d97b758f2fad0fbccda0ea482704e82438849a4d6ad4fce748bf929325cef2b

Contents?: true

Size: 230 Bytes

Versions: 7

Compression:

Stored size: 230 Bytes

Contents

module Mdoc
  class Processor
    class AddToc < Processor
      def process!(doc)
        unless doc.body =~ /\{\:toc\}/
          doc.body = "\n* Table of Contents\n{:toc}\n\n" + doc.body
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mdoc-0.0.11 lib/mdoc/processor/add_toc.rb
mdoc-0.0.10 lib/mdoc/processor/add_toc.rb
mdoc-0.0.9 lib/mdoc/processor/add_toc.rb
mdoc-0.0.8 lib/mdoc/processor/add_toc.rb
mdoc-0.0.7 lib/mdoc/processor/add_toc.rb
mdoc-0.0.6 lib/mdoc/processor/add_toc.rb
mdoc-0.0.5 lib/mdoc/processor/add_toc.rb