-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgenerate
executable file
·53 lines (44 loc) · 1.62 KB
/
generate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), "version"))
require File.expand_path(File.join(File.dirname(__FILE__), "lib/docbook"))
def show_instructions
text = %Q{Docbook Generator (C) 2011 Brian Hogan
=================================================
Creates a docbook project, chapter, or article skeleton.
generate book | chapter | article <path> (no extension)
Example: generate book my_book
- my_book/images
- my_book/images/src
- my_book/cover
- my_book/xsl
- my_book/xsl/pdf.xsl
- my_book/book.xml
- my_book/chapter01.xml
- my_book/make
or: generate chapter chapter02
- ./chapter02.xml
or: generate chapter chapter02/fun_stuff
- chapter02/fun_stuff.xml
or: generate article learning_rails
- learning_rails/images
- learning_rails/xsl
- learning_rails/xsl/pdf.xml
- learning_rails/make
- learning_rails/article.xml
You can get a sample book as well with contents
Example: generate book my_book with_sample
}
puts text
end
if ARGV[0].nil?
show_instructions
elsif ARGV[0] == "-v" || ARGV[0] == "--version"
puts "#{DocbookVersion.to_s}"
else
root_path = File.dirname(__FILE__)
type = ARGV[0]
output_path = ARGV[1]
sample = ARGV[2].include? "sample" rescue false
OUTPUT = Docbook::Output.new(:verbose => true)
Docbook::Generator.new(type, root_path, output_path, :sample => sample).generate
end