Class: Rain::Pages

Inherits:
Object
  • Object
show all
Includes:
LowType
Defined in:
lib/pages/pages.rb

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata:) ⇒ Pages

Returns a new instance of Pages.



15
16
17
# File 'lib/pages/pages.rb', line 15

def initialize(metadata:)
  @url_paths = .url_paths
end

Instance Attribute Details

#url_pathsObject (readonly)

Returns the value of attribute url_paths.



11
12
13
# File 'lib/pages/pages.rb', line 11

def url_paths
  @url_paths
end

Instance Method Details

#process(file_path:) ⇒ Object



19
20
21
22
23
24
# File 'lib/pages/pages.rb', line 19

def process(file_path:)
  , text = parse_file(file_path:)
  html = Kramdown::Document.new(text, input: 'GFM', syntax_highlighter: 'rouge').to_html

  Result.new(, html)
end