Class: MDV::Document
- Inherits:
-
Object
- Object
- MDV::Document
- Defined in:
- lib/mdv/document.rb
Overview
Markdown document class
Instance Method Summary collapse
- #base_uri ⇒ Object
- #html ⇒ Object
-
#initialize(file) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(file) ⇒ Document
Returns a new instance of Document.
8 9 10 |
# File 'lib/mdv/document.rb', line 8 def initialize(file) @file = file end |
Instance Method Details
#base_uri ⇒ Object
12 13 14 |
# File 'lib/mdv/document.rb', line 12 def base_uri @base_uri ||= "file://#{fullpath}" end |
#html ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/mdv/document.rb', line 16 def html content = File.read(fullpath) Commonmarker.to_html(content, options: { render: {hardbreaks: false}, extension: {tagfilter: true, autolink: true, table: true, strikethrough: true} }, plugins: {}) end |