Sha256: 54d42f109b96da841fe573dd385a1f38e574ab6c10b7c9b49d5c61d9734d5d4a

Contents?: true

Size: 362 Bytes

Versions: 5

Compression:

Stored size: 362 Bytes

Contents

#!/usr/bin/env ruby
require "polytexnic"

def latex_to_html(latex)
  Polytexnic::Pipeline.new(latex, article: true).to_html
end

if ARGV.empty?
  puts latex_to_html(STDIN.read)
else
  filename = ARGV.shift
  latex = File.read(filename)
  html  = latex_to_html(latex)
  if (outfile = ARGV.shift)
    File.write(outfile, html)
  else
    puts html.strip
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polytexnic-1.5.16 bin/polytexnic
polytexnic-1.5.15 bin/polytexnic
polytexnic-1.5.14 bin/polytexnic
polytexnic-1.5.13 bin/polytexnic
polytexnic-1.5.12 bin/polytexnic