Class: NoteTagger::NoteTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- NoteTagger::NoteTag
- Defined in:
- lib/thought_tag.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ NoteTag
constructor
A new instance of NoteTag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ NoteTag
Returns a new instance of NoteTag.
23 24 25 26 |
# File 'lib/thought_tag.rb', line 23 def initialize(tag_name, markup, tokens) @markup = markup super end |
Instance Method Details
#render(context) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/thought_tag.rb', line 28 def render(context) site = context.registers[:site] converter = site.find_converter_instance(::Jekyll::Converters::Markdown) markup = converter.convert(@markup).strip[3..-1] result = "<div class=\"alert alert-note\" role=\"alert\">" result << "<p><span><strong>Note: </strong></span>#{markup}</div>" end |