jekyll_inline_highlight 2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/jekyll_inline_highlight.rb +25 -0
  3. metadata +58 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 068731464cb747f7ac90e8b4000e82c82bf05fdd
4
+ data.tar.gz: bfd1179136afe202fccfd7502ea352f68bca2be7
5
+ SHA512:
6
+ metadata.gz: 0ba7c3273a141659cfa6b9b8850bd11195e53060454a6f2d3b41bd641b1aa2c60d540d75951e39e80641e36d675ab407067479f0e00fc4fed9eef7a4177e66b3
7
+ data.tar.gz: 4f130e33dc3d7bd8d91bea6181b14fe53b4bd59f075836c1e87346c4f59565b69fdd5192a2de51332cc8a05293d3383284d27e2f359e50403a0ced3a25b51704
@@ -0,0 +1,25 @@
1
+ # jekyll_inline_highlight
2
+ #
3
+ # A Liquid tag for inline syntax highlighting in Jekyll
4
+ #
5
+ # https://github.com/bdesham/inline_highlight
6
+ #
7
+ # Copyright (c) 2014-2015, Tom Preston-Werner and Benjamin Esham
8
+ # See README.md for full copyright information.
9
+
10
+ module Jekyll
11
+ class InlineHighlightBlock < Tags::HighlightBlock
12
+
13
+ def add_code_tag(code)
14
+ code = code.sub(/<div.*?><pre>\n*/, '<code class="highlight language-' + @lang.to_s.gsub("+", "-") + '" data-lang="' + @lang.to_s + '">')
15
+ code = code.sub(/\n*<\/pre><\/div>/, "</code>")
16
+ code.strip
17
+ end
18
+
19
+ def render(context)
20
+ super.strip
21
+ end
22
+ end
23
+ end
24
+
25
+ Liquid::Template.register_tag('ihighlight', Jekyll::InlineHighlightBlock)
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll_inline_highlight
3
+ version: !ruby/object:Gem::Version
4
+ version: '2.0'
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Esham
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
27
+ description: A Liquid tag for inline syntax highlighting in Jekyll.
28
+ email: benjamin@esham.io
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/jekyll_inline_highlight.rb
34
+ homepage: https://github.com/bdesham/inline_highlight
35
+ licenses:
36
+ - Public domain
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 2.4.2
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Liquid tag for inline syntax highlighting in Jekyll.
58
+ test_files: []