Module: ReleaseNotes::ApplicationHelper

Defined in:
app/helpers/release_notes/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#markup(markdown) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/release_notes/application_helper.rb', line 5

def markup(markdown)
  extension_options = [:no_intra_emphasis => true,
                       :tables => true,
                       :fenced_code_blocks => true,
                       :autolink => true,
                       :strikethrough => true,
                       :space_after_headers => true,
                       :superscript => true,
                       :underline => true,
                       :highlight => true,
                       :quote => true,
                       :footnotes => true]

  render_options = [:filter_html => false,
                    :hard_wrap => true,
                    :prettify => true]

  renderer = Redcarpet::Render::HTML.new(*render_options)
  mark = Redcarpet::Markdown.new(renderer, *extension_options)

  mark.render(markdown)
end

#release_note_indicatorObject



28
29
30
31
32
# File 'app/helpers/release_notes/application_helper.rb', line 28

def release_note_indicator
  latest = ReleaseNotes.release_note_model.constantize.last
  
  link_to "#{ReleaseNotes.app_name} v#{latest.version}", release_notes.version_path(:version => latest.version.gsub('.','_')), 'data-no-turbolink' => true unless latest.nil?
end