Class: Gimli::Markup::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/gimli/markup/renderer.rb

Overview

Contains functionality to render html from a markup file

Instance Method Summary collapse

Constructor Details

#initialize(file, do_remove_yaml_front_matter = false) ⇒ Gimli::Markup

Initialize a new Markup object.

Parameters:

  • file (Gimli::File)

    The Gimli::File to process

  • do_remove_yaml_front_matter (Boolean) (defaults to: false)

    Should we remove the front matter?



14
15
16
17
18
19
20
21
# File 'lib/gimli/markup/renderer.rb', line 14

def initialize(file, do_remove_yaml_front_matter = false)
  @file = file
  @do_remove_yaml_front_matter = do_remove_yaml_front_matter

  @data = file.data
  @code = Code.new
  @yaml_frontmatter_remover = YamlFrontmatterRemover.new
end

Instance Method Details

#renderString

Render the content with Gollum wiki syntax on top of the file’s own markup language.

Returns:

  • (String)

    The formatted data



27
28
29
30
31
32
33
# File 'lib/gimli/markup/renderer.rb', line 27

def render
  prepare_data
  render_data
  post_process_data

  return @data
end