module RoboPigeon::Dsl::Helpers::Markdown

Public Instance Methods

confluence_from_md(file) click to toggle source
# File lib/robopigeon/markdown/helper_dsl.rb, line 16
def confluence_from_md(file)
  from_md_template(file).to_confluence
end
html_from_md(file) click to toggle source
# File lib/robopigeon/markdown/helper_dsl.rb, line 40
def html_from_md(file)
  from_md_template(file).to_html
end
jira_from_md(file) click to toggle source
# File lib/robopigeon/markdown/helper_dsl.rb, line 28
def jira_from_md(file)
  from_md_template(file).to_confluence
end
slack_from_md(file) click to toggle source
# File lib/robopigeon/markdown/helper_dsl.rb, line 52
def slack_from_md(file)
  from_md_template(file).to_slack
end

Private Instance Methods

from_md_template(file) click to toggle source
# File lib/robopigeon/markdown/helper_dsl.rb, line 58
def from_md_template(file)
  raise RoboPigeon::Markdown::Error, "template file #{file} not found" unless File.exist?(file)

  raw = File.read(file)
  markdown = ERB.new(raw).result(binding)
  Kramdown::Document.new(markdown,
                         input: 'GFM',
                         syntax_highlighter: 'coderay',
                         syntax_highlighter_opts: {
                           css: 'style',
                           line_numbers: 'table'
                         })
end