nanoc-html-pipeline 0.2.1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f14a091248799f0d259741ca06fd4a3d03d66aa8
4
+ data.tar.gz: bc18d317ae0f8e2a5adf2f3cefdad1673418d47c
5
+ SHA512:
6
+ metadata.gz: ed73597a63b05ef14e3f5f54ef03ec1df7921557e102bb88461c6ed06e82f8ae8c1238501247178dbcf8b3c6a9c4b33fd2bd9dc7d5993e4504026d99f72b9093
7
+ data.tar.gz: 2ab16627773209dd79377c88f22188da014ca27f3581b72dac00aa04f60b11e8d1ac73f94689a1c5cd3fd48c13d4167611420c5c6d892175c280842d53506ec2
@@ -1,49 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc-html-pipeline (0.2.0)
4
+ nanoc-html-pipeline (0.2.1)
5
5
  html-pipeline (>= 1.0.0)
6
6
  nanoc (>= 3.1.6)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- activesupport (4.0.1)
12
- i18n (~> 0.6, >= 0.6.4)
13
- minitest (~> 4.2)
14
- multi_json (~> 1.3)
15
- thread_safe (~> 0.1)
16
- tzinfo (~> 0.3.37)
17
- atomic (1.1.14)
11
+ activesupport (4.2.4)
12
+ i18n (~> 0.7)
13
+ json (~> 1.7, >= 1.7.7)
14
+ minitest (~> 5.1)
15
+ thread_safe (~> 0.3, >= 0.3.4)
16
+ tzinfo (~> 1.1)
18
17
  colored (1.2)
19
- cri (2.4.0)
20
- colored (>= 1.2)
21
- gemoji (1.5.0)
22
- github-markdown (0.6.3)
23
- html-pipeline (1.1.0)
24
- activesupport (>= 2)
25
- nokogiri (~> 1.4)
26
- i18n (0.6.5)
27
- mini_portile (0.5.2)
28
- minitest (4.7.5)
29
- multi_json (1.8.2)
30
- nanoc (3.6.6)
18
+ cri (2.7.0)
19
+ colored (~> 1.2)
20
+ gemoji (2.1.0)
21
+ github-markdown (0.6.9)
22
+ html-pipeline (2.2.1)
23
+ activesupport (>= 2, < 5)
24
+ nokogiri (>= 1.4)
25
+ i18n (0.7.0)
26
+ json (1.8.3)
27
+ mini_portile (0.6.2)
28
+ minitest (5.8.1)
29
+ nanoc (3.8.0)
31
30
  cri (~> 2.3)
32
- nokogiri (1.6.0)
33
- mini_portile (~> 0.5.0)
31
+ nokogiri (1.6.6.2)
32
+ mini_portile (~> 0.6.0)
33
+ power_assert (0.2.4)
34
34
  rinku (1.7.3)
35
35
  sanitize (2.0.6)
36
36
  nokogiri (>= 1.4.4)
37
- thread_safe (0.1.3)
38
- atomic
39
- tzinfo (0.3.38)
37
+ test-unit (3.1.5)
38
+ power_assert
39
+ thread_safe (0.3.5)
40
+ tzinfo (1.2.2)
41
+ thread_safe (~> 0.1)
40
42
 
41
43
  PLATFORMS
42
44
  ruby
43
45
 
44
46
  DEPENDENCIES
45
- gemoji (~> 1.5.0)
47
+ gemoji (~> 2.0)
46
48
  github-markdown (~> 0.6.3)
47
49
  nanoc-html-pipeline!
48
50
  rinku (~> 1.7.3)
49
51
  sanitize (~> 2.0.6)
52
+ test-unit (~> 3.1.5)
53
+
54
+ BUNDLED WITH
55
+ 1.10.6
data/README.md CHANGED
@@ -3,22 +3,10 @@ HTML::Pipeline for Nanoc
3
3
 
