hierogloss 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
data/bin/hierogloss ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'hierogloss'
5
+
6
+ options = { format: 'html' }
7
+
8
+ OptionParser.new do |opts|
9
+ opts.banner = "Usage: hierogloss [options] files..."
10
+
11
+ opts.on("-f", "--format [FORMAT]",
12
+ "Output format (html, bbcode, htlal)",
13
+ " (defaults to html)") do |format|
14
+ options[:format] = format
15
+ end
16
+ end.parse!
17
+
18
+ args = { input: 'hierogloss' }
19
+ if options[:format] == 'html'
20
+ args[:template] =
21
+ File.join(File.dirname(__FILE__), '..', 'data', 'hierogloss.html.erb')
22
+ end
23
+
24
+ doc = Kramdown::Document.new(ARGF.read, args)
25
+ puts doc.send("to_#{options[:format]}")