# Made by me :) # Feel free to use if you give credit require "base64" module Jekyll module Tags class CDTag < Liquid::Block def initialize(tag_name, markup, tokens) super arr = markup.split("s:") if arr[1] != nil @scale = arr[1].to_i else @scale = 60 end @caption = arr[0].strip end def render(context) site = context.registers[:site] converter = site.find_converter_instance(::Jekyll::Converters::Markdown) caption = converter.convert(@caption).gsub(/<\/?p[^>]*>/, '').chomp code = super(context) latex = < A commutative diagram
#{@caption}
EOF end "
#{caption}#{body}
" end end end end Liquid::Template.register_tag('cd', Jekyll::Tags::CDTag)