Class: NoteTagger::NoteTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/thought_tag.rb

Instance Method Summary collapse

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