html-pipeline-1.11.0/ 0000755 0000764 0000764 00000000000 12545202654 013402 5 ustar pravi pravi html-pipeline-1.11.0/LICENSE 0000644 0000764 0000764 00000002074 12545202654 014412 0 ustar pravi pravi Copyright (c) 2012 GitHub Inc. and Jerry Cheung
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. html-pipeline-1.11.0/CONTRIBUTING.md 0000644 0000764 0000764 00000003005 12545202654 015631 0 ustar pravi pravi # Contributing
Thanks for using and improving `HTML::Pipeline`!
- [Submitting a New Issue](#submitting-a-new-issue)
- [Sending a Pull Request](#sending-a-pull-request)
## Submitting a New Issue
If there's an idea you'd like to propose, or a design change, feel free to file a new issue.
If you have an implementation question or believe you've found a bug, please provide as many details as possible:
- Input document
- Output HTML document
- the exact `HTML::Pipeline` code you are using
- output of the following from your project
```
ruby -v
bundle exec nokogiri -v
```
## Sending a Pull Request
[Pull requests][pr] are always welcome!
Check out [the project's issues list][issues] for ideas on what could be improved.
Before sending, please add tests and ensure the test suite passes.
### Running the Tests
To run the full suite:
`bundle exec rake`
To run a specific test file:
`bundle exec ruby -Itest test/html/pipeline_test.rb`
To run a specific test:
`bundle exec ruby -Itest test/html/pipeline/markdown_filter_test.rb -n test_disabling_gfm`
To run the full suite with all [supported rubies][travisyaml] in bash:
```bash
rubies=(ree-1.8.7-2011.03 1.9.2-p290 1.9.3-p429 2.0.0-p247)
for r in ${rubies[*]}
do
rbenv local $r # switch to your version manager of choice
bundle install
bundle exec rake
done
```
[issues]: https://github.com/jch/html-pipeline/issues
[pr]: https://help.github.com/articles/using-pull-requests
[travisyaml]: https://github.com/jch/html-pipeline/blob/master/.travis.yml
html-pipeline-1.11.0/.travis.yml 0000644 0000764 0000764 00000000364 12545202654 015516 0 ustar pravi pravi language: ruby
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libicu-dev
script: "bundle exec rake"
rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.1
- ree
matrix:
fast_finish: true
allow_failures:
- rvm: ree
html-pipeline-1.11.0/bin/ 0000755 0000764 0000764 00000000000 12545202654 014152 5 ustar pravi pravi html-pipeline-1.11.0/bin/html-pipeline 0000755 0000764 0000764 00000003335 12545202654 016653 0 ustar pravi pravi #!/usr/bin/env ruby
require 'html/pipeline'
require 'optparse'
# Accept "help", too
ARGV.map!{|a| a == "help" ? "--help" : a }
OptionParser.new do |opts|
opts.banner = <<-HELP.gsub(/^ /, '')
Usage: html-pipeline [-h] [-f]
html-pipeline [FILTER [FILTER [...]]] < file.md
cat file.md | html-pipeline [FILTER [FILTER [...]]]
HELP
opts.separator "Options:"
opts.on("-f", "--filters", "List the available filters") do
filters = HTML::Pipeline.constants.grep(/\w+Filter$/).
map{|f| f.to_s.gsub(/Filter$/,'') }
# Text filter doesn't work, no call method
filters -= ["Text"]
abort <<-HELP.gsub(/^ /, '')
Available filters:
#{filters.join("\n ")}
HELP
end
end.parse!
# Default to a GitHub-ish pipeline
if ARGV.empty?
filters = [
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::SanitizationFilter,
HTML::Pipeline::ImageMaxWidthFilter,
HTML::Pipeline::EmojiFilter,
HTML::Pipeline::AutolinkFilter,
HTML::Pipeline::TableOfContentsFilter,
]
# Add syntax highlighting if linguist is present
begin
require 'linguist'
filters << HTML::Pipeline::SyntaxHighlightFilter
rescue LoadError
end
else
def filter_named(name)
case name
when "Text"
raise NameError # Text filter doesn't work, no call method
end
HTML::Pipeline.const_get("#{name}Filter")
rescue NameError => e
abort "Unknown filter '#{name}'. List filters with the -f option."
end
filters = []
until ARGV.empty?
name = ARGV.shift
filters << filter_named(name)
end
end
context = {
:asset_root => "/assets",
:base_url => "/",
:gfm => true
}
puts HTML::Pipeline.new(filters, context).call(ARGF.read)[:output]
html-pipeline-1.11.0/script/ 0000755 0000764 0000764 00000000000 12545202654 014706 5 ustar pravi pravi html-pipeline-1.11.0/script/release 0000755 0000764 0000764 00000000616 12545202654 016257 0 ustar pravi pravi #!/usr/bin/env bash
# Usage: script/release
# Build the package, tag a commit, push it to origin, and then release the
# package publicly.
set -e
version="$(script/package | grep Version: | awk '{print $2}')"
[ -n "$version" ] || exit 1
echo $version
git commit --allow-empty -a -m "Release $version"
git tag "v$version"
git push origin
git push origin "v$version"
gem push pkg/*-${version}.gem
html-pipeline-1.11.0/script/package 0000755 0000764 0000764 00000000230 12545202654 016222 0 ustar pravi pravi #!/usr/bin/env bash
# Usage: script/gem
# Updates the gemspec and builds a new gem in the pkg directory.
mkdir -p pkg
gem build *.gemspec
mv *.gem pkg
html-pipeline-1.11.0/html-pipeline.gemspec 0000644 0000764 0000764 00000002121 12545202654 017512 0 ustar pravi pravi # -*- encoding: utf-8 -*-
require File.expand_path("../lib/html/pipeline/version", __FILE__)
Gem::Specification.new do |gem|
gem.name = "html-pipeline"
gem.version = HTML::Pipeline::VERSION
gem.license = "MIT"
gem.authors = ["Ryan Tomayko", "Jerry Cheung"]
gem.email = ["ryan@github.com", "jerry@github.com"]
gem.description = %q{GitHub HTML processing filters and utilities}
gem.summary = %q{Helpers for processing content through a chain of filters}
gem.homepage = "https://github.com/jch/html-pipeline"
gem.files = `git ls-files`.split $/
gem.test_files = gem.files.grep(%r{^test})
gem.require_paths = ["lib"]
gem.add_dependency "nokogiri", "~> 1.4"
gem.add_dependency "activesupport", ">= 2"
gem.post_install_message = <