octopress-quote-tag 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf32ad35ede7ea135cbda6b9b65548ca16303b9c
4
- data.tar.gz: 75db62adaca135e19db50710dd3f670f4747650c
3
+ metadata.gz: 4d41cf529a9e930c6661f032b4a29011c7e32dbd
4
+ data.tar.gz: 9a1e6921a4c2bebdcfaad6c8f0fdd759d0618ee4
5
5
  SHA512:
6
- metadata.gz: 69260e9d525908f84fb26544836f1ef37e9e5c9ac8f8a4c48539bd5143f490ad9e37d029c097f2262299b58f59892820ab0b80c564ddb1ae4860d76f594c980e
7
- data.tar.gz: 0df5096c0a437c5c7e85d2e22158d2c2f924c7bac573c9190418fabc6de57496773e986b5770207b2df2c878191e1249084372d366a1d298b9f99128b385973f
6
+ metadata.gz: d9f4b7769959c59ea4b30095700f636e4832fd441e7ec2cf5d0b0986108c1f438bc044e3283835589d6aeef4546f2633359faab0b0f103bc9ef1be0dc4b2ba8e
7
+ data.tar.gz: c468888243a149896c4473ed63e481454b7e418c9936c5a6ebaa63157dcf6674e8a65665e6042286093311063bf8490299e8e8e0216a60df247cbe164959747f
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.3 (2015-01-08)
4
+
5
+ - Minor refactoring.
6
+
3
7
  ### 1.0.2 (2015-01-07)
4
8
 
5
9
  - UTF-8 encoding fix for pre 2.0 ruby.
data/README.md CHANGED
@@ -32,9 +32,9 @@ Then add the gem to your Jekyll configuration.
32
32
  ## Usage
33
33
 
34
34
  ```
35
- {% blockquote [options] %}
35
+ {% quote [options] %}
36
36
  Some great quote
37
- {% endblockquote %}
37
+ {% endquote %}
38
38
  ```
39
39
 
40
40
  Options:
@@ -49,7 +49,7 @@ Options:
49
49
  ### Example
50
50
 
51
51
  ```
52
- {% quote author:"Bob McAwesome" url:"http://example.com" title:"Great Wisdom" %}
52
+ {% quote author:"Bob McAwesome" url:http://example.com title:"Great Wisdom" %}
53
53
  Never pet a burning dog.
54
54
  {% endquote %}
55
55
  ```
@@ -68,8 +68,8 @@ Never pet a burning dog.
68
68
 
69
69
  ## Why?
70
70
 
71
- In Markdown Blockquotes are simple but attribution isn't.
72
- Also, if you want semantic HTML, you'll have to write your own.
71
+ In Markdown Blockquotes are simple but attribution isn't. Also,
72
+ writing the semantic HTML is tricky and easy to forget.
73
73
 
74
74
  ```
75
75
  > Some cool quote
@@ -83,7 +83,6 @@ Also, if you want semantic HTML, you'll have to write your own.
83
83
 
84
84
  But what if you want to cite an author or a source?
85
85
 
86
-
87
86
  ```
88
87
  > Some cool quote
89
88
  > - Bob McAwesome
@@ -101,3 +100,14 @@ Which doesn't work at all since a browser will see it as:
101
100
  ```
102
101
  Some cool quote - Bob McAwesome
103
102
  ```
