From 466d36e54175ee00927d6518d9481acd2d210590 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 16 Apr 2015 16:56:40 -0700 Subject: Redo all our callouts with the custom callout plugin - Replaces manual use of .bd-callout with {% callout [type] %} - Rearranged some callouts for proximity to others - Turned long lists of callouts--like those on tooltips, plugings, etc--into a list because holy shit that's overwhelming --- docs/_plugins/callout.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/_plugins/callout.rb (limited to 'docs/_plugins') diff --git a/docs/_plugins/callout.rb b/docs/_plugins/callout.rb new file mode 100644 index 000000000..29ecbc99d --- /dev/null +++ b/docs/_plugins/callout.rb @@ -0,0 +1,29 @@ +# Source: http://stackoverflow.com/questions/19169849/how-to-get-markdown-processed-content-in-jekyll-tag-plugin + +module Jekyll + module Tags + class CalloutTag < Liquid::Block + + def initialize(tag_name, type, tokens) + super + @type = type + if type == "danger" + @type = "danger" + elsif type == "warning" + @type = "warning" + elsif type == "info" + @type = "info" + end + end + + def render(context) + site = context.registers[:site] + converter = site.getConverterImpl(::Jekyll::Converters::Markdown) + output = converter.convert(super(context)) + "
#{output}
" + end + end + end +end + +Liquid::Template.register_tag('callout', Jekyll::Tags::CalloutTag) -- cgit v1.2.3