Sha256: 86b14961c0b415a1e7e2ae0922dc1e70c2b9b3bb10f85132d8034ca591a5b60b
Contents?: true
Size: 1.4 KB
Versions: 16
Compression:
Stored size: 1.4 KB
Contents
# This file is intended to be used via a Livetext .mixin # or the equivalent. module Markdown SimpleFormats = {} SimpleFormats[:b] = %w[* *] SimpleFormats[:i] = %w[_ _] SimpleFormats[:t] = %w[` `] SimpleFormats[:s] = %w[<strike> </strike>] def h1(args = nil, body = nil); api.out "# #{Livetext.interpolate(api.data)}"; api.optional_blank_line end # atx style for now def h2(args = nil, body = nil); api.out "## #{Livetext.interpolate(api.data)}"; api.optional_blank_line end def h3(args = nil, body = nil); api.out "### #{Livetext.interpolate(api.data)}"; api.optional_blank_line end def h4(args = nil, body = nil); api.out "#### #{Livetext.interpolate(api.data)}"; api.optional_blank_line end def h5(args = nil, body = nil); api.out "##### #{Livetext.interpolate(api.data)}"; api.optional_blank_line end def h6(args = nil, body = nil); api.out "###### #{Livetext.interpolate(api.data)}"; api.optional_blank_line end def title(args = nil, body = nil) h1 end def section(args = nil, body = nil) h3 end def bq(args = nil, body = nil) # block quote api.body {|line| api.out "> #{line}" } end def list(args = nil, body = nil) api.body {|line| api.out " * #{line}" } end def olist(args = nil, body = nil) # Doesn't handle paragraphs yet n = 0 api.body do |line| n += 1 api.out "#{n}. #{_format(line)}" end end alias nlist olist end
Version data entries
16 entries across 16 versions & 1 rubygems