Class: Epos::HtmlFormatter
- Inherits:
-
Object
- Object
- Epos::HtmlFormatter
- Defined in:
- lib/epos/html-formatter.rb
Instance Method Summary collapse
- #format(entry) ⇒ Object
-
#initialize(unmarked: false, compact: false) ⇒ HtmlFormatter
constructor
A new instance of HtmlFormatter.
- #style ⇒ Object
Constructor Details
#initialize(unmarked: false, compact: false) ⇒ HtmlFormatter
Returns a new instance of HtmlFormatter.
9 10 11 12 13 14 15 16 |
# File 'lib/epos/html-formatter.rb', line 9 def initialize(unmarked: false, compact: false) @unmarked = unmarked @string_index = compact ? -2 : -1 @parser = TextParser.new @html_base = File.join(File.dirname(__FILE__), "html") load_templates() end |
Instance Method Details
#format(entry) ⇒ Object
18 19 20 |
# File 'lib/epos/html-formatter.rb', line 18 def format(entry) render(:entry, entry) end |
#style ⇒ Object
22 23 24 |
# File 'lib/epos/html-formatter.rb', line 22 def style File.read(File.join(@html_base, "style.css")) end |