deplate 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS.TXT +26 -0
- data/CHANGES.TXT +177 -0
- data/LICENSE.TXT +340 -0
- data/NEWS.TXT +29 -0
- data/README.TXT +86 -0
- data/TODO.TXT +202 -0
- data/VERSION.TXT +1 -0
- data/bin/deplate +3 -0
- data/bin/deplate.bat +2 -0
- data/etc/deplate.ini +361 -0
- data/lib/deplate.rb +31 -0
- data/lib/deplate/abstract-class.rb +30 -0
- data/lib/deplate/builtin.rb +11 -0
- data/lib/deplate/cache.rb +59 -0
- data/lib/deplate/commands.rb +693 -0
- data/lib/deplate/common.rb +335 -0
- data/lib/deplate/converter.rb +99 -0
- data/lib/deplate/core.rb +2705 -0
- data/lib/deplate/css/article.css +545 -0
- data/lib/deplate/css/deplate.css +699 -0
- data/lib/deplate/css/heading-navbar.css +29 -0
- data/lib/deplate/css/layout-deplate-print.css +540 -0
- data/lib/deplate/css/layout-deplate.css +764 -0
- data/lib/deplate/css/sans-serif.css +160 -0
- data/lib/deplate/css/serif-e.css +170 -0
- data/lib/deplate/css/serif-rel.css +121 -0
- data/lib/deplate/css/serif.css +190 -0
- data/lib/deplate/css/slides.css +11 -0
- data/lib/deplate/css/tabbar-left.css +91 -0
- data/lib/deplate/css/tabbar-right-ie.css +14 -0
- data/lib/deplate/css/tabbar-right.css +118 -0
- data/lib/deplate/css/tabbar-top.css +64 -0
- data/lib/deplate/css/tabbar.css +81 -0
- data/lib/deplate/css/text-sans-serif.css +154 -0
- data/lib/deplate/css/text-serif.css +175 -0
- data/lib/deplate/define.rb +439 -0
- data/lib/deplate/docbook.rb +738 -0
- data/lib/deplate/elements.rb +1355 -0
- data/lib/deplate/etc.rb +199 -0
- data/lib/deplate/external.rb +135 -0
- data/lib/deplate/fmt/dbk-article-4.1.2.rb +21 -0
- data/lib/deplate/fmt/dbk-article.rb +46 -0
- data/lib/deplate/fmt/dbk-book.rb +46 -0
- data/lib/deplate/fmt/dbk-ref.rb +105 -0
- data/lib/deplate/fmt/dbk-slides.rb +47 -0
- data/lib/deplate/fmt/dbk-snippet.rb +21 -0
- data/lib/deplate/fmt/html-snippet.rb +21 -0
- data/lib/deplate/fmt/html.rb +1696 -0
- data/lib/deplate/fmt/htmlsite.rb +419 -0
- data/lib/deplate/fmt/htmlslides.rb +21 -0
- data/lib/deplate/fmt/htmlwebsite.rb +70 -0
- data/lib/deplate/fmt/latex-snippet.rb +22 -0
- data/lib/deplate/fmt/latex.rb +1242 -0
- data/lib/deplate/fmt/php.rb +19 -0
- data/lib/deplate/fmt/phpsite.rb +19 -0
- data/lib/deplate/fmt/plain.rb +598 -0
- data/lib/deplate/fmt/template.rb +34 -0
- data/lib/deplate/fmt/xhtml10t.rb +41 -0
- data/lib/deplate/formatter-snippet.rb +17 -0
- data/lib/deplate/formatter.rb +1210 -0
- data/lib/deplate/input.rb +492 -0
- data/lib/deplate/input/deplate-headings.rb +48 -0
- data/lib/deplate/input/deplate-restricted.rb +70 -0
- data/lib/deplate/input/deplate.rb +28 -0
- data/lib/deplate/input/rdoc.rb +277 -0
- data/lib/deplate/input/template.rb +29 -0
- data/lib/deplate/lib/latex/highlight-extra.sty +15 -0
- data/lib/deplate/lib/latex/highlight-typical.sty +15 -0
- data/lib/deplate/lib/tabmenu.js +146 -0
- data/lib/deplate/locale/de.latin1 +708 -0
- data/lib/deplate/locale/ru.koi8-r +48 -0
- data/lib/deplate/locale/zh_cn.gb2312 +35 -0
- data/lib/deplate/macros.rb +639 -0
- data/lib/deplate/messages.rb +120 -0
- data/lib/deplate/metadata.rb +77 -0
- data/lib/deplate/metadata/marshal.rb +24 -0
- data/lib/deplate/metadata/xml.rb +42 -0
- data/lib/deplate/metadata/yaml.rb +26 -0
- data/lib/deplate/mod/anyword.rb +56 -0
- data/lib/deplate/mod/babelfish.rb +27 -0
- data/lib/deplate/mod/code-gvim.rb +52 -0
- data/lib/deplate/mod/code-highlight.rb +91 -0
- data/lib/deplate/mod/colored-log.rb +17 -0
- data/lib/deplate/mod/de.rb +19 -0
- data/lib/deplate/mod/en.rb +17 -0
- data/lib/deplate/mod/endnotes.rb +60 -0
- data/lib/deplate/mod/fr.rb +46 -0
- data/lib/deplate/mod/html-asciimath.rb +40 -0
- data/lib/deplate/mod/html-deplate-button.rb +15 -0
- data/lib/deplate/mod/html-headings-navbar.rb +39 -0
- data/lib/deplate/mod/html-obfuscate-email.rb +47 -0
- data/lib/deplate/mod/html-sidebar.rb +232 -0
- data/lib/deplate/mod/htmlslides-navbar-fh.rb +32 -0
- data/lib/deplate/mod/iconv.rb +35 -0
- data/lib/deplate/mod/imgurl.rb +30 -0
- data/lib/deplate/mod/inlatex-compound.rb +69 -0
- data/lib/deplate/mod/koma.rb +109 -0
- data/lib/deplate/mod/latex-emph-table-head.rb +38 -0
- data/lib/deplate/mod/latex-styles.rb +461 -0
- data/lib/deplate/mod/latex-verbatim-small.rb +29 -0
- data/lib/deplate/mod/makefile.rb +194 -0
- data/lib/deplate/mod/mark-external-urls.rb +38 -0
- data/lib/deplate/mod/markup-1-warn.rb +37 -0
- data/lib/deplate/mod/markup-1.rb +41 -0
- data/lib/deplate/mod/navbar-png.rb +33 -0
- data/lib/deplate/mod/noindent.rb +32 -0
- data/lib/deplate/mod/numpara.rb +40 -0
- data/lib/deplate/mod/particle-math.rb +34 -0
- data/lib/deplate/mod/php-extra.rb +44 -0
- data/lib/deplate/mod/pstoedit.rb +71 -0
- data/lib/deplate/mod/recode.rb +57 -0
- data/lib/deplate/mod/ru_koi8-r.rb +20 -0
- data/lib/deplate/mod/smiley.rb +50 -0
- data/lib/deplate/mod/soffice.rb +23 -0
- data/lib/deplate/mod/symbols-latin1.rb +58 -0
- data/lib/deplate/mod/symbols-od-utf-8.rb +16 -0
- data/lib/deplate/mod/symbols-plain.rb +58 -0
- data/lib/deplate/mod/symbols-sgml.rb +97 -0
- data/lib/deplate/mod/symbols-utf-8.rb +81 -0
- data/lib/deplate/mod/symbols-xml.rb +34 -0
- data/lib/deplate/mod/syntax-region-alt.rb +37 -0
- data/lib/deplate/mod/utf8.rb +49 -0
- data/lib/deplate/mod/validate-html.rb +35 -0
- data/lib/deplate/mod/xmlrpc.rb +233 -0
- data/lib/deplate/mod/zh-cn-autospace.rb +108 -0
- data/lib/deplate/mod/zh-cn.rb +59 -0
- data/lib/deplate/once-method.rb +44 -0
- data/lib/deplate/output.rb +249 -0
- data/lib/deplate/particles.rb +815 -0
- data/lib/deplate/regions.rb +1076 -0
- data/lib/deplate/structured.rb +763 -0
- data/lib/deplate/template.rb +430 -0
- data/lib/deplate/templates/html-doc.html +28 -0
- data/lib/deplate/templates/html-left-tabbar-js.html +37 -0
- data/lib/deplate/templates/html-left-tabbar.html +31 -0
- data/lib/deplate/templates/html-tabbar-right-table.html +43 -0
- data/lib/deplate/templates/html-tabbar-right.html +23 -0
- data/lib/deplate/templates/html-tabbar-top.html +43 -0
- data/lib/deplate/templates/html-tabbar.html +31 -0
- data/lib/deplate/wiki-markup.rb +117 -0
- data/lib/deplate/xml.rb +109 -0
- data/lib/deplate/zh-cn.rb +59 -0
- data/lib/ps2ppm.rb +239 -0
- data/man/man1/deplate.1 +692 -0
- metadata +210 -0
data/lib/deplate/etc.rb
ADDED
@@ -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
|
+
|