Module: MetadataPresenter::ApplicationHelper

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

Instance Method Summary collapse

Instance Method Details

#m(text) ⇒ Object Also known as: to_markdown

Renders markdown given a text.

Examples:

<%=m '# Some markdown' %>


22
23
24
# File 'app/helpers/metadata_presenter/application_helper.rb', line 22

def m(text)
  (Kramdown::Document.new(text).to_html).html_safe
end

#main_h1(component) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/metadata_presenter/application_helper.rb', line 3

def main_h1(component)
  if component.legend.present?
    (:legend, class: 'govuk-fieldset__legend govuk-fieldset__legend--l') do
      (:h1, class: 'govuk-heading-xl') do
        component.legend
      end
    end
  else
    (:h1, class: 'govuk-heading-xl') do
      component.label
    end
  end
end