octopress-pullquote-tag 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eee3d0f483bd565e6bef464f4b1e5c1ed0c1b4e6
4
+ data.tar.gz: d413d34488f38eb681bb26f1137d44209b90c463
5
+ SHA512:
6
+ metadata.gz: 5170736c0d77ea212d68d929dcd4dd1f27b53872efb0dea269ce956c49552628a3b3fd9a4918723e33fb259e67704f98d495f602b700eae895ac2d3b856658d0
7
+ data.tar.gz: 8652950fc087b29a417ea460ac37419ebd721e42b025c31ab38904a321b10819f5811a31baee1f38680cacd6af2fbaf69a8ebbaebb7fdb40ec3b8043ca95201a
data/.clash.yml ADDED
@@ -0,0 +1,2 @@
1
+ build: true
2
+ compare: _expected _site
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ script: bundle exec clash test
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in octopress-pullquote-tag.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Brandon Mathis
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # Octopress Pullquote Tag
2
+
3
+ Elegant pull-quotes for Jekyll sites.
4
+
5
+ [![Build Status](http://img.shields.io/travis/octopress/pullquote-tag.svg)](https://travis-ci.org/octopress/pullquote-tag)
6
+ [![Gem Version](http://img.shields.io/gem/v/octopress-pullquote-tag.svg)](https://rubygems.org/gems/octopress-pullquote-tag)
7
+ [![License](http://img.shields.io/:license-mit-blue.svg)](http://octopress.mit-license.org)
8
+
9
+ ## Installation
10
+
11
+ ### Using Bundler
12
+
13
+ Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
14
+
15
+ group :jekyll_plugins do
16
+ gem 'octopress-pullquote-tag'
17
+ end
18
+
19
+ Then install the gem with Bundler
20
+
21
+ $ bundle
22
+
23
+ ### Manual Installation
24
+
25
+ $ gem install octopress-pullquote-tag
26
+
27
+ Then add the gem to your Jekyll configuration.
28
+
29
+ gems:
30
+ -octopress-pullquote-tag
31
+
32
+ ## Usage
33
+
34
+ 1. Surround the paragraph you want to quote from with a `{% pullquote %}` tag.
35
+ 2. Surround the quote you want to use with `{"` and `"}`.
36
+
37
+ For example:
38
+
39
+ ```
40
+ {% pullquote %}
41
+ When writing long-form posts, I find it helpful to include pull-quotes, which help
42
+ those scanning a post discern whether or not a post is helpful. It is important to
43
+ note, {" pull-quotes are merely visual in presentation and should not appear twice in the text. "} That
44
+ is why it is preferred to use a CSS only technique for styling pull-quotes.
45
+ {% endpullquote %}
46
+ ```
47
+
48
+ This will output the following:
49
+
50
+ ```html
51
+ <p><span data-pullquote="pullquotes are merely visual in presentation and should not appear twice in the text."></span>
52
+ When writing long-form posts, I find it helpful to include pull-quotes, which help
53
+ those scanning a post discern whether or not a post is helpful. It is important to
54
+ note, pull-quotes are merely visual in presentation and should not appear twice in the text. That
55
+ is why it is preferred to use a CSS only technique for styling pull-quotes.</p>
56
+ ```
57
+
58
+ ### Styling & Classnames
59
+
60
+ This plugin does not currently ship with its own CSS for styling. Octopress themes will have styling for this or you may look to [Maykel Loomans](http://miekd.com/articles/pull-quotes-with-html5-and-css/) for inspiration.
61
+
62
+ By default pull-quotes will be given the classname `pullquote-right`. For center or left aligned pull quotes, add the alignment to the
63
+ tag like this.
64
+
65
+ ```
66
+ {% pullquote %} #=> class='pullquote-right'
67
+ {% pullquote left %} #=> class='pullquote-left'
68
+ {% pullquote center %} #=> class='pullquote-center'
69
+ ```
70
+
71
+ Any other text added to the pull-quote tag will be added as a classname too.
72
+
73
+ ```
74
+ {% pullquote big %} #=> class='pullquote-right big'
75
+ {% pullquote left highlight %} #=> class='pullquote-left highlight'
76
+ ```
77
+
78
+ ## Contributing
79
+
80
+ 1. Fork it ( https://github.com/octopress/pullquote-tag/fork )
81
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
82
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
83
+ 4. Push to the branch (`git push origin my-new-feature`)
84
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ module Octopress
2
+ module Tags
3
+ module PullQuote
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
@@ -0,0 +1,7 @@
1
+ module Octopress
2
+ module Tags
3
+ module PullQuote
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,50 @@
1
+ require "octopress-pullquote-tag/version"
2
+ require "octopress-pullquote-tag/utils"
3
+ require "rubypants-unicode"
4
+
5
+ module Octopress
6
+ module Tags
7
+ module PullQuote
8
+ class Tag < Liquid::Block
9
+ def initialize(tag_name, markup, tokens)
10
+ @markup = markup
11
+ super
12
+ end
13
+
14
+ def render(context)
15
+ output = super
16
+ quotemarks = /\{"\s*(.+?)\s*"\}/m
17
+ if output =~ quotemarks
18
+
19
+ output.gsub!(quotemarks, '\1')
20
+
21
+ quote = RubyPants.new($1).to_html
22
+
23
+ alignment = @markup.scan(/(left|right|center)/i).first || 'right'
24
+ classnames = @markup.sub(/left|right|center/i, '').strip
25
+
26
+ output = "<span class='pullquote-#{alignment} #{classnames}' data-pullquote='#{quote}'></span>#{output}"
27
+
28
+ Utils.parse_content(output, context)
29
+ else
30
+ raise "PullQuote Error: Surround your pullquote like this {\" text to be quoted \"}"
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ Liquid::Template.register_tag('pullquote', Octopress::Tags::PullQuote::Tag)
39
+
40
+ if defined? Octopress::Docs
41
+ Octopress::Docs.add({
42
+ name: "Octopress Pullquote Tag",
43
+ gem: "octopress-pullquote-tag",
44
+ description: "Elegant pullquotes for Jekyll site site",
45
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
46
+ source_url: "https://github.com/octopress/quote-tag",
47
+ version: Octopress::Tags::Quote::VERSION
48
+ })
49
+ end
50
+
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'octopress-pullquote-tag/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "octopress-pullquote-tag"
8
+ spec.version = Octopress::Tags::PullQuote::VERSION
9
+ spec.authors = ["Brandon Mathis"]
10
+ spec.email = ["brandon@imathis.com"]
11
+ spec.summary = %q{Elegant pullquotes for Jekyll site site.}
12
+ spec.homepage = "https://github.com/octopress/pullquote-tag"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "jekyll"
21
+ spec.add_runtime_dependency "rubypants-unicode"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "clash"
26
+
27
+ if RUBY_VERSION >= "2"
28
+ spec.add_development_dependency "pry-byebug"
29
+ end
30
+ end
data/test/_config.yml ADDED
@@ -0,0 +1,3 @@
1
+ gems:
2
+ - octopress-pullquote-tag
3
+ markdown: redcarpet
@@ -0,0 +1,2 @@
1
+ <p><span class='pullquote-right highlight' data-pullquote='How quickly daft jumping zebras vex.'></span>
2
+ 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>
@@ -0,0 +1,2 @@
1
+ <p><span class='pullquote-right highlight' data-pullquote='How quickly daft jumping zebras vex.'></span>
2
+ 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>
data/test/index.md ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ ---
3
+
4
+ {% pullquote highlight %}
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
+ {% endpullquote %}
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: octopress-pullquote-tag
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Brandon Mathis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-09 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: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubypants-unicode
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'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: clash
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description:
98
+ email:
99
+ - brandon@imathis.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".clash.yml"
105
+ - ".gitignore"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - lib/octopress-pullquote-tag.rb
112
+ - lib/octopress-pullquote-tag/utils.rb
113
+ - lib/octopress-pullquote-tag/version.rb
114
+ - octopress-pullquote-tag.gemspec
115
+ - test/_config.yml
116
+ - test/_expected/index.html
117
+ - test/_site/index.html
118
+ - test/index.md
119
+ homepage: https://github.com/octopress/pullquote-tag
120
+ licenses:
121
+ - MIT
122
+ metadata: {}
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.2.2
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Elegant pullquotes for Jekyll site site.
143
+ test_files:
144
+ - test/_config.yml
145
+ - test/_expected/index.html
146
+ - test/_site/index.html
147
+ - test/index.md