Sha256: d44951386250368c3be51afae965eebb215dfd5cbe5e06223e0e1c2213d42bc5

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

module ThoughtTagger

  class ThoughtTag < Liquid::Tag
    def initialize(tag_name, markup, tokens)
      @markup = markup
      super
    end

    def render(context)
      site = context.registers[:site]
      converter = site.find_converter_instance(::Jekyll::Converters::Markdown)

      result = "<div class=\"alert alert-info\" role=\"alert\">#{converter.convert(@markup).strip}</div>"
    end
  end
end

Liquid::Template.register_tag('thought', ThoughtTagger::ThoughtTag)

module NoteTagger

  class NoteTag < Liquid::Tag
    def initialize(tag_name, markup, tokens)
      @markup = markup
      super
    end

    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
  end
end

Liquid::Template.register_tag('note', NoteTagger::NoteTag)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jekyll-lab-notebook-plugins-0.1.7 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.6 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.5 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.4 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.3 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.2 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.1 lib/thought_tag.rb
jekyll-lab-notebook-plugins-0.1.0 lib/thought_tag.rb