diff options
| author | Mark Otto <[email protected]> | 2015-04-16 18:54:17 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2015-04-16 18:54:17 -0700 |
| commit | 0ab1576ae227663d9e97040a486e1ca2818bab1e (patch) | |
| tree | d852285be3a39c9cc73d17bea3602a0b62c0faad /docs/_plugins | |
| parent | 605990400eb470e50bcdfd3643b8cc10f2684836 (diff) | |
| parent | 06c2862d257935871fc846670148c8767e2f6a82 (diff) | |
| download | bootstrap-0ab1576ae227663d9e97040a486e1ca2818bab1e.tar.xz bootstrap-0ab1576ae227663d9e97040a486e1ca2818bab1e.zip | |
Merge branch 'v4' of https://github.com/twbs/derpstrap into v4
Diffstat (limited to 'docs/_plugins')
| -rw-r--r-- | docs/_plugins/callout.rb | 29 | ||||
| -rw-r--r-- | docs/_plugins/highlight_alt.rb | 2 |
2 files changed, 30 insertions, 1 deletions
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)) + "<div class=\"bd-callout bd-callout-#{@type}\">#{output}</div>" + end + end + end +end + +Liquid::Template.register_tag('callout', Jekyll::Tags::CalloutTag) diff --git a/docs/_plugins/highlight_alt.rb b/docs/_plugins/highlight_alt.rb index 9d1b414bb..5b877ee36 100644 --- a/docs/_plugins/highlight_alt.rb +++ b/docs/_plugins/highlight_alt.rb @@ -55,7 +55,7 @@ eos end def example(output) - "<div class=\"bs-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>" + "<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>" end def render_rouge(code) |
