vtt2an

Build Status Dependency Status Coverage Status Code Climate Gem Version License

Convert WebVTT subtitles files into Akoma Ntoso transcripts.

Installation

Ruby 2.3.1 recommended, then:

gem install vtt2an

or add to your Gemfile:

gem "vtt2an"

and then

bundle

Usage

Ruby

Load a WebVTT file using webvtt-ruby, then convert it using Vtt2An::Converter to a REXML::Document in Akoma Ntoso format:

webvtt = WebVTT.read "in.wtt"
converter = Vtt2An::Converter.new webvtt
output = converter.convert
File.open("out.an", "w") do |f|
  output.write f
end

Command line

If you just want to convert files, you can use the handy command-line tool:

bundle exec exe/vtt2an.rb /path/to/file.vtt /path/to/output.an