Sha256: 23204c62ec36297b290a2421b8305e280d45f6423c9a85816f277aa92a9ab832

Contents?: true

Size: 733 Bytes

Versions: 14

Compression:

Stored size: 733 Bytes

Contents

# jekyll_inline_highlight
#
# A Liquid tag for inline syntax highlighting in Jekyll
#
# https://github.com/bdesham/inline_highlight
#
# Copyright (c) 2014-2015, Tom Preston-Werner and Benjamin Esham
# See README.md for full copyright information.

module Jekyll
	class HighlightWithDivBlock < Tags::HighlightBlock

		def add_code_tag(code)
			# code_attributes = [
      #     "class=\"language-#{@lang.to_s.tr("+", "-")}\"",
      #     "data-lang=\"#{@lang}\"",
      #   ].join(" ")
			code_attributes = "class=\"highlighter-rouge\""
      "<div #{code_attributes}><pre class=\"highlight\"><code>"\
      "#{code.chomp}</code></pre></div>"
		end
	end
end

Liquid::Template.register_tag('highlight', Jekyll::HighlightWithDivBlock)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
blocks-4.0.1 docs/_plugins/highlight_with_div.rb
blocks-4.0.0 docs/_plugins/highlight_with_div.rb
blocks-4.0.0.rc2 docs/_plugins/highlight_with_div.rb
blocks-4.0.0.rc1 docs/_plugins/highlight_with_div.rb
blocks-3.0.4 docs/_plugins/highlight_with_div.rb
blocks-3.0.3 docs/_plugins/highlight_with_div.rb
blocks-3.0.2 docs/_plugins/highlight_with_div.rb
blocks-3.0.1 docs/_plugins/highlight_with_div.rb
blocks-3.0.0 docs/_plugins/highlight_with_div.rb
blocks-3.0.0.rc9 docs/_plugins/highlight_with_div.rb
blocks-3.0.0.rc8 docs/_plugins/highlight_with_div.rb
blocks-3.0.0.rc7 docs/_plugins/highlight_with_div.rb
blocks-3.0.0.rc6 docs/_plugins/highlight_with_div.rb
blocks-3.0.0.rc5 docs/_plugins/highlight_with_div.rb