Sha256: 071686e8b8d8a45bd8e81a51698d85d8e6498b6b1719e301238aee35a1b305a3

Contents?: true

Size: 893 Bytes

Versions: 20

Compression:

Stored size: 893 Bytes

Contents

require 'maruku'

OpenMatch = /^\s*\{\{\{\s*(.*)$/
CloseMatch = /(.*)\}\}\}/

def handle(doc, src, context)
  lines = []
    
  line = src.shift_line
  line =~ OpenMatch
  line = $1
  while line && !(line =~ CloseMatch)
    lines << line
    line = src.shift_line
  end
  lines << $1
  i = 0
  c = context[5]
  k = c.class
  context << MaRuKu::MDElement.new(:viz)
  true
end

MaRuKu::In::Markdown::register_block_extension(
  :regexp  => OpenMatch,
  :handler => lambda { |doc, src, context|
    handle(doc, src, context)
  }
)

module MaRuKu; module Out; module HTML

  def to_html_viz
      span = Element.new 'javascript'
      span.attributes['class'] = 'maruku_section_number'
      span << Text.new('Foooo')
    add_ws  span
  end
  
end end end


doc = Maruku.new(%{
  

{{{  foo }}}

* TOC
{:toc}

+---------
| text
+----------

# Foo & More


PPPPP

## Whatever

})
puts doc.to_html

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
omf_web-1.2.9 debug/maruku-test.rb
omf_web-1.2.8 debug/maruku-test.rb
omf_web-1.2.7 debug/maruku-test.rb
omf_web-1.2.6 debug/maruku-test.rb
omf_web-1.2.5 debug/maruku-test.rb
omf_web-1.2.4 debug/maruku-test.rb
omf_web-1.2.3 debug/maruku-test.rb
omf_web-1.2.2 debug/maruku-test.rb
omf_web-1.2.1 debug/maruku-test.rb
omf_web-1.2.0 debug/maruku-test.rb
omf_web-1.0.0 debug/maruku-test.rb
omf_web-0.9.9 debug/maruku-test.rb
omf_web-0.9.8 debug/maruku-test.rb
omf_web-0.9.7 debug/maruku-test.rb
omf_web-0.9.6 debug/maruku-test.rb
omf_web-0.9.5 debug/maruku-test.rb
omf_web-0.9.4 debug/maruku-test.rb
omf_web-0.9.3 debug/maruku-test.rb
omf_web-0.9.1 debug/maruku-test.rb
omf_web-0.9 debug/maruku-test.rb