module Ore::Template::Helpers::Markdown

@api semipublic

@since 0.10.0

Public Instance Methods

h1(title) click to toggle source

Emits a markdown h1 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 43
def h1(title)
  "# #{title}"
end
h2(title) click to toggle source

Emits a markdown h2 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 54
def h2(title)
  "## #{title}"
end
h3(title) click to toggle source

Emits a markdown h3 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 65
def h3(title)
  "### #{title}"
end
h4(title) click to toggle source

Emits a markdown h4 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 76
def h4(title)
  "#### #{title}"
end
image(url,alt=nil) click to toggle source

Emits a markdown image.

@param [String] url

@param [String, nil] alt

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 32
def image(url,alt=nil)
  "![#{alt}](#{url})"
end
pre(code) click to toggle source

Emits a markdown code block.

@param [String] code

@yield []

The return value of the given block will be used as the code.

@return [String]

# File lib/ore/template/helpers/markdown.rb, line 90
def pre(code)
  code.each_line.map { |line| "    #{line}" }.join
end