Skip to content

An HTML::Pipeline filter that converts Trix-compliant YouTube or Vimeo preview image <filter> tags into URLs

License

Notifications You must be signed in to change notification settings

HazelGrant/html-pipeline-trix-video

Repository files navigation

HTML::Pipeline Trix Video

This project is intended to provide a filter that will take Trix-produced content as input, find <figure> tags that hold onto image previews taken from YouTube or Vimeo videos, and convert those into raw YouTube or Vimeo video URLs.

The intention is that this returned URL can then be filtered through html-pipeline-vimeo and html-pipeline-youtube in order to display embedded videos in Trix-produced content.

This is based off of the work-flow suggested in Trix's Issue 206.

Installation

Add this line to your application's Gemfile:

gem 'html-pipeline'
gem 'html-pipeline-trix-video'

And then execute:

$ bundle

Or install it yourself as:

$ gem install html-pipeline-trix-video

Usage

You can add HTML::Pipeline::TrixVideoFilter into your pipeline like this:

pipeline = HTML::Pipeline.new [
  HTML::Pipeline::TrixVideoFilter,
  HTML::Pipeline::VimeoFilter
]

result = pipeline.call(text)

See html-pipeline.

About

An HTML::Pipeline filter that converts Trix-compliant YouTube or Vimeo preview image <filter> tags into URLs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published