4
4
  An [HTML::Pipeline](https://github.com/jch/html-pipeline) filter for [Nanoc](http://nanoc.stoneship.org/).
5
5
 
6
- Status
7
- ------
8
-
9
- Still under development.
10
-
11
6
  Installation
12
7
  ------------
13
8
 
14
- HTML::Pipeline requires ICU.
15
-
16
- ```bash
17
- brew install icu4c
18
- bundle config build.charlock_holmes --with-icu-dir=/usr/local/opt/icu4c
19
- ```
20
-
21
- In the near future, you'll be able to add this your Gemfile:
9
+ Add this your Gemfile:
22
10
 
23
11
  ```ruby
24
12
  gem 'nanoc-html-pipeline'
@@ -30,7 +18,9 @@ Usage
30
18
  In your nanoc Rules file, use an `:html_pipeline` filter to run content through a pipeline.
31
19
 
32
20
  ```ruby
33
- filter :html_pipeline,
34
- :pipeline => [:mardownfilter, :emojifilter, :syntaxhighlightfilter],
21
+ filter :html_pipeline,
22
+ :pipeline => [:markdownfilter, :emojifilter, :syntaxhighlightfilter],
35
23
  :asset_root => "http://your-domain.com/where/your/emoji/live"
36
24
  ```
25
+
26
+ Custom filters are supported; see the tests for an example.
@@ -1,6 +1,8 @@
1
- # encoding: utf-8
2
-
3
- require 'nanoc3'
1
+ begin
2
+ require 'nanoc3'
3
+ rescue LoadError
4
+ require 'nanoc'
5
+ end
4
6
  require 'html/pipeline'
5
7
 
6
8
  module NanocHtmlPipeline
@@ -1,4 +1,4 @@
1
1
 
2
2
  module NanocHtmlPipeline
3
- VERSION = '0.2.1'
4
- end
3
+ VERSION = '0.3.1'
4
+ end
@@ -8,11 +8,12 @@ Gem::Specification.new do |s|
8
8
  s.name = "nanoc-html-pipeline"
9
9
  s.version = NanocHtmlPipeline::VERSION
10
10
  s.platform = Gem::Platform::RUBY
11
- s.authors = ["Brent Fitzgerlad"]
11
+ s.authors = ["Brent Fitzgerald", "Garen Torikian"]
12
12
  s.email = ["b@brentfitzgerald.com"]
13
13
  s.summary = "nanoc filter for html-pipeline"
14
14
  s.description = "An adapter for using html-pipeline as a filter in your nanoc Rules"
15
15
  s.homepage = "https://github.com/burnto/nanoc-html-pipeline"
16
+ s.licenses = ['MIT']
16
17
 
17
18
  s.rubyforge_project = "nanoc-html-pipeline"
18
19
 
@@ -21,11 +22,12 @@ Gem::Specification.new do |s|
21
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
23
  s.require_paths = ["lib"]
23
24
 
24
- s.add_runtime_dependency('nanoc', '>= 3.1.6')
25
- s.add_runtime_dependency('html-pipeline', '>= 1.0.0')
25
+ s.add_runtime_dependency('nanoc', '~> 3.1')
26
+ s.add_runtime_dependency('html-pipeline', '~> 1.0')
26
27
 
27
- s.add_development_dependency('rinku', '~> 1.7.3')
28
- s.add_development_dependency('github-markdown', '~> 0.6.3')
29
- s.add_development_dependency('gemoji', '~> 1.5.0')
30
- s.add_development_dependency('sanitize', '~> 2.0.6')
28
+ s.add_development_dependency('test-unit', '~> 3.1')
29
+ s.add_development_dependency('rinku', '~> 1.7')
30
+ s.add_development_dependency('github-markdown', '~> 0.6')
31
+ s.add_development_dependency('gemoji', '~> 2.0')
32
+ s.add_development_dependency('sanitize', '~> 2.0')
31
33
  end
@@ -25,7 +25,7 @@ class NanocHtmlPipelineTest < Test::Unit::TestCase
25
25
 
26
26
  def test_params
27
27
  asset_root = "https://a248.e.akamai.net/assets.github.com/images/icons/"
28
- expected = "<p>an emoji <img class=\"emoji\" title=\":smile:\" alt=\":smile:\" src=\"#{asset_root}emoji/smile.png\" height=\"20\" width=\"20\" align=\"absmiddle\"></p>"
28
+ expected = "<p>an emoji <img class=\"emoji\" title=\":smile:\" alt=\":smile:\" src=\"#{asset_root}emoji/unicode/1f604.png\" height=\"20\" width=\"20\" align=\"absmiddle\"></p>"
29
29
  assert_equal expected,
30
30
  NanocHtmlPipeline::Filter.new.run("<p>an emoji :smile:</p>", :pipeline => [:emojifilter], :asset_root => asset_root)
31
31
  end
@@ -42,11 +42,23 @@ class NanocHtmlPipelineTest < Test::Unit::TestCase
42
42
  HTML::Pipeline::MarkdownFilter,
43
43
  HTML::Pipeline::SanitizationFilter,
44
44
  HTML::Pipeline::ImageMaxWidthFilter,
45
- HTML::Pipeline::HttpsFilter,
46
45
  HTML::Pipeline::MentionFilter
47
46
  ]
48
47
  pipeline = HTML::Pipeline.new(filters, CONTEXT.merge(:gfm => true))
49
48
  assert_equal pipeline.to_html(input),
50
49
  NanocHtmlPipeline::Filter.new.run(input, :pipeline => filters)
51
50
  end
51
+
52
+ def test_works_for_custom_filters
53
+ require 'support/new_pipeline'
54
+ input = "\n {{#tip}}\n **Tip**: Wow! \n {{/tip}}"
55
+
56
+ filters = [
57
+ NanocHtmlPipelineTestFilter::AddedMarkdownFilter,
58
+ HTML::Pipeline::MarkdownFilter
59
+ ]
60
+ pipeline = HTML::Pipeline.new(filters)
61
+
62
+ assert_equal pipeline.to_html(input), "<div class=\"alert tip\"><br>\n <strong>Tip</strong>: Wow! <br>\n </div>"
63
+ end
52
64
  end
@@ -0,0 +1,17 @@
1
+ require 'html/pipeline'
2
+
3
+ module NanocHtmlPipelineTestFilter
4
+ class AddedMarkdownFilter < HTML::Pipeline::MarkdownFilter
5
+
6
+ def call
7
+ html = super
8
+
9
+ format_callout!(html)
10
+ end
11
+
12
+ def format_callout!(html)
13
+ html.gsub!(/(?:<p>)?{{#(tip|warning|error)}}(?:<\/p>)?/, '<div class="alert \1">')
14
+ html.gsub!(/(?:<p>)?{{\/(tip|warning|error)}}(?:<\/p>)?/, '</div>')
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,112 +1,114 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-html-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: ruby
7
6
  authors:
8
- - Brent Fitzgerlad
7
+ - Brent Fitzgerald
8
+ - Garen Torikian
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-25 00:00:00.000000000 Z
12
+ date: 2015-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nanoc
16
16
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
17
  requirements:
19
- - - ! '>='
18
+ - - "~>"
20
19
  - !ruby/object:Gem::Version
21
- version: 3.1.6
20
+ version: '3.1'
22
21
  type: :runtime
23
22
  prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
- - - ! '>='
25
+ - - "~>"
28
26
  - !ruby/object:Gem::Version
29
- version: 3.1.6
27
+ version: '3.1'
30
28
  - !ruby/object:Gem::Dependency
31
29
  name: html-pipeline
32
30
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
31
  requirements:
35
- - - ! '>='
32
+ - - "~>"
36
33
  - !ruby/object:Gem::Version
37
- version: 1.0.0
34
+ version: '1.0'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
- - - ! '>='
39
+ - - "~>"
44
40
  - !ruby/object:Gem::Version
45
- version: 1.0.0
41
+ version: '1.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: test-unit
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.1'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.1'
46
56
  - !ruby/object:Gem::Dependency
47
57
  name: rinku
48
58
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
59
  requirements:
51
- - - ~>
60
+ - - "~>"
52
61
  - !ruby/object:Gem::Version
53
- version: 1.7.3
62
+ version: '1.7'
54
63
  type: :development
55
64
  prerelease: false
56
65
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
66
  requirements:
59
- - - ~>
67
+ - - "~>"
60
68
  - !ruby/object:Gem::Version
61
- version: 1.7.3
69
+ version: '1.7'
62
70
  - !ruby/object:Gem::Dependency
63
71
  name: github-markdown
64
72
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
73
  requirements:
67
- - - ~>
74
+ - - "~>"
68
75
  - !ruby/object:Gem::Version
69
- version: 0.6.3
76
+ version: '0.6'
70
77
  type: :development
71
78
  prerelease: false
72
79
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
80
  requirements:
75
- - - ~>
81
+ - - "~>"
76
82
  - !ruby/object:Gem::Version
77
- version: 0.6.3
83
+ version: '0.6'
78
84
  - !ruby/object:Gem::Dependency
79
85
  name: gemoji
80
86
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
87
  requirements:
83
- - - ~>
88
+ - - "~>"
84
89
  - !ruby/object:Gem::Version
85
- version: 1.5.0
90
+ version: '2.0'
86
91
  type: :development
87
92
  prerelease: false
88
93
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
94
  requirements:
91
- - - ~>
95
+ - - "~>"
92
96
  - !ruby/object:Gem::Version
93
- version: 1.5.0
97
+ version: '2.0'
94
98
  - !ruby/object:Gem::Dependency
95
99
  name: sanitize
96
100
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
101
  requirements:
99
- - - ~>
102
+ - - "~>"
100
103
  - !ruby/object:Gem::Version
101
- version: 2.0.6
104
+ version: '2.0'
102
105
  type: :development
103
106
  prerelease: false
104
107
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
108
  requirements:
107
- - - ~>
109
+ - - "~>"
108
110
  - !ruby/object:Gem::Version
109
- version: 2.0.6
111
+ version: '2.0'
110
112
  description: An adapter for using html-pipeline as a filter in your nanoc Rules
111
113
  email:
112
114
  - b@brentfitzgerald.com
@@ -114,7 +116,7 @@ executables: []
114
116
  extensions: []
115
117
  extra_rdoc_files: []
116
118
  files:
117
- - .gitignore
119
+ - ".gitignore"
118
120
  - Gemfile
119
121
  - Gemfile.lock
120
122
  - README.md
@@ -124,29 +126,31 @@ files:
124
126
  - lib/nanoc-html-pipeline/version.rb
125
127
  - nanoc-html-pipeline.gemspec
126
128
  - test/nanoc_html_pipeline_test.rb
129
+ - test/support/new_pipeline.rb
127
130
  homepage: https://github.com/burnto/nanoc-html-pipeline
128
- licenses: []
131
+ licenses:
132
+ - MIT
133
+ metadata: {}
129
134
  post_install_message:
130
135
  rdoc_options: []
131
136
  require_paths:
132
137
  - lib
133
138
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
139
  requirements:
136
- - - ! '>='
140
+ - - ">="
137
141
  - !ruby/object:Gem::Version
138
142
  version: '0'
139
143
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
144
  requirements:
142
- - - ! '>='
145
+ - - ">="
143
146
  - !ruby/object:Gem::Version
144
147
  version: '0'
145
148
  requirements: []
146
149
  rubyforge_project: nanoc-html-pipeline
147
- rubygems_version: 1.8.23
150
+ rubygems_version: 2.4.8
148
151
  signing_key:
149
- specification_version: 3
152
+ specification_version: 4
150
153
  summary: nanoc filter for html-pipeline
151
154
  test_files:
152
155
  - test/nanoc_html_pipeline_test.rb
156
+ - test/support/new_pipeline.rb