HTML::Pipeline::LinkifyGitHub 
HTML::Pipeline::LinkifyGitHub provides a HTML::Pipeline
filter to autolink GitHub urls.
Installation
Add this line to your application's Gemfile:
gem "html-pipeline-linkify_github"
And then execute:
$ bundle
Or install it yourself as:
$ gem install html-pipeline-linkify_github
Usage
Use HTML::Pipeline::LinkifyGitHubFilter filter before your markdown filter.
require "html/pipeline"
require "html/pipeline/linkify_github"
pipeline = HTML::Pipeline.new [
HTML::Pipeline::LinkifyGitHubFilter,
HTML::Pipeline::MarkdownFilter
]
result = pipeline.call " https://github.com/rails/rails/pull/21862\n https://github.com/rails/rails/issues/21843\n https://github.com/rails/rails/commit/67597e1719ec6af7e22964603cc77aa5b085a864\n"
puts result[:output]
prints:
[rails/rails#21862](https://github.com/rails/rails/pull/21862)
[rails/rails#21843](https://github.com/rails/rails/issues/21843)
[rails/rails@`67597e1`](https://github.com/rails/rails/commit/67597e1719ec6af7e22964603cc77aa5b085a864)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am "Add some feature") - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Notes
This RubyGem requires Ruby 2.0+ because support for 1.9.3 is officially end.
Credits
A huge THANK YOU to all our contributors! :heart:
This project is maintained by Jolly Good Code.
License
MIT License. See LICENSE for details.