103
+
104
+ And now you know.
105
+
106
+ ## Contributing
107
+
108
+ 1. Fork it ( https://github.com/octopress/quote-tag/fork )
109
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
110
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
111
+ 4. Push to the branch (`git push origin my-new-feature`)
112
+ 5. Create a new Pull Request
113
+
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
2
  require "octopress-quote-tag/version"
3
+ require "octopress-quote-tag/utils"
3
4
  require "jekyll"
4
5
 
5
6
  module Octopress
6
7
  module Tags
7
- module QuoteTag
8
+ module Quote
8
9
  class Tag < Liquid::Block
9
10
  FullCiteWithTitle = /(\S.*)\s+(https?:\/\/)(\S+)\s+(.+)/i
10
11
  FullCite = /(\S.*)\s+(https?:\/\/)(\S+)/i
@@ -62,29 +63,13 @@ module Octopress
62
63
  end
63
64
 
64
65
  def render(context)
65
- quote = "<blockquote>#{parse_content(super, context).strip}</blockquote>"
66
+ quote = "<blockquote>#{Utils.parse_content(super, context).strip}</blockquote>"
66
67
  if cap = figcaption
67
68
  quote = "<figure class='quote'>#{quote}#{cap}</figure>"
68
69
  end
69
70
  quote
70
71
  end
71
72
 
72
- def parse_content(content, context)
73
- path = context.environments.first['page']['path']
74
- ext = File.extname(path[1..-1])[1..-1]
75
- site = context.registers[:site]
76
- mdext = site.config['markdown_ext']
77
- txext = site.config['textile_ext']
78
-
79
- if mdext.include? ext
80
- site.getConverterImpl(Jekyll::Converters::Markdown).convert(content)
81
- elsif txext.include? ext
82
- site.getConverterImpl(Jekyll::Converters::Textile).convert(content)
83
- else
84
- "<p>" + content.strip.gsub(/\n\n/, "<p>\n\n</p>") + "</p>"
85
- end
86
- end
87
-
88
73
  def figcaption
89
74
  if @options['author'] || @options['url'] || @options['title']
90
75
  "<figcaption class='quote-source'>#{author || ''}#{title || ''}</figcaption>"
@@ -127,17 +112,17 @@ module Octopress
127
112
  end
128
113
  end
129
114
 
130
- Liquid::Template.register_tag('blockquote', Octopress::Tags::QuoteTag::Tag)
131
- Liquid::Template.register_tag('quote', Octopress::Tags::QuoteTag::Tag)
115
+
116
+ Liquid::Template.register_tag('blockquote', Octopress::Tags::Quote::Tag)
117
+ Liquid::Template.register_tag('quote', Octopress::Tags::Quote::Tag)
132
118
 
133
119
  if defined? Octopress::Docs
134
120
  Octopress::Docs.add({
135
121
  name: "Octopress Quote Tag",
136
122
  gem: "octopress-quote-tag",
137
- description: "Easy HTML5 blockquotes for Jekyll sites.",
123
+ description: "Easy HTML5 blockquotes for Jekyll sites",
138
124
  path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
139
125
  source_url: "https://github.com/octopress/quote-tag",
140
- version: Octopress::Tags::QuoteTag::VERSION
126
+ version: Octopress::Tags::Quote::VERSION
141
127
  })
142
128
  end
143
-
@@ -0,0 +1,24 @@
1
+ module Octopress
2
+ module Tags
3
+ module Quote
4
+ module Utils
5
+ def self.parse_content(content, context)
6
+ path = context.environments.first['page']['path']
7
+ ext = File.extname(path[1..-1])[1..-1]
8
+ site = context.registers[:site]
9
+ mdext = site.config['markdown_ext']
10
+ txext = site.config['textile_ext']
11
+
12
+ if mdext.include? ext
13
+ site.getConverterImpl(Jekyll::Converters::Markdown).convert(content)
14
+ elsif txext.include? ext
15
+ site.getConverterImpl(Jekyll::Converters::Textile).convert(content)
16
+ else
17
+ "<p>" + content.strip.gsub(/\n\n/, "<p>\n\n</p>") + "</p>"
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Tags
3
- module QuoteTag
4
- VERSION = "1.0.2"
3
+ module Quote
4
+ VERSION = "1.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -5,7 +5,7 @@ require 'octopress-quote-tag/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "octopress-quote-tag"
8
- spec.version = Octopress::Tags::QuoteTag::VERSION
8
+ spec.version = Octopress::Tags::Quote::VERSION
9
9
  spec.authors = ["Brandon Mathis"]
10
10
  spec.email = ["brandon@imathis.com"]
11
11
  spec.summary = %q{Nicely formatted HTML5 blockquotes for Jekyll sites}
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "jekyll"
22
+ spec.add_runtime_dependency "rubypants"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.6"
24
25
  spec.add_development_dependency "rake"
@@ -8,6 +8,6 @@ exclude:
8
8
  - Gemfile*
9
9
 
10
10
  # Build settings
11
- markdown: kramdown
11
+ markdown: redcarpet
12
12
  gems:
13
13
  - octopress-quote-tag
@@ -1,13 +1,13 @@
1
- <blockquote><p><strong>Quick</strong> wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! Now fax quiz Jack! my brave ghost pled.</p></blockquote>
1
+ <blockquote><p><strong>Quick</strong> wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! &quot;Now fax quiz Jack!&quot; my brave ghost pled.</p></blockquote>
2
2
 
3
- <figure class="quote"><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. <a href="http://timecube.com">How quickly</a> daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! Now fax quiz Jack! my brave ghost pled.</p></blockquote><figcaption class="quote-source"><span class="quote-author">Bobby Jones </span></figcaption></figure>
3
+ <figure class='quote'><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. <a href="http://timecube.com">How quickly</a> daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! &quot;Now fax quiz Jack!&quot; my brave ghost pled.</p></blockquote><figcaption class='quote-source'><span class='quote-author'>Bobby Jones </span></figcaption></figure>
4
4
 
5
- <figure class="quote"><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! Now fax quiz Jack! my brave ghost pled.</p></blockquote><figcaption class="quote-source"><span class="quote-author">Bobby Jones</span><cite class="quote-title">Some Book</cite></figcaption></figure>
5
+ <figure class='quote'><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! &quot;Now fax quiz Jack!&quot; my brave ghost pled.</p></blockquote><figcaption class='quote-source'><span class='quote-author'>Bobby Jones</span><cite class='quote-title'>Some Book</cite></figcaption></figure>
6
6
 
7
- <figure class="quote"><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! Now fax quiz Jack! my brave ghost pled.</p></blockquote><figcaption class="quote-source"><span class="quote-author">Bobby Jones</span><cite class="quote-title"><a class="quote-link" href="http://foo.com/blahboogersblahasdfoasdfasdf">Some Article</a></cite></figcaption></figure>
7
+ <figure class='quote'><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! &quot;Now fax quiz Jack!&quot; my brave ghost pled.</p></blockquote><figcaption class='quote-source'><span class='quote-author'>Bobby Jones</span><cite class='quote-title'><a class='quote-link' href='http://foo.com/blahboogersblahasdfoasdfasdf'>Some Article</a></cite></figcaption></figure>
8
8
 
9
- <figure class="quote"><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! Now fax quiz Jack! my brave ghost pled.</p></blockquote><figcaption class="quote-source"><span class="quote-author"><a class="quote-link" href="http://foo.com/blahboogersblahasdfoasdfasdf">Bobby Jones</a></span></figcaption></figure>
9
+ <figure class='quote'><blockquote><p>Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! &quot;Now fax quiz Jack!&quot; my brave ghost pled.</p></blockquote><figcaption class='quote-source'><span class='quote-author'><a class='quote-link' href='http://foo.com/blahboogersblahasdfoasdfasdf'>Bobby Jones</a></span></figcaption></figure>
10
10
 
11
- <blockquote><p>Heres a paragraph where something happens</p>
11
+ <blockquote><p>Here&#39;s a paragraph where something happens</p>
12
12
 
13
- <p>Heres another paragraph where something happens</p></blockquote>
13
+ <p>Here&#39;s another paragraph where something happens</p></blockquote>
@@ -2,23 +2,23 @@
2
2
  ---
3
3
 
4
4
  {% blockquote %}
5
- **Quick** wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.
5
+ **Quick** wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled.
6
6
  {% endblockquote %}
7
7
 
8
8
  {% blockquote Bobby Jones %}
9
- Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. [How quickly](http://timecube.com) daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.
9
+ Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. [How quickly](http://timecube.com) daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled.
10
10
  {% endblockquote %}
11
11
 
12
12
  {% blockquote Bobby Jones, Some Book %}
13
- Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.
13
+ Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled.
14
14
  {% endblockquote %}
15
15
 
16
- {% blockquote Bobby Jones http://foo.com/blahboogersblahasdfoasdfasdf Some Article %}
17
- Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.
18
- {% endblockquote %}
16
+ {% quote author:"Bobby Jones" url:http://foo.com/blahboogersblahasdfoasdfasdf title:"Some Article" %}
17
+ Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled.
18
+ {% endquote %}
19
19
 
20
20
  {% blockquote Bobby Jones http://foo.com/blahboogersblahasdfoasdfasdf %}
21
- Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack! " my brave ghost pled.
21
+ Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled.
22
22
  {% endblockquote %}
23
23
 
24
24
  {% blockquote %}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-quote-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubypants
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +124,7 @@ files:
110
124
  - README.md
111
125
  - Rakefile
112
126
  - lib/octopress-quote-tag.rb
127
+ - lib/octopress-quote-tag/utils.rb
113
128
  - lib/octopress-quote-tag/version.rb
114
129
  - octopress-quote-tag.gemspec
115
130
  - test/Gemfile