octopress-codefence 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/lib/octopress-codefence/version.rb +1 -1
- data/lib/octopress-codefence.rb +7 -7
- data/octopress-codefence.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 545e619f27984c54373639fcb22e34456e405680
|
4
|
+
data.tar.gz: 9e36dd499d95b870c29a5ae44a548fb3f7d8d25e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09f4855f3271d891b8b0330b6293306e6017998c91e0b8bf58252f3ad5dc9af18aad277ec95cb03be69faeb570265702332d750c13e69ceba44f5cf5eb01f8a5
|
7
|
+
data.tar.gz: b2a3477215b68087ee9194c40aecaf8f1761122043b323edaf4edd09bd41000d8b4c8a49fc76bfb82f7ddefa9082d650cde8841257cd98c2de94727cfa59725c
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.4.0
|
4
|
+
- Switched to the new octopress-code-highlighter gem.
|
5
|
+
|
3
6
|
## 1.3.2
|
4
|
-
- Removed test files from gem pkg
|
7
|
+
- Removed test files from gem pkg.
|
5
8
|
|
6
9
|
## 1.3.1
|
7
10
|
- Changed repo homepage url in gemspec.
|
@@ -16,7 +19,7 @@
|
|
16
19
|
- Updated Octopress pygments, adding default Liquid escape.
|
17
20
|
|
18
21
|
## 1.1.0
|
19
|
-
- Added support for language aliases in Jekyll config
|
22
|
+
- Added support for language aliases in Jekyll config.
|
20
23
|
|
21
24
|
## 1.0.0
|
22
25
|
- Initial release
|
data/lib/octopress-codefence.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'octopress-codefence/version'
|
2
|
-
require 'octopress-
|
2
|
+
require 'octopress-code-highlighter'
|
3
3
|
require 'jekyll-page-hooks'
|
4
4
|
|
5
5
|
module Jekyll
|
6
6
|
class Codefence < PageHooks
|
7
7
|
def pre_render(page)
|
8
|
-
page.content = Octopress::Codefence.new(page.content, page.ext, page.site.config['
|
8
|
+
page.content = Octopress::Codefence.new(page.content, page.ext, page.site.config['code_aliases']).render
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -30,9 +30,9 @@ module Octopress
|
|
30
30
|
code = $2.to_s
|
31
31
|
begin
|
32
32
|
get_code(code, get_options(markup))
|
33
|
-
rescue
|
33
|
+
rescue => e
|
34
34
|
markup = "```#{markup}"
|
35
|
-
|
35
|
+
CodeHighlighter.highlight_failed(e, "```[language] [title] [url] [link text] [linenos:false] [start:#] [mark:#,#-#]\ncode\n```", markup, code)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -40,7 +40,7 @@ module Octopress
|
|
40
40
|
|
41
41
|
def get_options(markup)
|
42
42
|
defaults = { escape: true }
|
43
|
-
clean_markup =
|
43
|
+
clean_markup = CodeHighlighter.clean_markup(markup)
|
44
44
|
|
45
45
|
if clean_markup =~ AllOptions
|
46
46
|
defaults = {
|
@@ -55,13 +55,13 @@ module Octopress
|
|
55
55
|
title: $2
|
56
56
|
}
|
57
57
|
end
|
58
|
-
|
58
|
+
CodeHighlighter.parse_markup(markup, defaults)
|
59
59
|
end
|
60
60
|
|
61
61
|
|
62
62
|
def get_code(code, options)
|
63
63
|
options[:aliases] = @aliases || {}
|
64
|
-
code =
|
64
|
+
code = CodeHighlighter.highlight(code, options)
|
65
65
|
code = "<notextile>#{code}</notextile>" if !@ext.nil? and @ext.match(/textile/)
|
66
66
|
code
|
67
67
|
end
|
data/octopress-codefence.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.homepage = "https://github.com/octopress/codefence"
|
14
14
|
gem.license = "MIT"
|
15
15
|
|
16
|
-
gem.add_runtime_dependency 'octopress-
|
16
|
+
gem.add_runtime_dependency 'octopress-code-highlighter', '~> 3.0.1'
|
17
17
|
gem.add_runtime_dependency 'jekyll-page-hooks', '>= 1.0.2'
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($/).reject {|f| f =~ /^test\// }
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-codefence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: octopress-
|
14
|
+
name: octopress-code-highlighter
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll-page-hooks
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|