1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-02 00:06:46 +02:00

plugins: add new example doodad hackery bullshitery and markdown block plugin for markdown includes

This commit is contained in:
Mark Otto
2014-07-09 20:00:22 -07:00
parent 2846850117
commit be877bc691
3 changed files with 103 additions and 18 deletions

View File

@@ -0,0 +1,20 @@
module Jekyll
class MarkdownBlock < Liquid::Block
alias_method :render_block, :render
def initialize(tag_name, markup, tokens)
super
end
# Uses the default Jekyll markdown parser to
# parse the contents of this block
#
def render(context)
site = context.registers[:site]
converter = site.getConverterImpl(::Jekyll::Converters::Markdown)
converter.convert(render_block(context))
end
end
end
Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)