Class: Nesta::Page

Inherits:
FileModel
  • Object
show all
Defined in:
lib/nesta-contentfocus-extensions/page.rb

Instance Method Summary collapse

Instance Method Details

#convert_to_html(format, scope, text) ⇒ Object



4
5
6
7
8
# File 'lib/nesta-contentfocus-extensions/page.rb', line 4

def convert_to_html(format, scope, text)
  text = add_p_tags_to_haml(text) if @format == :haml
  template = Tilt[format].new(nil, 1, markdown_options) { text }
  template.render(scope)
end

#intro_imageObject



10
11
12
# File 'lib/nesta-contentfocus-extensions/page.rb', line 10

def intro_image
  return ('Intro Image') if ('Intro Image')
end

#markdown_optionsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/nesta-contentfocus-extensions/page.rb', line 14

def markdown_options
  {
    auto_id_stripping: true,
    auto_ids: true,
    syntax_highlighter: :rouge,
    syntax_highlighter_opts: syntax_highlight_options
  }
  #{
  #  autolink: true,
  #  disable_indented_code_blocks: true,
  #  fenced_code_blocks: true,
  #  footnotes: true,
  #  highlight: true,
  #  no_intra_emphasis: true,
  #  quote: true,
  #  strikethrough: true,
  #  syntax_highlighter: :rouge,
  #  superscript: true,
  #  tables: true }
end

#syntax_highlight_optionsObject



35
36
37
38
39
40
# File 'lib/nesta-contentfocus-extensions/page.rb', line 35

def syntax_highlight_options
  {
    line_numbers: true,
    css_class: 'hll'
  }
end