murdoc 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/murdoc +8 -0
- data/lib/murdoc.rb +10 -2
- data/murdoc.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/bin/murdoc
CHANGED
@@ -12,6 +12,14 @@ option_parser = OptionParser.new do |opts|
|
|
12
12
|
options[:highlight_source] = h
|
13
13
|
end
|
14
14
|
|
15
|
+
opts.on("-t", "--template [FILENAME]", "Use custom haml template for output") do |t|
|
16
|
+
options[:template] = t
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("-s", "--stylesheet [FILENAME]", "Use custom css stylesheet for output") do |s|
|
20
|
+
options[:stylesheet] = s
|
21
|
+
end
|
22
|
+
|
15
23
|
opts.on_tail("-h", "--help", "Show this message") do
|
16
24
|
puts opts
|
17
25
|
exit
|
data/lib/murdoc.rb
CHANGED
@@ -11,12 +11,20 @@
|
|
11
11
|
|
12
12
|
module Murdoc
|
13
13
|
def self.generate_from_file(input, output, options = {})
|
14
|
+
options = default_options.merge(options)
|
14
15
|
annotator = Annotator.from_file(input, nil, options)
|
15
|
-
markup_dir = File.dirname(__FILE__)+ "/../markup"
|
16
16
|
File.open(output, "w+") do |f|
|
17
|
-
f.puts Formatter.new(
|
17
|
+
f.puts Formatter.new(options[:template]).render(:paragraphs => annotator.paragraphs, :stylesheet => File.read(options[:stylesheet]))
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.default_options
|
22
|
+
markup_dir = File.dirname(__FILE__)+ "/../markup"
|
23
|
+
@@options ||= {
|
24
|
+
:template => "#{markup_dir}/template.haml",
|
25
|
+
:stylesheet => "#{markup_dir}/stylesheet.css"
|
26
|
+
}
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
22
30
|
require "murdoc/annotator"
|
data/murdoc.gemspec
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mark Abramov
|
@@ -166,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
hash:
|
169
|
+
hash: 960483362667149107
|
170
170
|
segments:
|
171
171
|
- 0
|
172
172
|
version: "0"
|