I'm working on a Jekyll tag plugin for my Octopress site to help me make a 'note' element. I just want to be able to highlight a piece of information on my blog as a side note, like this.
The problem is, I can't figure out how to get the contents of this tag to be processed (i.e. Markdown or Textile). The above image is only achieved is I actually make my links with html code. Here is how it ends up turning out when I use markdown in the contents.
In my post, I'm writing the contents of this like so.
{% note %}
This is the third post in my Start to Finish series. Last time I talked about [Git](/blog/2013/09/25/getting-started-with-git/).
{% endnote %}
Here is my plugin code. It's based off of the image tag code, and there's really not a lot to it.
module Jekyll
class NoteTag < Liquid::Block
@title = nil
def initialize(tag_name, markup, tokens)
@title = markup
super
end
def render(context)
output = super(context)
title = "Note"
if !@title.empty?
title += ": #{@title}"
end
"</section>\n<div class=\"note\"><span class=\"title\">#{title}</span>#{output}</div>\n<section>"
end
end
end
Liquid::Template.register_tag('note', Jekyll::NoteTag)
Do you have any idea how I can use a converter on the contents of this tag? I generally use Markdown for my posts, but I'd like to release this plugin for others so I'd like it to be dynamic just like the rest of Jekyll.