# File lib/maruku/helpers.rb, line 79 def md_abbr(abbr, title) md_el(:abbr, [abbr], {:title=>title}) end
# File lib/maruku/helpers.rb, line 75 def md_abbr_def(abbr, text, al=nil) md_el(:abbr_def, [], {:abbr=>abbr, :text=>text}, al) end
Attribute list definition
# File lib/maruku/helpers.rb, line 179 def md_ald(id, al) md_el(:ald, [], {:ald_id=>id,:ald=>al}) end
# File lib/maruku/helpers.rb, line 123 def md_br() md_el(:linebreak, [], {}, nil) end
Inline code
# File lib/maruku/helpers.rb, line 54 def md_code(code, al=nil) md_el(:inline_code, [], {:raw_code => code}, al) end
Code block
# File lib/maruku/helpers.rb, line 59 def md_codeblock(source, al=nil) md_el(:code, [], {:raw_code => source}, al) end
if the first is a #md_ial, it is used as such
# File lib/maruku/helpers.rb, line 34 def md_el(node_type, children=[], meta={}, al=nil) if (e=children.first).kind_of?(MDElement) and e.node_type == :ial then if al al += e.ial else al = e.ial end children.shift end e = MDElement.new(node_type, children, meta, al) e.doc = @doc return e end
# File lib/maruku/helpers.rb, line 119 def md_em(children, al=nil) md_el(:emphasis, [children].flatten, {}, al) end
<andrea@rubyforge.org> <andrea@rubyforge.org>
# File lib/maruku/helpers.rb, line 146 def md_email(email, al=nil) md_el(:email_address, [], {:email=>email}, al) end
# File lib/maruku/helpers.rb, line 135 def md_emstrong(children, al=nil) md_strong(md_em(children), al) end
# File lib/maruku/helpers.rb, line 150 def md_entity(entity_name, al=nil) md_el(:entity, [], {:entity_name=>entity_name}, al) end
Markdown extra
# File lib/maruku/helpers.rb, line 155 def md_foot_ref(ref_id, al=nil) md_el(:footnote_reference, [], {:footnote_id=>ref_id}, al) end
# File lib/maruku/helpers.rb, line 71 def md_footnote(footnote_id, children, al=nil) md_el(:footnote, children, {:footnote_id=>footnote_id}, al) end
# File lib/maruku/helpers.rb, line 49 def md_header(level, children, al=nil) md_el(:header, children, {:level => level}, al) end
# File lib/maruku/helpers.rb, line 127 def md_hrule() md_el(:hrule, [], {}, nil) end
# File lib/maruku/helpers.rb, line 83 def md_html(raw_html, al=nil) e = md_el(:raw_html, [], {:raw_html=>raw_html}) begin # remove newlines and whitespace at begin # end end of string, or else REXML gets confused raw_html = raw_html.gsub(/\A\s*</,'<'). gsub(/>[\s\n]*\Z/,'>') raw_html = "<marukuwrap>#{raw_html}</marukuwrap>" e.instance_variable_set :@parsed_html, REXML::Document.new(raw_html) rescue REXML::ParseException => ex e.instance_variable_set :@parsed_html, nil maruku_recover "REXML cannot parse this block of HTML/XML:\n"+ add_tabs(raw_html,1,'|') + "\n"+ex.inspect # " #{raw_html.inspect}\n\n"+ex.inspect end e end
inline attribute list
# File lib/maruku/helpers.rb, line 172 def md_ial(al) al = Maruku::AttributeList.new(al) if not al.kind_of?Maruku::AttributeList md_el(:ial, [], {:ial=>al}) end
# File lib/maruku/helpers.rb, line 115 def md_im_image(children, url, title=nil, al=nil) md_el(:im_image, children, {:url=>url,:title=>title},al) end
# File lib/maruku/helpers.rb, line 107 def md_im_link(children, url, title=nil, al=nil) md_el(:im_link, children, {:url=>url,:title=>title}, al) end
# File lib/maruku/helpers.rb, line 111 def md_image(children, ref_id, al=nil) md_el(:image, children, {:ref_id=>ref_id}, al) end
# File lib/maruku/helpers.rb, line 67 def md_li(children, want_my_par, al=nil) md_el(:li, children, {:want_my_paragraph=>want_my_par}, al) end
# File lib/maruku/helpers.rb, line 103 def md_link(children, ref_id, al=nil) md_el(:link, children, {:ref_id=>ref_id.downcase}, al) end
# File lib/maruku/helpers.rb, line 159 def md_par(children, al=nil) md_el(:paragraph, children, meta={}, al) end
# File lib/maruku/helpers.rb, line 63 def md_quote(children, al=nil) md_el(:quote, children, {}, al) end
# File lib/maruku/helpers.rb, line 164 def md_ref_def(ref_id, url, title=nil, meta={}, al=nil) meta[:url] = url meta[:ref_id] = ref_id meta[:title] = title if title md_el(:ref_definition, [], meta, al) end
# File lib/maruku/helpers.rb, line 131 def md_strong(children, al=nil) md_el(:strong, [children].flatten, {}, al) end
# File lib/maruku/helpers.rb, line 140 def md_url(url, al=nil) md_el(:immediate_link, [], {:url=>url}, al) end
Server directive <?target code⦠?>
# File lib/maruku/helpers.rb, line 184 def md_xml_instr(target, code) md_el(:xml_instr, [], {:target=>target, :code=>code}) end