Created
May 6, 2014 06:59
-
-
Save inukshuk/eb98ececbec23595a2d5 to your computer and use it in GitHub Desktop.
Page Range Expander
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csl/styles' | |
require 'citeproc/ruby' | |
r = CiteProc::Ruby::Renderer.new | |
while input = gets | |
puts r.format_page_range input, 'expanded' | |
end |
For the script to work, you need to install the gems csl-styles
and citeproc-ruby
first.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it interactively:
Or by using a pipe (each page range on a new line):
./expand.rb < page_ranges.txt > expanded_page_ranges.txt