deplate 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/AUTHORS.TXT +26 -0
  2. data/CHANGES.TXT +177 -0
  3. data/LICENSE.TXT +340 -0
  4. data/NEWS.TXT +29 -0
  5. data/README.TXT +86 -0
  6. data/TODO.TXT +202 -0
  7. data/VERSION.TXT +1 -0
  8. data/bin/deplate +3 -0
  9. data/bin/deplate.bat +2 -0
  10. data/etc/deplate.ini +361 -0
  11. data/lib/deplate.rb +31 -0
  12. data/lib/deplate/abstract-class.rb +30 -0
  13. data/lib/deplate/builtin.rb +11 -0
  14. data/lib/deplate/cache.rb +59 -0
  15. data/lib/deplate/commands.rb +693 -0
  16. data/lib/deplate/common.rb +335 -0
  17. data/lib/deplate/converter.rb +99 -0
  18. data/lib/deplate/core.rb +2705 -0
  19. data/lib/deplate/css/article.css +545 -0
  20. data/lib/deplate/css/deplate.css +699 -0
  21. data/lib/deplate/css/heading-navbar.css +29 -0
  22. data/lib/deplate/css/layout-deplate-print.css +540 -0
  23. data/lib/deplate/css/layout-deplate.css +764 -0
  24. data/lib/deplate/css/sans-serif.css +160 -0
  25. data/lib/deplate/css/serif-e.css +170 -0
  26. data/lib/deplate/css/serif-rel.css +121 -0
  27. data/lib/deplate/css/serif.css +190 -0
  28. data/lib/deplate/css/slides.css +11 -0
  29. data/lib/deplate/css/tabbar-left.css +91 -0
  30. data/lib/deplate/css/tabbar-right-ie.css +14 -0
  31. data/lib/deplate/css/tabbar-right.css +118 -0
  32. data/lib/deplate/css/tabbar-top.css +64 -0
  33. data/lib/deplate/css/tabbar.css +81 -0
  34. data/lib/deplate/css/text-sans-serif.css +154 -0
  35. data/lib/deplate/css/text-serif.css +175 -0
  36. data/lib/deplate/define.rb +439 -0
  37. data/lib/deplate/docbook.rb +738 -0
  38. data/lib/deplate/elements.rb +1355 -0
  39. data/lib/deplate/etc.rb +199 -0
  40. data/lib/deplate/external.rb +135 -0
  41. data/lib/deplate/fmt/dbk-article-4.1.2.rb +21 -0
  42. data/lib/deplate/fmt/dbk-article.rb +46 -0
  43. data/lib/deplate/fmt/dbk-book.rb +46 -0
  44. data/lib/deplate/fmt/dbk-ref.rb +105 -0
  45. data/lib/deplate/fmt/dbk-slides.rb +47 -0
  46. data/lib/deplate/fmt/dbk-snippet.rb +21 -0
  47. data/lib/deplate/fmt/html-snippet.rb +21 -0
  48. data/lib/deplate/fmt/html.rb +1696 -0
  49. data/lib/deplate/fmt/htmlsite.rb +419 -0
  50. data/lib/deplate/fmt/htmlslides.rb +21 -0
  51. data/lib/deplate/fmt/htmlwebsite.rb +70 -0
  52. data/lib/deplate/fmt/latex-snippet.rb +22 -0
  53. data/lib/deplate/fmt/latex.rb +1242 -0
  54. data/lib/deplate/fmt/php.rb +19 -0
  55. data/lib/deplate/fmt/phpsite.rb +19 -0
  56. data/lib/deplate/fmt/plain.rb +598 -0
  57. data/lib/deplate/fmt/template.rb +34 -0
  58. data/lib/deplate/fmt/xhtml10t.rb +41 -0
  59. data/lib/deplate/formatter-snippet.rb +17 -0
  60. data/lib/deplate/formatter.rb +1210 -0
  61. data/lib/deplate/input.rb +492 -0
  62. data/lib/deplate/input/deplate-headings.rb +48 -0
  63. data/lib/deplate/input/deplate-restricted.rb +70 -0
  64. data/lib/deplate/input/deplate.rb +28 -0
  65. data/lib/deplate/input/rdoc.rb +277 -0
  66. data/lib/deplate/input/template.rb +29 -0
  67. data/lib/deplate/lib/latex/highlight-extra.sty +15 -0
  68. data/lib/deplate/lib/latex/highlight-typical.sty +15 -0
  69. data/lib/deplate/lib/tabmenu.js +146 -0
  70. data/lib/deplate/locale/de.latin1 +708 -0
  71. data/lib/deplate/locale/ru.koi8-r +48 -0
  72. data/lib/deplate/locale/zh_cn.gb2312 +35 -0
  73. data/lib/deplate/macros.rb +639 -0
  74. data/lib/deplate/messages.rb +120 -0
  75. data/lib/deplate/metadata.rb +77 -0
  76. data/lib/deplate/metadata/marshal.rb +24 -0
  77. data/lib/deplate/metadata/xml.rb +42 -0
  78. data/lib/deplate/metadata/yaml.rb +26 -0
  79. data/lib/deplate/mod/anyword.rb +56 -0
  80. data/lib/deplate/mod/babelfish.rb +27 -0
  81. data/lib/deplate/mod/code-gvim.rb +52 -0
  82. data/lib/deplate/mod/code-highlight.rb +91 -0
  83. data/lib/deplate/mod/colored-log.rb +17 -0
  84. data/lib/deplate/mod/de.rb +19 -0
  85. data/lib/deplate/mod/en.rb +17 -0
  86. data/lib/deplate/mod/endnotes.rb +60 -0
  87. data/lib/deplate/mod/fr.rb +46 -0
  88. data/lib/deplate/mod/html-asciimath.rb +40 -0
  89. data/lib/deplate/mod/html-deplate-button.rb +15 -0
  90. data/lib/deplate/mod/html-headings-navbar.rb +39 -0
  91. data/lib/deplate/mod/html-obfuscate-email.rb +47 -0
  92. data/lib/deplate/mod/html-sidebar.rb +232 -0
  93. data/lib/deplate/mod/htmlslides-navbar-fh.rb +32 -0
  94. data/lib/deplate/mod/iconv.rb +35 -0
  95. data/lib/deplate/mod/imgurl.rb +30 -0
  96. data/lib/deplate/mod/inlatex-compound.rb +69 -0
  97. data/lib/deplate/mod/koma.rb +109 -0
  98. data/lib/deplate/mod/latex-emph-table-head.rb +38 -0
  99. data/lib/deplate/mod/latex-styles.rb +461 -0
  100. data/lib/deplate/mod/latex-verbatim-small.rb +29 -0
  101. data/lib/deplate/mod/makefile.rb +194 -0
  102. data/lib/deplate/mod/mark-external-urls.rb +38 -0
  103. data/lib/deplate/mod/markup-1-warn.rb +37 -0
  104. data/lib/deplate/mod/markup-1.rb +41 -0
  105. data/lib/deplate/mod/navbar-png.rb +33 -0
  106. data/lib/deplate/mod/noindent.rb +32 -0
  107. data/lib/deplate/mod/numpara.rb +40 -0
  108. data/lib/deplate/mod/particle-math.rb +34 -0
  109. data/lib/deplate/mod/php-extra.rb +44 -0
  110. data/lib/deplate/mod/pstoedit.rb +71 -0
  111. data/lib/deplate/mod/recode.rb +57 -0
  112. data/lib/deplate/mod/ru_koi8-r.rb +20 -0
  113. data/lib/deplate/mod/smiley.rb +50 -0
  114. data/lib/deplate/mod/soffice.rb +23 -0
  115. data/lib/deplate/mod/symbols-latin1.rb +58 -0
  116. data/lib/deplate/mod/symbols-od-utf-8.rb +16 -0
  117. data/lib/deplate/mod/symbols-plain.rb +58 -0
  118. data/lib/deplate/mod/symbols-sgml.rb +97 -0
  119. data/lib/deplate/mod/symbols-utf-8.rb +81 -0
  120. data/lib/deplate/mod/symbols-xml.rb +34 -0
  121. data/lib/deplate/mod/syntax-region-alt.rb +37 -0
  122. data/lib/deplate/mod/utf8.rb +49 -0
  123. data/lib/deplate/mod/validate-html.rb +35 -0
  124. data/lib/deplate/mod/xmlrpc.rb +233 -0
  125. data/lib/deplate/mod/zh-cn-autospace.rb +108 -0
  126. data/lib/deplate/mod/zh-cn.rb +59 -0
  127. data/lib/deplate/once-method.rb +44 -0
  128. data/lib/deplate/output.rb +249 -0
  129. data/lib/deplate/particles.rb +815 -0
  130. data/lib/deplate/regions.rb +1076 -0
  131. data/lib/deplate/structured.rb +763 -0
  132. data/lib/deplate/template.rb +430 -0
  133. data/lib/deplate/templates/html-doc.html +28 -0
  134. data/lib/deplate/templates/html-left-tabbar-js.html +37 -0
  135. data/lib/deplate/templates/html-left-tabbar.html +31 -0
  136. data/lib/deplate/templates/html-tabbar-right-table.html +43 -0
  137. data/lib/deplate/templates/html-tabbar-right.html +23 -0
  138. data/lib/deplate/templates/html-tabbar-top.html +43 -0
  139. data/lib/deplate/templates/html-tabbar.html +31 -0
  140. data/lib/deplate/wiki-markup.rb +117 -0
  141. data/lib/deplate/xml.rb +109 -0
  142. data/lib/deplate/zh-cn.rb +59 -0
  143. data/lib/ps2ppm.rb +239 -0
  144. data/man/man1/deplate.1 +692 -0
  145. metadata +210 -0
