Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
rvm:
- 2.0.0
- 1.9.3
script: bundle exec clash test
- 2.4.0
script: bundle; bundle exec clash test
4 changes: 0 additions & 4 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in octopress-pullquote-tag.gemspec
# Specify your gem's dependencies in jekyll-pullquote.gemspec
gemspec
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Brandon Mathis
Copyright (c) 2017 Ron Scott-Adams

MIT License

Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Octopress Pullquote Tag

Elegant pull-quotes for Jekyll sites.

[![Build Status](http://img.shields.io/travis/octopress/pullquote-tag.svg)](https://travis-ci.org/octopress/pullquote-tag)
[![Gem Version](http://img.shields.io/gem/v/octopress-pullquote-tag.svg)](https://rubygems.org/gems/octopress-pullquote-tag)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://octopress.mit-license.org)
**Modified by Ron Scott-Adams**

## Installation

Expand All @@ -13,7 +9,7 @@ Elegant pull-quotes for Jekyll sites.
Add this gem to your site's Gemfile in the `:jekyll_plugins` group:

group :jekyll_plugins do
gem 'octopress-pullquote-tag'
gem 'jekyll-pullquote'
end

Then install the gem with Bundler
Expand All @@ -22,12 +18,12 @@ Then install the gem with Bundler

### Manual Installation

$ gem install octopress-pullquote-tag
$ gem install jekyll-pullquote

Then add the gem to your Jekyll configuration.

gems:
-octopress-pullquote-tag
-jekyll-pullquote

## Usage

Expand Down Expand Up @@ -74,11 +70,3 @@ Any other text added to the pull-quote tag will be added as a classname too.
{% pullquote big %} #=> class='pullquote-right big'
{% pullquote left highlight %} #=> class='pullquote-left highlight'
```

## Contributing

1. Fork it ( https://github.com/octopress/pullquote-tag/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
18 changes: 7 additions & 11 deletions octopress-pullquote-tag.gemspec → jekyll-pullquote.gemspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'octopress-pullquote-tag/version'
require 'jekyll-pullquote/version'

Gem::Specification.new do |spec|
spec.name = "octopress-pullquote-tag"
spec.version = Octopress::Tags::PullQuote::VERSION
spec.authors = ["Brandon Mathis"]
spec.email = ["[email protected]"]
spec.summary = %q{Elegant pullquotes for Jekyll site site.}
spec.homepage = "https://github.com/octopress/pullquote-tag"
spec.name = "jekyll-pullquote"
spec.version = PullQuote::VERSION
spec.authors = ["Ron Scott-Adams"]
spec.email = ["[email protected]"]
spec.summary = %q{Semantically correct pullquotes for jekyll.}
spec.homepage = "https://gitlab.com/tohuw/jekyll-pullquote"
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0")
Expand All @@ -23,8 +23,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "clash"

if RUBY_VERSION >= "2"
spec.add_development_dependency "octopress-debugger"
end
end
33 changes: 33 additions & 0 deletions lib/jekyll-pullquote.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require "pullquote/version"
require "pullquote/utils"
require "rubypants-unicode"

module PullQuote
class Tag < Liquid::Block
def initialize(tag_name, markup, tokens)
@markup = markup
super
end

def render(context)
output = super
quotemarks = /\{"\s*(.+?)\s*"\}/m
if output =~ quotemarks

output.gsub!(quotemarks, '\1')

quote = RubyPants.new($1).to_html

classnames = ''

output = "<span class='pullquote #{classnames}' data-pullquote='#{quote}'></span>#{output}"

Utils.parse_content(output, context)
else
raise "PullQuote Error: Surround your pullquote like this {\" text to be quoted \"}"
end
end
end
end

Liquid::Template.register_tag('pullquote', PullQuote::Tag)
19 changes: 19 additions & 0 deletions lib/jekyll-pullquote/utils.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module PullQuote
module Utils
def self.parse_content(content, context)
path = context.environments.first['page']['path']
ext = File.extname(path[1..-1])[1..-1]
site = context.registers[:site]
mdext = site.config['markdown_ext']
txext = site.config['textile_ext']

if mdext.include? ext
site.find_converter_instance(Jekyll::Converters::Markdown).convert(content)
elsif txext.include? ext
site.find_converter_instance(Jekyll::Converters::Textile).convert(content)
else
"<p>" + content.strip.gsub(/\n\n/, "<p>\n\n</p>") + "</p>"
end
end
end
end
3 changes: 3 additions & 0 deletions lib/jekyll-pullquote/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module PullQuote
VERSION = "0.1"
end
50 changes: 0 additions & 50 deletions lib/octopress-pullquote-tag.rb

This file was deleted.

23 changes: 0 additions & 23 deletions lib/octopress-pullquote-tag/utils.rb

This file was deleted.

7 changes: 0 additions & 7 deletions lib/octopress-pullquote-tag/version.rb

This file was deleted.

2 changes: 1 addition & 1 deletion test/_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gems:
- octopress-pullquote-tag
- jekyll-pullquote
markdown: redcarpet