Class: ReadmeScore::Document::Parser
- Inherits:
-
Object
- Object
- ReadmeScore::Document::Parser
- Defined in:
- lib/readme-score/document/parser.rb
Instance Method Summary collapse
-
#initialize(markdown) ⇒ Parser
constructor
A new instance of Parser.
- #parser ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(markdown) ⇒ Parser
Returns a new instance of Parser.
4 5 6 |
# File 'lib/readme-score/document/parser.rb', line 4 def initialize(markdown) @markdown = markdown end |
Instance Method Details
#parser ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/readme-score/document/parser.rb', line 12 def parser @@parser ||= Redcarpet::Markdown.new( Redcarpet::Render::HTML, no_intra_emphasis: true, autolink: true, fenced_code_blocks: true, tables: true, strikethrough: true ) end |
#to_html ⇒ Object
8 9 10 |
# File 'lib/readme-score/document/parser.rb', line 8 def to_html parser.render(@markdown) end |