]>
git.ipfire.org Git - ipfire.org.git/blob - static/scss/bootstrap-4.0.0-alpha.6/docs/_plugins/callout.rb
1 # Source: https://stackoverflow.com/questions/19169849/how-to-get-markdown-processed-content-in-jekyll-tag-plugin
5 class CalloutTag
< Liquid
::Block
7 def initialize(tag_name
, type
, tokens
)
10 if %w(info danger warning
).include?(type
)
13 puts
"#{type} callout not supported. Defaulting to info"
19 site
= context
.registers
[:site]
20 converter
= site
.find_converter_instance(::Jekyll::Converters::Markdown)
21 output
= converter
.convert(super(context
))
22 "<div class=\"bd-callout bd-callout-#{@type}\">#{output}</div>"
28 Liquid
::Template.register_tag('callout', Jekyll
::Tags::CalloutTag)