diff options
| author | Mark Otto <[email protected]> | 2014-07-09 20:00:22 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-07-09 20:00:22 -0700 |
| commit | be877bc691190909b587454e7bb7c89818762338 (patch) | |
| tree | 6c790b89a9cb4f61109fde057be8d3b9c6e7d822 /docs/_plugins/markdown-block.rb | |
| parent | 284685011785ae916b8ebf0811f29da0c6105fe6 (diff) | |
| download | bootstrap-be877bc691190909b587454e7bb7c89818762338.tar.xz bootstrap-be877bc691190909b587454e7bb7c89818762338.zip | |
plugins: add new example doodad hackery bullshitery and markdown block plugin for markdown includes
Diffstat (limited to 'docs/_plugins/markdown-block.rb')
| -rw-r--r-- | docs/_plugins/markdown-block.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/_plugins/markdown-block.rb b/docs/_plugins/markdown-block.rb new file mode 100644 index 000000000..6aa761585 --- /dev/null +++ b/docs/_plugins/markdown-block.rb @@ -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) |
