Module: HelpKit::ArticleHelper

Defined in:
app/helpers/help_kit/article_helper.rb

Instance Method Summary collapse

Instance Method Details

#category_breadcrumb(current_category, opts = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/help_kit/article_helper.rb', line 16

def category_breadcrumb(current_category, opts = {})
   :ul do
    unless opts[:hide_home]
      concat (:li, link_to(icon('home'), help_kit.landing_path))
    end
    current_category.self_and_ancestors.each do |category|
      concat (:li, link_to(category.name, [help_kit, category]))
    end
  end
end

#render_markdown(content) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/helpers/help_kit/article_helper.rb', line 26

def render_markdown(content)
  markdown = Redcarpet::Markdown.new(PygmentizeHTML,
                                     autolink: true,
                                     no_intra_emphasis: true,
                                     superscript: true,
                                     footnotes: true,
                                     tables: true,
                                     fenced_code_blocks: true)
  markdown.render(content)


end