@@ -0,0 +1,199 @@
1
+ # etc.rb
2
+ # @Author: Thomas Link (samul AT web.de)
3
+ # @Website: http://deplate.sf.net/
4
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
+ # @Created: 16-Okt-2005.
6
+ # @Last Change: 01-Nov-2005.
7
+ # @Revision: 0.30
8
+
9
+ require 'deplate/common'
10
+
11
+ class Deplate::PseudoContainer < Deplate::BaseElement
12
+ attr_accessor :registered_metadata
13
+ attr_reader :destination
14
+
15
+ def initialize(deplate, args)
16
+ super(deplate, args)
17
+ @level_as_string = args[:level_as_string]
18
+ @top_heading = args[:top] || deplate.get_current_top
19
+ @registered_metadata = args[:metadata] || []
20
+ @accum = args[:accum] || []
21
+ @destination = ''
22
+ end
23
+
24
+ def log(text, condition=nil)
25
+ Deplate::Core.log(text, condition, @source)
26
+ end
27
+
28
+ def output_file_name(args={})
29
+ basename = args[:basename]
30
+ rv = @top_heading ? @top_heading.output_file_name : @destination
31
+ if basename
32
+ return File.basename(rv)
33
+ else
34
+ return rv
35
+ end
36
+ end
37
+ end
38
+
39
+
40
+ class Deplate::NullTop < Deplate::PseudoContainer
41
+ attr_reader :args, :caption
42
+ attr_accessor :first_top, :last_top, :description
43
+
44
+ def initialize(deplate, args)
45
+ super
46
+ @destination = args[:destination]
47
+ @args = {:id => "deplateNullTop"}
48
+ @caption = deplate.msg("[Start]")
49
+ @description = nil
50
+ @first_top = false
51
+ @last_top = false
52
+ end
53
+
54
+ alias :output_location :output_file_name
55
+ end
56
+
57
+
58
+ class Deplate::Source
59
+ attr_accessor :file, :begin, :end, :level_as_string, :stats
60
+
61
+ def initialize(*args)
62
+ @file, @stats, @begin, @end, @level_as_string = args
63
+ end
64
+
65
+ def log(text, mode)
66
+ Deplate::Core.log(text, mode, self)
67
+ end
68
+ end
69
+
70
+
71
+ module Deplate::Symbols
72
+ end
73
+
74
+
75
+ class Deplate::Variables < Hash
76
+ attr_accessor :deplate
77
+
78
+ def initialize(deplate=nil)
79
+ super()
80
+ @deplate = deplate
81
+ end
82
+
83
+ def update(hash)
84
+ for key, val in hash
85
+ self[key] = val
86
+ end
87
+ end
88
+
89
+ def []=(name, value)
90
+ if (m = /^(\S+)\[(\S+)?\]$/.match(name))
91
+ key = m[1]
92
+ field = m[2]
93
+ var = self[key]
94
+ if !var
95
+ if !field
96
+ self[key] = [value]
97
+ elsif field =~ /^[0-9]$/
98
+ self[key] = []
99
+ self[key][field.to_i] = value
100
+ else
101
+ self[key] = {field => value}
102
+ end
103
+ elsif var.kind_of?(Struct) || var.kind_of?(OpenStruct)
104
+ var.send("#{field}=", value)
105
+ elsif var.kind_of?(Hash)
106
+ var[field] = value
107
+ elsif var.kind_of?(Array)
108
+ if !field
109
+ var << value
110
+ elsif field =~ /^[0-9]+$/
111
+ field = field.to_i
112
+ var[field] = value
113
+ else
114
+ Deplate::Core.log(["Wrong index", field, name, var.class], :error)
115
+ end
116
+ elsif var
117
+ Deplate::Core.log(["Doc variable has wrong type", key, var.class], :error)
118
+ end
119
+ else
120
+ super
121
+ end
122
+ end
123
+
124
+ def [](name)
125
+ begin
126
+ if keys.include?(name)
127
+ return super
128
+ elsif name =~ /^\S+\(.*\)$/
129
+ m = /^(\S+)\((.*?)?\)$/.match(name)
130
+ if m
131
+ method = m[1]
132
+ args = m[2]
133
+ args, text = @deplate.input.parse_args(args, nil, false)
134
+ return @deplate.invoke_service(method, args, text)
135
+ else
136
+ Deplate::Core.log(["Malformed variable name", name], :error)
137
+ end
138
+ elsif (m = /^(\S+)\[(\S+)\]$/.match(name))
139
+ key = m[1]
140
+ field = m[2]
141
+ var = self[key]
142
+ if var.kind_of?(Struct) || var.kind_of?(OpenStruct)
143
+ return var.send(field)
144
+ elsif var.kind_of?(Hash)
145
+ return var[field]
146
+ elsif var.kind_of?(Array)
147
+ if field =~ /^[0-9]+$/
148
+ field = field.to_i
149
+ return var[field]
150
+ else
151
+ Deplate::Core.log(['Wrong index', field, name, var.class], :error)
152
+ end
153
+ elsif var
154
+ # <+TBD+> this is unsave
155
+ # return var.send(field)
156
+ Deplate::Core.log(['Variable has wrong type', key, var.class], :error)
157
+ else
158
+ Deplate::Core.log(['Unknown variable', key], :error)
159
+ end
160
+ end
161
+ rescue Exception => e
162
+ Deplate::Core.log(['Retrieving doc variable failed', name, e], :error)
163
+ end
164
+ return nil
165
+ end
166
+ end
167
+
168
+ module Deplate::Void
169
+ end
170
+
171
+ # Based on code by:
172
+ # From: Florian Gross, flgr AT ccan.de
173
+ # Newsgroups: comp.lang.ruby
174
+ # Subject: Re: safe eval?
175
+ # Date: Mon, 10 May 2004 19:52:27 +0200
176
+ # Message-ID: <2g9tqcFbpc6U1@uni-berlin.de>
177
+ module Deplate::Safe; end
178
+ class << Deplate::Safe
179
+ def safe(level, code, sandbox=nil)
180
+ error = nil
181
+
182
+ begin
183
+ thread = Thread.new do
184
+ $-w = nil
185
+ sandbox ||= Object.new.taint
186
+ yield(sandbox) if block_given?
187
+ $SAFE = level
188
+ eval(code, sandbox.send(:binding))
189
+ end
190
+ value = thread.value
191
+ result = Marshal.load(Marshal.dump(thread.value))
192
+ rescue Exception => error
193
+ error = Marshal.load(Marshal.dump(error))
194
+ end
195
+
196
+ return result, error
197
+ end
198
+ end
199
+
@@ -0,0 +1,135 @@
1
+ # external.rb
2
+ # @Author: Thomas Link (samul AT web.de)
3
+ # @Website: http://deplate.sf.net/
4
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
+ # @Created: 04-Sep-2004.
6
+ # @Last Change: 28-Okt-2005.
7
+ # @Revision: 0.168
8
+
9
+ require "ps2ppm"
10
+
11
+ # Description:
12
+ #
13
+ # Usage:
14
+ #
15
+ # TODO:
16
+ #
17
+ # CHANGES:
18
+ #
19
+
20
+ module Deplate::External
21
+ @@apps = {}
22
+
23
+ module_function
24
+ def def_app(name, filename)
25
+ @@apps[name] = filename
26
+ end
27
+
28
+ def get_app(name, default=nil)
29
+ @@apps[name] || default || name
30
+ end
31
+
32
+ def log_popen(container, cmd)
33
+ rv = []
34
+ if container.deplate.options.allow_external
35
+ container.log(["PWD", Dir.pwd])
36
+ container.log(["Exec", cmd])
37
+ begin
38
+ IO.popen(cmd, "w+") do |io|
39
+ if block_given?
40
+ yield(io)
41
+ else
42
+ until io.eof
43
+ l = io.gets
44
+ rv << l
45
+ puts l
46
+ end
47
+ end
48
+ end
49
+ rescue StandardError => e
50
+ container.log(["Error when running command", cmd, e], :error)
51
+ end
52
+ else
53
+ container.log(["Disabled", cmd], :error)
54
+ container.log("Use -X command line option to enable external commands", :newbie)
55
+ end
56
+ return rv.join("\n")
57
+ end
58
+
59
+ # The method assumes that the file should be created in the current
60
+ # directory, i.e., that the proper working directory was previously
61
+ # set
62
+ def write_file(container, filename, &block)
63
+ if container.deplate.options.allow_external
64
+ File.open(filename, "w") {|io| block.call(io)}
65
+ end
66
+ end
67
+
68
+ def latex(instance, texfile)
69
+ log_popen(instance, "#{get_app('latex')} -interaction=nonstopmode #{texfile}")
70
+ end
71
+
72
+ def kpsewhich(instance, bibfile)
73
+ bibfile = File.basename(bibfile)
74
+ log_popen(instance, "#{get_app('kpsewhich')} #{bibfile}")
75
+ end
76
+
77
+ def dvi2ps(instance, dvifile, psfile, other_options=nil)
78
+ log_popen(instance, "#{get_app('dvips')} -E -Z -D 300 #{other_options} -o #{psfile} #{dvifile}")
79
+ end
80
+
81
+ def ps2img(instance, device, psfile, outfile, args)
82
+ r = args["rx"] || instance.deplate.variables["ps2imgRes"] || 96
83
+ # r = args["rx"] || instance.deplate.variables["ps2imgRes"] || 120
84
+ # r = args["rx"] || 140
85
+ # case device
86
+ # when "pdf"
87
+ # log_popen(instance, "#{get_app('ps2pdf'} #{psfile} #{outfile}")
88
+ # else
89
+ # log_popen(instance, "#{get_app('ps2ppm'} -o -r #{r} -g -t -f #{device} #{psfile}")
90
+ # log_popen(instance, "#{get_app('convert'} -antialias -density #{r}x#{r} #{psfile} #{outfile}")
91
+ Ps2ppm.run(psfile, "o" => true, "r" => r, "g" => true, "t" => true, "f" => device)
92
+ # end
93
+ end
94
+
95
+ def dot(instance, device, dotfile, outfile, command_line_args=[])
96
+ c = command_line_args.join(" ")
97
+ log_popen(instance, "#{get_app('dot')} -T#{device} -o#{outfile} #{c} #{dotfile}")
98
+ end
99
+
100
+ def neato(instance, device, dotfile, outfile, command_line_args=[])
101
+ c = command_line_args.join(" ")
102
+ log_popen(instance, "#{get_app('neato')} -T#{device} -o#{outfile} #{c} #{dotfile}")
103
+ end
104
+
105
+ def r(instance, rfile, outfile)
106
+ c = "#{get_app('R')} CMD BATCH --slave --restore --no-save #{rfile} #{outfile}"
107
+ log_popen(instance, c)
108
+ end
109
+
110
+ # return the bounding box as [bw, bh, bx, by]
111
+ def image_dimension(filename)
112
+ # `identify "#{filename}"`.scan(/(\d+)x(\d+)\+(\d+)\+(\d+)/).flatten
113
+ rv = {}
114
+ begin
115
+ unless filename =~ /\.(pdf)$/
116
+ for line in `#{get_app('identify')} -verbose "#{filename}"`
117
+ if line =~ /^\s*Geometry: /
118
+ bw = line.scan(/(\d+)x(\d+)(\+(\d+)\+(\d+))?/).flatten
119
+ bw.delete_at(2)
120
+ rv[:bw] = bw.collect {|x| x ? x.to_i : nil}
121
+ elsif line =~ /^\s*Resolution:/
122
+ res = line.scan(/(\d+)x(\d+)/).flatten
123
+ rv[:res] = res[0].to_i
124
+ end
125
+ end
126
+ end
127
+ return rv
128
+ rescue Exception => e
129
+ Deplate::Core.log(["Running identify failed", filename, e], :error)
130
+ end
131
+ return nil
132
+ end
133
+
134
+ end
135
+
@@ -0,0 +1,21 @@
1
+ # dbk-article.rb
2
+ # @Author: Thomas Link (samul AT web.de)
3
+ # @Website: http://deplate.sf.net/
4
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
+ # @Created: 17-M�r-2004.
6
+ # @Last Change: 23-Okt-2005.
7
+ # @Revision: 0.2056
8
+
9
+ require "deplate/docbook"
10
+ require "deplate/fmt/dbk-article"
11
+
12
+ class Deplate::Formatter::DbkArticle412 < Deplate::Formatter::DbkArticle
13
+ self.myname = "dbk-article-4.1.2"
14
+ self.rx = /dbk|dbk-article|docbook/i
15
+
16
+ def setup
17
+ @deplate.variables['dbkClass'] ||= 'article'
18
+ @deplate.variables['dbkVersion'] ||= '4.1.2'
19
+ end
20
+ end
21
+
@@ -0,0 +1,46 @@
1
+ # dbk-article.rb
2
+ # @Author: Thomas Link (samul AT web.de)
3
+ # @Website: http://deplate.sf.net/
4
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
+ # @Created: 17-M�r-2004.
6
+ # @Last Change: 23-Okt-2005.
7
+ # @Revision: 0.2058
8
+
9
+ require "deplate/docbook"
10
+
11
+ class Deplate::Formatter::DbkArticle < Deplate::Formatter::Docbook
12
+ self.myname = "dbk-article"
13
+ self.rx = /dbk|dbk-article|docbook/i
14
+
15
+ def initialize(deplate, args)
16
+ @headings = ['sect1', 'sect2', 'sect3', 'sect4', 'sect5', 'sect6']
17
+ super
18
+ end
19
+
20
+ def setup
21
+ @deplate.variables['dbkClass'] ||= 'article'
22
+ end
23
+
24
+ # Document skeleton
25
+ def get_doc_open(args)
26
+ o = []
27
+ lang = @deplate.options.messages.prop('lang', self)
28
+ if lang
29
+ o << %{ lang="#{lang}"}
30
+ end
31
+ return "<article%s>" % o.join
32
+ end
33
+
34
+ def get_doc_close(args)
35
+ return "</article>"
36
+ end
37
+
38
+ def get_doc_head_open(args)
39
+ return "<articleinfo>"
40
+ end
41
+
42
+ def get_doc_head_close(args)
43
+ return "</articleinfo>"
44
+ end
45
+ end
46
+
@@ -0,0 +1,46 @@
1
+ # dbk-book.rb
2
+ # @Author: Thomas Link (samul AT web.de)
3
+ # @Website: http://deplate.sf.net/
4
+ # @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5
+ # @Created: 17-M�r-2004.
6
+ # @Last Change: 23-Okt-2005.
7
+ # @Revision: 0.2052
8
+
9
+ require "deplate/docbook"
10
+
11
+ class Deplate::Formatter::DbkBook < Deplate::Formatter::Docbook
12
+ self.myname = "dbk-book"
13
+ self.rx = /dbk|dbk-book|docbook/i
14
+
15
+ def initialize(deplate, args)
16
+ @headings = ["chapter", "sect1", "sect2", "sect3", "sect4", "sect5", "sect6"]
17
+ super
18
+ end
19
+
20
+ def setup
21
+ @deplate.variables['dbkClass'] ||= 'book'
22
+ end
23
+
24
+ # Document skeleton
25
+ def get_doc_open(args)
26
+ o = []
27
+ lang = @deplate.options.messages.prop('lang', self)
28
+ if lang
29
+ o << %{ lang="#{lang}"}
30
+ end
31
+ return "<book%s>" % o.join
32
+ end
33
+
34
+ def get_doc_close(args)
35
+ return "</book>"
36
+ end
37
+
38
+ def get_doc_head_open(args)
39
+ return "<bookinfo>"
40
+ end
41
+
42
+ def get_doc_head_close(args)
43
+ return "</bookinfo>"
44
+ end
45
+ end
46
+