An HTML::Pipeline filter for handling WikiMedia-style wiki links.
Add this line to your application's Gemfile:
gem 'html-pipeline-wiki-link'
And then execute:
$ bundle
Or install it yourself as:
$ gem install html-pipeline-wiki-link
This library is designed as an extension of the HTML::Pipeline system for creating pipelines of text conversions. It can work on its own or in conjunction with other filters descended from HTML::Pipeline::Filter
.
To use this filter on its own:
require 'html/pipeline/wiki_link'
filter = HTML::Pipeline::WikiLinkFilter.new('Some text with a [[Link]] in it.')
filter.call
Filters can be combined into a pipeline which causes each filter to hand its output to the next filter's input. For example, you could support wiki links in Markdown by creating a pipeline like this:
pipeline = HTML::Pipeline.new [
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::WikiLinkFilter
]
result = pipeline.call <<-CODE
This is some **Markdown** with a [[Link]] in it!
CODE
The wiki link filter supports the standard link types:
[[Link]]
[[Link|Description]]
To see what has changed in recent versions of the wiki link gem, see the CHANGELOG.
Copyright © 2013 Lee Dohm, Lifted Studios. See LICENSE for details.
Project is a member of the OSS Manifesto.