deplate 0.7.3 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS.TXT +3 -0
- data/CHANGES.TXT +248 -175
- data/LICENSE.TXT +0 -0
- data/NEWS.TXT +28 -24
- data/README.TXT +0 -0
- data/TODO.TXT +174 -88
- data/VERSION.TXT +1 -1
- data/bin/deplate +0 -0
- data/bin/deplate.bat +0 -0
- data/etc/deplate.ini +91 -3
- data/lib/action_view/helpers/deplate.rb +45 -0
- data/lib/deplate.rb +6 -1
- data/lib/deplate/abstract-class.rb +0 -0
- data/lib/deplate/bib.rb +576 -0
- data/lib/deplate/builtin.rb +0 -0
- data/lib/deplate/cache.rb +55 -5
- data/lib/deplate/commands.rb +346 -183
- data/lib/deplate/common.rb +209 -48
- data/lib/deplate/converter.rb +12 -6
- data/lib/deplate/core.rb +777 -378
- data/lib/deplate/counters.rb +254 -0
- data/lib/deplate/css/article.css +4 -3
- data/lib/deplate/css/deplate.css +121 -5
- data/lib/deplate/css/heading-navbar.css +0 -0
- data/lib/deplate/css/layout-deplate-print.css +0 -0
- data/lib/deplate/css/layout-deplate.css +0 -0
- data/lib/deplate/css/sans-serif.css +0 -0
- data/lib/deplate/css/serif-e.css +0 -0
- data/lib/deplate/css/serif-rel.css +0 -0
- data/lib/deplate/css/serif.css +9 -3
- data/lib/deplate/css/slides.css +0 -0
- data/lib/deplate/css/tabbar-left.css +0 -0
- data/lib/deplate/css/tabbar-right-ie.css +3 -9
- data/lib/deplate/css/tabbar-right.css +51 -18
- data/lib/deplate/css/tabbar-top.css +7 -1
- data/lib/deplate/css/tabbar.css +0 -0
- data/lib/deplate/css/text-sans-serif.css +0 -0
- data/lib/deplate/css/text-serif.css +0 -0
- data/lib/deplate/define.rb +183 -177
- data/lib/deplate/deplate-string.rb +82 -0
- data/lib/deplate/docbook.rb +236 -128
- data/lib/deplate/elements.rb +584 -417
- data/lib/deplate/etc.rb +163 -101
- data/lib/deplate/external.rb +42 -11
- data/lib/deplate/fmt/dbk-article-4.1.2.rb +0 -0
- data/lib/deplate/fmt/dbk-article.rb +0 -0
- data/lib/deplate/fmt/dbk-book.rb +0 -0
- data/lib/deplate/fmt/dbk-ref.rb +3 -3
- data/lib/deplate/fmt/dbk-slides.rb +0 -0
- data/lib/deplate/fmt/dbk-snippet.rb +0 -0
- data/lib/deplate/fmt/html-snippet.rb +0 -0
- data/lib/deplate/fmt/html.rb +783 -550
- data/lib/deplate/fmt/htmlsite.rb +192 -199
- data/lib/deplate/fmt/htmlslides.rb +0 -0
- data/lib/deplate/fmt/htmlwebsite.rb +3 -3
- data/lib/deplate/fmt/latex-snippet.rb +0 -0
- data/lib/deplate/fmt/latex.rb +242 -83
- data/lib/deplate/fmt/null.rb +32 -0
- data/lib/deplate/fmt/php.rb +4 -4
- data/lib/deplate/fmt/phpsite.rb +6 -5
- data/lib/deplate/fmt/plain.rb +160 -106
- data/lib/deplate/fmt/template.rb +0 -0
- data/lib/deplate/fmt/xhtml10t.rb +0 -0
- data/lib/deplate/formatter-snippet.rb +0 -0
- data/lib/deplate/formatter.rb +613 -301
- data/lib/deplate/input.rb +202 -142
- data/lib/deplate/input/deplate-headings.rb +4 -6
- data/lib/deplate/input/deplate-restricted.rb +15 -9
- data/lib/deplate/input/deplate.rb +2 -4
- data/lib/deplate/input/rdoc.rb +39 -38
- data/lib/deplate/input/template.rb +0 -0
- data/lib/deplate/lib/Makefile.config +29 -0
- data/lib/deplate/lib/latex/deplate.sty +54 -0
- data/lib/deplate/lib/latex/highlight-extra.sty +0 -0
- data/lib/deplate/lib/latex/highlight-typical.sty +0 -0
- data/lib/deplate/lib/php/page-comment.inc.php +216 -0
- data/lib/deplate/lib/tabmenu.js +0 -0
- data/lib/deplate/locale/de.latin1 +155 -17
- data/lib/deplate/locale/ru.koi8-r +0 -0
- data/lib/deplate/locale/zh_cn.gb2312 +0 -0
- data/lib/deplate/macros.rb +133 -82
- data/lib/deplate/messages.rb +6 -4
- data/lib/deplate/metadata.rb +0 -0
- data/lib/deplate/metadata/marshal.rb +0 -0
- data/lib/deplate/metadata/xml.rb +0 -0
- data/lib/deplate/metadata/yaml.rb +0 -0
- data/lib/deplate/mod/anyword.rb +3 -3
- data/lib/deplate/mod/babelfish.rb +4 -4
- data/lib/deplate/mod/code-gvim.rb +8 -4
- data/lib/deplate/mod/code-highlight.rb +3 -3
- data/lib/deplate/mod/colored-log.rb +0 -0
- data/lib/deplate/mod/de.rb +2 -2
- data/lib/deplate/mod/en.rb +0 -0
- data/lib/deplate/mod/endnotes.rb +0 -0
- data/lib/deplate/mod/fr.rb +0 -0
- data/lib/deplate/mod/html-asciimath.rb +0 -0
- data/lib/deplate/mod/html-deplate-button.rb +0 -0
- data/lib/deplate/mod/html-headings-navbar.rb +5 -13
- data/lib/deplate/mod/html-jsmath.rb +39 -0
- data/lib/deplate/mod/html-obfuscate-email.rb +3 -3
- data/lib/deplate/mod/html-sidebar.rb +0 -0
- data/lib/deplate/mod/htmlslides-navbar-fh.rb +3 -3
- data/lib/deplate/mod/iconv.rb +0 -0
- data/lib/deplate/mod/imgurl.rb +4 -4
- data/lib/deplate/mod/inlatex-compound.rb +7 -10
- data/lib/deplate/mod/koma.rb +0 -0
- data/lib/deplate/mod/latex-emph-table-head.rb +0 -0
- data/lib/deplate/mod/latex-styles.rb +7 -4
- data/lib/deplate/mod/latex-verbatim-small.rb +0 -0
- data/lib/deplate/mod/makefile.rb +23 -7
- data/lib/deplate/mod/mark-external-urls.rb +3 -3
- data/lib/deplate/mod/markup-1-warn.rb +10 -10
- data/lib/deplate/mod/markup-1.rb +0 -0
- data/lib/deplate/mod/navbar-png.rb +24 -8
- data/lib/deplate/mod/noindent.rb +0 -0
- data/lib/deplate/mod/numpara.rb +0 -0
- data/lib/deplate/mod/particle-math.rb +4 -4
- data/lib/deplate/mod/php-extra.rb +46 -6
- data/lib/deplate/mod/pstoedit.rb +0 -0
- data/lib/deplate/mod/recode.rb +0 -0
- data/lib/deplate/mod/ru_koi8-r.rb +0 -0
- data/lib/deplate/mod/smart-dash.rb +26 -0
- data/lib/deplate/mod/smiley.rb +69 -7
- data/lib/deplate/mod/soffice.rb +0 -0
- data/lib/deplate/mod/symbols-latin1.rb +14 -23
- data/lib/deplate/mod/symbols-od-utf-8.rb +5 -3
- data/lib/deplate/mod/symbols-plain.rb +5 -35
- data/lib/deplate/mod/symbols-sgml.rb +8 -9
- data/lib/deplate/mod/symbols-utf-8.rb +8 -9
- data/lib/deplate/mod/symbols-xml.rb +5 -9
- data/lib/deplate/mod/syntax-region-alt.rb +5 -5
- data/lib/deplate/mod/utf8.rb +0 -0
- data/lib/deplate/mod/validate-html.rb +0 -0
- data/lib/deplate/mod/xmlrpc.rb +0 -0
- data/lib/deplate/mod/zh-cn-autospace.rb +18 -20
- data/lib/deplate/mod/zh-cn.rb +4 -6
- data/lib/deplate/nukumi2.rb +71 -0
- data/lib/deplate/once-method.rb +0 -0
- data/lib/deplate/output.rb +19 -21
- data/lib/deplate/particles.rb +178 -116
- data/lib/deplate/regions.rb +99 -58
- data/lib/deplate/skeletons.rb +122 -0
- data/lib/deplate/structured.rb +164 -106
- data/lib/deplate/template.rb +67 -43
- data/lib/deplate/templates/html-doc.html +0 -0
- data/lib/deplate/templates/html-left-tabbar-js.html +0 -0
- data/lib/deplate/templates/html-left-tabbar.html +0 -0
- data/lib/deplate/templates/html-tabbar-right-pcomments.php +22 -0
- data/lib/deplate/templates/html-tabbar-right-step.html +24 -0
- data/lib/deplate/templates/html-tabbar-right-table.html +0 -0
- data/lib/deplate/templates/html-tabbar-right.html +2 -4
- data/lib/deplate/templates/html-tabbar-top.html +0 -9
- data/lib/deplate/templates/html-tabbar.html +0 -0
- data/lib/deplate/variables.rb +127 -0
- data/lib/deplate/wiki-markup.rb +99 -33
- data/lib/deplate/xml.rb +18 -18
- data/lib/deplate/zh-cn.rb +0 -0
- data/lib/ps2ppm.rb +0 -0
- data/man/man1/deplate.1 +564 -474
- metadata +201 -186
data/lib/deplate/xml.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# @Website: http://deplate.sf.net/
|
4
4
|
# @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
5
5
|
# @Created: 17-M�r-2004.
|
6
|
-
# @Last Change:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 15-Apr-2006.
|
7
|
+
# @Revision: 0.2315
|
8
8
|
#
|
9
9
|
# TODO:
|
10
10
|
# -
|
@@ -26,7 +26,7 @@ class Deplate::Formatter::XML < Deplate::Formatter::Structured
|
|
26
26
|
"�" => Proc.new {|e| symbol_paragraph(nil)},
|
27
27
|
"<" => Proc.new {|e| symbol_lt(nil)},
|
28
28
|
">" => Proc.new {|e| symbol_gt(nil)},
|
29
|
-
" " => Proc.new {|e| e ? nonbreakingspace(nil) :
|
29
|
+
" " => Proc.new {|e| e ? nonbreakingspace(nil) : ' '},
|
30
30
|
}
|
31
31
|
build_plain_text_rx
|
32
32
|
@encodings = {
|
@@ -34,37 +34,37 @@ class Deplate::Formatter::XML < Deplate::Formatter::Structured
|
|
34
34
|
'latin9' => 'ISO-8859-15',
|
35
35
|
}
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def pre_process
|
39
|
+
super
|
39
40
|
@encoding = canonic_enc_name(@deplate.variables["encoding"] || "utf-8")
|
40
41
|
if @deplate.options.symbols_encoding
|
41
42
|
symbols = @deplate.options.symbols_encoding
|
42
|
-
elsif @deplate.variables[
|
43
|
+
elsif @deplate.variables['sgml']
|
43
44
|
symbols = :sgml
|
44
|
-
require
|
45
|
+
require 'deplate/mod/symbols-sgml' unless @deplate.symbols[symbols]
|
45
46
|
@sgml = true
|
46
47
|
else
|
47
48
|
case @encoding
|
48
|
-
when
|
49
|
-
symbols =
|
50
|
-
require
|
49
|
+
when 'ISO-8859-1', 'ISO-8859-15'
|
50
|
+
symbols = 'ISO-8859-1'
|
51
|
+
require 'deplate/mod/symbols-latin1' unless @deplate.symbols[symbols]
|
51
52
|
else
|
52
53
|
symbols = :xml
|
53
|
-
require
|
54
|
+
require 'deplate/mod/symbols-xml' unless @deplate.symbols[symbols]
|
54
55
|
end
|
55
56
|
end
|
56
57
|
if @sgml
|
57
|
-
require
|
58
|
+
require 'deplate/mod/noindent'
|
58
59
|
Deplate::NoIndent.setup(self)
|
59
60
|
end
|
60
|
-
@deplate.
|
61
|
-
|
62
|
-
|
63
|
-
self.extend(mod)
|
61
|
+
klass = @deplate.symbols[symbols]
|
62
|
+
if klass
|
63
|
+
@symbol_proxy = klass.new(@deplate)
|
64
64
|
else
|
65
|
-
raise
|
65
|
+
raise 'Unknown symbols encoding: %s (%s)' % [symbols, @deplate.symbols.keys.join(', ')]
|
66
66
|
end
|
67
|
-
@deplate.variables[
|
67
|
+
@deplate.variables['refButton'] ||= '[%s]' % format_symbol(nil, '->')
|
68
68
|
end
|
69
69
|
|
70
70
|
def prepare
|
@@ -80,7 +80,7 @@ class Deplate::Formatter::XML < Deplate::Formatter::Structured
|
|
80
80
|
output_at(:pre, :body_beg, get_doc_body_open({}))
|
81
81
|
|
82
82
|
@deplate.postponed_print << Proc.new do
|
83
|
-
output_at(:
|
83
|
+
output_at(:body, :inner_body_end, close_headings(0))
|
84
84
|
output_at(:post, :body_end, get_doc_body_close({}))
|
85
85
|
output_at(:post, :doc_end, get_doc_close({}))
|
86
86
|
end
|
data/lib/deplate/zh-cn.rb
CHANGED
File without changes
|
data/lib/ps2ppm.rb
CHANGED
File without changes
|
data/man/man1/deplate.1
CHANGED
@@ -1,271 +1,319 @@
|
|
1
|
-
.\"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
.
|
11
|
-
|
12
|
-
.if n .sp
|
13
|
-
..
|
14
|
-
.de Ip \" List item
|
15
|
-
.br
|
16
|
-
.ie \\n(.$>=3 .ne \\$3
|
17
|
-
.el .ne 3
|
18
|
-
.IP "\\$1" \\$2
|
19
|
-
..
|
20
|
-
.TH "DEPLATE" 1 "02. Nov 2005" "" ""
|
21
|
-
.SH NAME
|
22
|
-
deplate \- Deplate - convert wiki-like markup to latex, docbook, html, or �html-slides�
|
1
|
+
.\" ** You probably do not want to edit this file directly **
|
2
|
+
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
|
3
|
+
.\" Instead of manually editing it, you probably should edit the DocBook XML
|
4
|
+
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
|
5
|
+
.TH "DEPLATE" "1" "07. Jun 2006" "" ""
|
6
|
+
.\" disable hyphenation
|
7
|
+
.nh
|
8
|
+
.\" disable justification (adjust text to left margin only)
|
9
|
+
.ad l
|
10
|
+
.SH "NAME"
|
11
|
+
deplate \- Deplate 0.8 \-\- convert wiki\-like markup to latex, docbook, html, or "html\-slides"
|
23
12
|
.SH "USAGE"
|
24
|
-
|
25
13
|
.PP
|
26
14
|
The command\-line options:
|
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
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
\-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
deplate
|
145
|
-
|
146
|
-
|
147
|
-
.
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
.TP
|
156
|
-
deplate \-R \-
|
157
|
-
Convert all files in the current directory and
|
158
|
-
|
15
|
+
.sp
|
16
|
+
.nf
|
17
|
+
Usage: deplate.rb [OPTIONS] FILE [OTHER FILES ...]
|
18
|
+
|
19
|
+
|
20
|
+
deplate is a free software with ABSOLUTELY NO WARRANTY under
|
21
|
+
the terms of the GNU General Public License version 2.
|
22
|
+
|
23
|
+
|
24
|
+
General Options:
|
25
|
+
\-a, \-\-[no\-]ask On certain actions, query
|
26
|
+
user before overwriting files
|
27
|
+
\-A, \-\-allow ALLOW Allow certain things: l,
|
28
|
+
r, t, w, W, x, X, $
|
29
|
+
\-c, \-\-config FILE Alternative user cfg file
|
30
|
+
\-\-[no\-]clean Clean up temporary files
|
31
|
+
\-\-color Colored output
|
32
|
+
\-\-css NAME Copy NAME.css to the destination
|
33
|
+
directory, if inexistent
|
34
|
+
\-\-copy\-css NAME Copy NAME.css to the destination
|
35
|
+
directory
|
36
|
+
\-d, \-\-dir DIR Output directory
|
37
|
+
\-D, \-\-define NAME=VALUE Define a document option
|
38
|
+
\-e, \-\-[no\-]each Handle each file separately
|
39
|
+
\-\-[no\-]force Force output
|
40
|
+
\-f, \-\-format FORMAT Output format (default:
|
41
|
+
html)
|
42
|
+
\-\-[no\-]included Output body only
|
43
|
+
\-i, \-\-input NAME Input definition
|
44
|
+
\-\-list FILE A file that contains a list
|
45
|
+
of input files
|
46
|
+
\-\-log FILE A file (or \- for stdout)
|
47
|
+
where to put the log
|
48
|
+
\-\-[no\-]loop Read from stdin forever
|
49
|
+
and ever
|
50
|
+
\-\-metadata [NAME] Save metadata in this format
|
51
|
+
(default: yaml)
|
52
|
+
\-m, \-\-module MODULE Load a module
|
53
|
+
\-o, \-\-out FILE Output to file or stdout
|
54
|
+
('\-')
|
55
|
+
\-p, \-\-pattern GLOBPATTERN File name pattern
|
56
|
+
\-P, \-\-exclude GLOBPATTERN Excluded file name pattern
|
57
|
+
\-r, \-\-[no\-]recurse Recurse into directories
|
58
|
+
\-\-reset\-filecache Reset the file database
|
59
|
+
\-R, \-\-[no\-]Recurse Recurse and rebuild hierarchy
|
60
|
+
\-s, \-\-skeleton NAME Make skeleton available
|
61
|
+
\-\-[no\-]simple\-names Disable simple wiki names
|
62
|
+
\-\-split\-level LEVEL Heading level for splitting
|
63
|
+
\-\-suffix SUFFIX Suffix for output files
|
64
|
+
\-t, \-\-template NAME Template to use
|
65
|
+
\-\-[no\-]vanilla Ignore user configuration
|
66
|
+
\-x, \-\-allow\-ruby [RUBY SAFE] Allow the execution of ruby
|
67
|
+
code
|
68
|
+
\-X, \-\-[no\-]allow\-exec Allow the execution of helper
|
69
|
+
applications
|
70
|
+
\-\-[no\-]external
|
71
|
+
|
72
|
+
|
73
|
+
LaTeX Formatter:
|
74
|
+
\-\-[no\-]pdf Prepare for use with pdf(la)tex
|
75
|
+
|
76
|
+
|
77
|
+
Available input defintions:
|
78
|
+
deplate, deplate\-headings, deplate\-restricted, rdoc, template
|
79
|
+
|
80
|
+
|
81
|
+
Available formatters:
|
82
|
+
dbk\-article, dbk\-article\-4.1.2, dbk\-book, dbk\-ref, dbk\-slides,
|
83
|
+
dbk\-snippet, html, html\-snippet, htmlsite, htmlslides, htmlwebsite,
|
84
|
+
latex, latex\-snippet, null, php, phpsite, plain, template, xhtml10t
|
85
|
+
|
86
|
+
|
87
|
+
Available metadata formats:
|
88
|
+
marshal, xml, yaml
|
89
|
+
|
90
|
+
|
91
|
+
Available modules:
|
92
|
+
anyword, babelfish, code\-gvim, code\-highlight, colored\-log, de,
|
93
|
+
en, endnotes, fr, html\-asciimath, html\-deplate\-button, html\-headings\-navbar,
|
94
|
+
html\-jsmath, html\-obfuscate\-email, html\-sidebar, htmlslides\-navbar\-fh,
|
95
|
+
iconv, imgurl, inlatex\-compound, koma, latex\-emph\-table\-head,
|
96
|
+
latex\-styles, latex\-verbatim\-small, makefile, mark\-external\-urls,
|
97
|
+
markup\-1, markup\-1\-warn, navbar\-png, noindent, numpara, particle\-math,
|
98
|
+
php\-extra, pstoedit, recode, ru_koi8\-r, smart\-dash, smiley, soffice,
|
99
|
+
symbols\-latin1, symbols\-od\-utf\-8, symbols\-plain, symbols\-sgml,
|
100
|
+
symbols\-utf\-8, symbols\-xml, syntax\-region\-alt, utf8, validate\-html,
|
101
|
+
xmlrpc, zh\-cn, zh\-cn\-autospace
|
102
|
+
|
103
|
+
|
104
|
+
Available css files:
|
105
|
+
article, deplate, heading\-navbar, layout\-deplate, layout\-deplate\-print,
|
106
|
+
sans\-serif, serif, serif\-e, serif\-rel, slides, tabbar, tabbar\-left,
|
107
|
+
tabbar\-right, tabbar\-right\-ie, tabbar\-top, text\-sans\-serif, text\-serif
|
108
|
+
|
109
|
+
|
110
|
+
Available templates:
|
111
|
+
html\-doc.html, html\-left\-tabbar\-js.html, html\-left\-tabbar.html,
|
112
|
+
html\-tabbar\-right\-pcomments.php, html\-tabbar\-right\-step.html,
|
113
|
+
html\-tabbar\-right\-table.html, html\-tabbar\-right.html, html\-tabbar\-top.html,
|
114
|
+
html\-tabbar.html
|
115
|
+
|
116
|
+
|
117
|
+
Other Options:
|
118
|
+
\-\-debug [LEVEL] Show debug messages
|
119
|
+
\-\-[no\-]profile Profile execution
|
120
|
+
\-\-[no\-]quiet Be quiet
|
121
|
+
\-v, \-\-[no\-]verbose Run verbosely
|
122
|
+
\-h, \-\-help Show this message
|
123
|
+
\-\-list\-modules [REGEXP] List modules matching a
|
124
|
+
pattern
|
125
|
+
\-\-list\-css [REGEXP] List css files matching
|
126
|
+
a pattern
|
127
|
+
\-\-version Show version
|
128
|
+
\-\-microversion Show version
|
129
|
+
.fi
|
130
|
+
.PP
|
131
|
+
Typical uses of
|
132
|
+
deplate
|
133
|
+
are:
|
134
|
+
.TP
|
135
|
+
deplate \-D auxiliaryDirSuffix=_files text.txt
|
136
|
+
Convert the file to html; put auxiliary files that are created during the conversion process into a subdirectory called "text_files"
|
137
|
+
.TP
|
138
|
+
deplate \-d DESTDIR \-f htmlslides text*.txt
|
139
|
+
Convert a bunch of files to "html slides"; put the output into "DESTDIR"
|
140
|
+
.TP
|
141
|
+
deplate \-f latex \-\-pdf \-D suffix=txt text*.txt
|
142
|
+
Convert a bunch of files to a single LaTeX file and prepare for pdflatex; assume that the wiki files have a "txt" extension; wiki names referring to included files are transformed to internal references
|
143
|
+
.TP
|
144
|
+
deplate \-R \-p '\\*.txt' \-D suffix=txt \-o ../Wiki.tex WikiIndex.txt *
|
145
|
+
Convert all files in the current directory and below to a single LaTeX file; include only files with "txt" as suffix; put
|
146
|
+
WikiIndex.txt
|
147
|
+
first
|
148
|
+
.TP
|
149
|
+
deplate \-R \-e \-d ../Wiki_html *
|
150
|
+
Convert all files in the current directory and its subdirectories to html; save the output in directory
|
151
|
+
Wiki_html; rebuild the directory structure of the input files
|
159
152
|
.TP
|
160
153
|
deplate \- < INPUT > OUTPUT
|
161
|
-
Work as a filter by converting the input from stdin; this doesn
|
162
|
-
|
154
|
+
Work as a filter by converting the input from stdin; this doesn't actually work like a pipe though because all the input has to be read in order to generate the output
|
163
155
|
.TP
|
164
|
-
deplate \-x \-X file
|
165
|
-
Convert a file and allow the evaluation of embedded ruby code and the execution of external applications, e
|
166
|
-
|
156
|
+
deplate \-x \-X file.txt
|
157
|
+
Convert a file and allow the evaluation of embedded ruby code and the execution of external applications, e.g., latex. These command switches are necessary for some language elements to work.
|
167
158
|
.PP
|
168
159
|
Notes:
|
169
|
-
|
170
160
|
.TP
|
171
161
|
\-D VAR, \-D VAR=VALUE
|
172
|
-
You can define document variables via the command line; if no value is provided the variable is set to
|
173
|
-
|
174
|
-
The option parser library, which
|
175
|
-
|
162
|
+
You can define document variables via the command line; if no value is provided the variable is set to "1".
|
163
|
+
.sp
|
164
|
+
The option parser library, which
|
165
|
+
deplate
|
166
|
+
uses, doesn't deal well with spaces in command line arguments. This is why spaces have to be replaced with tildes; a tilde and backslashes have to be preceded with backslashes. Example:
|
167
|
+
\-D text=bla~bla\\~bla
|
168
|
+
sets the document variable
|
169
|
+
text
|
170
|
+
to "bla bla~bla". As a shell usually interpretes backslashes too, you would usually have to type
|
171
|
+
\-D text=bla~bla\\\\~bla.
|
176
172
|
.TP
|
177
173
|
\-e
|
178
174
|
Process each file separately
|
179
|
-
|
180
175
|
.TP
|
181
176
|
\-m, \-\-module MODULE
|
182
|
-
Load an add\-on/module (after loading the core and the formatter); modules reside in the deplate library directory or in the user configuration directory (
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
177
|
+
Load an add\-on/module (after loading the core and the formatter); modules reside in the deplate library directory or in the user configuration directory ("~/.deplate/mod/"); type
|
178
|
+
deplate \-\-help
|
179
|
+
to see a list of available modules.
|
180
|
+
.sp
|
181
|
+
After loading the module, deplate searches for the file "~/.deplate/after/mod/NAME.rb" which will be loaded if found.
|
182
|
+
.sp
|
183
|
+
German, Chinese, and Russian localizations are provided as modules.
|
188
184
|
.TP
|
189
185
|
\-p PATTERN, \-P PATTERN
|
190
|
-
Backslashes in the pattern must come in doubles; backslashes can be used to prevent the shell from expanding the pattern; e
|
191
|
-
|
186
|
+
Backslashes in the pattern must come in doubles; backslashes can be used to prevent the shell from expanding the pattern; e.g., in case you're using bash, you would usually type something like
|
187
|
+
\-p "\\\\*.txt"
|
192
188
|
.TP
|
193
189
|
\-x, \-\-allow\-ruby [RUBY SAFE]
|
194
|
-
Ruby
|
195
|
-
|
190
|
+
Ruby's SAFE variable has 5 levels (0=no checks/default .. 4=sandbox; at present, this also sets the SAFE variable for
|
191
|
+
deplate
|
192
|
+
itself, which doesn't work with SAFE set to 4)
|
196
193
|
.TP
|
197
194
|
\-X, \-\-[no\-]allow\-exec, \-\-[no\-]external
|
198
|
-
Allow the execution of external applications, e
|
199
|
-
|
195
|
+
Allow the execution of external applications, e.g., LaTeX. You won't be able to translate inline LaTeX unless you call
|
196
|
+
deplate
|
197
|
+
with this command line option. In order to make this permanent.
|
200
198
|
.TP
|
201
199
|
\-A, \-\-allow FLAGS
|
202
200
|
Flags is a list of comma separated letters which may contain:
|
203
|
-
|
204
201
|
.RS
|
205
|
-
|
202
|
+
.TP
|
203
|
+
l
|
204
|
+
Allow the
|
205
|
+
#LANG
|
206
|
+
command to automatically load a module of the language's name
|
207
|
+
.TP
|
208
|
+
r
|
209
|
+
Check files in $PWD/deplate.rc in some cases (e.g. check for a local config.rb); templates, css files, and library snippets are always searched in the
|
210
|
+
deplate.rc
|
211
|
+
directory too; if you want to allow a
|
212
|
+
deplate.ini
|
213
|
+
file in this directory, you have the add
|
214
|
+
allow r
|
215
|
+
to your private deplate.ini file (usually in
|
216
|
+
~/.deplate/)
|
217
|
+
.TP
|
218
|
+
t
|
219
|
+
Unfiltered (La)TeX
|
220
|
+
.TP
|
221
|
+
w
|
222
|
+
Enable the
|
223
|
+
#Write
|
224
|
+
region (directory local file names only)
|
225
|
+
.TP
|
226
|
+
W
|
227
|
+
Enable the
|
228
|
+
#Write
|
229
|
+
region (allow relative & absolute file names)
|
206
230
|
.TP
|
207
231
|
x
|
208
232
|
Same as \-x
|
209
|
-
|
210
233
|
.TP
|
211
234
|
X
|
212
235
|
Same as \-X
|
213
|
-
|
236
|
+
.TP
|
237
|
+
.
|
238
|
+
Allow sending methods to objects in the
|
239
|
+
arg
|
240
|
+
macro and friends.
|
214
241
|
.TP
|
215
242
|
:
|
216
|
-
Allow referencing options by prepending a name with
|
217
|
-
|
243
|
+
Allow referencing options by prepending a name with ":" in some situations (e.g. #IF tests).
|
218
244
|
.RE
|
219
245
|
.IP
|
220
|
-
|
246
|
+
You can remove the permission to do something by prepending a minus to the flag, e.g. by setting
|
247
|
+
\-\-allow \-x
|
248
|
+
on the command line after having allowed
|
249
|
+
x
|
250
|
+
in the deplate.ini file.
|
221
251
|
.PP
|
222
|
-
Some variables change the way
|
223
|
-
|
252
|
+
Some variables change the way
|
253
|
+
deplate
|
254
|
+
works.
|
224
255
|
.TP
|
225
256
|
autoFileNames
|
226
257
|
In multi\-file output, the file name is constructed from the top heading unless explicitely defined (id, caption, shortcaption)
|
227
|
-
|
228
258
|
.TP
|
229
259
|
auxiliaryDirSuffix
|
230
|
-
If defined, auxiliary files are saved in the subdirectory
|
231
|
-
|
260
|
+
If defined, auxiliary files are saved in the subdirectory
|
261
|
+
#{basename FILENAME}#{auxiliaryDirSuffix}. E.g., if
|
262
|
+
auxiliaryDirSuffix
|
263
|
+
is "_files" and the current file is "Test", then auxiliary files (images, on\-the\-fly generated files that are passed to external applications etc.) are saved in "Test_files".
|
232
264
|
.SS "Editor support"
|
233
|
-
|
265
|
+
.sp
|
266
|
+
.it 1 an-trap
|
267
|
+
.nr an-no-space-flag 1
|
268
|
+
.nr an-break-flag 1
|
269
|
+
.br
|
270
|
+
\fBGeneral remark\fR
|
271
|
+
.RS 3
|
234
272
|
.PP
|
235
|
-
As whitespace is significant in the context of lists and the like, you should not insert tab characters in the document but replace tabs with blanks/spaces
|
236
|
-
|
273
|
+
As whitespace is significant in the context of lists and the like, you should not insert tab characters in the document but replace tabs with blanks/spaces. Most editors can be tweaked to work this way.
|
237
274
|
.PP
|
238
|
-
If you absolutely want to insert tab characters or if you don
|
239
|
-
|
275
|
+
If you absolutely want to insert tab characters or if you don't know how to keep your editor from inserting tabs, you can set the
|
276
|
+
tabwidth
|
277
|
+
(default: 4) variable to the tab width setting of your editor.
|
278
|
+
deplate
|
279
|
+
will then try to expand tab characters.
|
280
|
+
.RE
|
281
|
+
.sp
|
282
|
+
.it 1 an-trap
|
283
|
+
.nr an-no-space-flag 1
|
284
|
+
.nr an-break-flag 1
|
285
|
+
.br
|
286
|
+
\fBVIM\fR
|
287
|
+
.RS 3
|
240
288
|
.PP
|
241
|
-
deplate
|
242
|
-
|
289
|
+
deplate
|
290
|
+
is the accompanying converter for the
|
291
|
+
[1]\&\fIVim viki plugin\fR, which supports all of
|
292
|
+
deplate's default markup.
|
293
|
+
.RE
|
243
294
|
.SH "CONFIGURATION"
|
244
|
-
|
245
295
|
.PP
|
246
|
-
Configuration requires some knowledge of the ruby language
|
247
|
-
|
296
|
+
Configuration requires some knowledge of the ruby language. If you don't already know ruby, ruby is a well designed,
|
297
|
+
\fIfully\fR
|
298
|
+
object\-oriented interpreted language in the spirit of Smalltalk (but with a rather modern syntax) plus some features from Perl and Lisp/Scheme (e.g. continuations).
|
248
299
|
.PP
|
249
|
-
The configuration files are regular ruby files and are loaded after requiring all the libraries necessary
|
250
|
-
|
300
|
+
The configuration files are regular ruby files and are loaded after requiring all the libraries necessary. Theses files reside in the directory "$HOME/.deplate/" or "$USERPROFILE/deplate.rc/". This directory may also contain custom modules or css files etc. On Win 2000/XP etc., $USERPROFILE is usually set to "C:\\Documents and Settings\\USERNAME\\".
|
251
301
|
.PP
|
252
302
|
The user configuration directory should look like this:
|
253
|
-
|
254
303
|
.TP 3
|
255
304
|
\(bu
|
256
|
-
|
257
|
-
|
305
|
+
~/.deplate/
|
258
306
|
.RS
|
259
307
|
.TP 3
|
260
308
|
\(bu
|
261
|
-
config
|
309
|
+
config.rb (the general user configuration file, which is loaded last)
|
262
310
|
.TP
|
263
311
|
\(bu
|
264
|
-
deplate
|
312
|
+
deplate.ini (an alternative way to configure
|
313
|
+
deplate)
|
265
314
|
.TP
|
266
315
|
\(bu
|
267
316
|
after/ (files that are loaded right after the corresponding formatter or module)
|
268
|
-
|
269
317
|
.RS
|
270
318
|
.TP 3
|
271
319
|
\(bu
|
@@ -276,9 +324,7 @@ input/
|
|
276
324
|
.TP
|
277
325
|
\(bu
|
278
326
|
mod/
|
279
|
-
.LP
|
280
327
|
.RE
|
281
|
-
.IP
|
282
328
|
.TP
|
283
329
|
\(bu
|
284
330
|
css/ (user defined css files)
|
@@ -290,264 +336,289 @@ fmt/ (user defined formatters)
|
|
290
336
|
input/ (user defined input definitions)
|
291
337
|
.TP
|
292
338
|
\(bu
|
293
|
-
lib/ (user defined
|
294
|
-
|
339
|
+
lib/ (user defined
|
340
|
+
deplate
|
341
|
+
snippets)
|
295
342
|
.RS
|
296
343
|
.TP 3
|
297
344
|
\(bu
|
298
|
-
FORMATTER/ (output\-format specific
|
299
|
-
|
345
|
+
FORMATTER/ (output\-format specific
|
346
|
+
deplate
|
347
|
+
snippets)
|
300
348
|
.RE
|
301
|
-
.IP
|
302
349
|
.TP
|
303
350
|
\(bu
|
304
351
|
mod/ (user defined modules)
|
305
352
|
.TP
|
306
353
|
\(bu
|
307
354
|
templates/ (user defined templates)
|
308
|
-
.LP
|
309
355
|
.RE
|
310
|
-
.IP
|
311
|
-
.LP
|
312
|
-
|
313
356
|
.PP
|
314
|
-
If the user requests loading
|
315
|
-
|
357
|
+
If the user requests loading "MODULE", deplate searches for "~/.deplate/mod/MODULE.rb" first, then in ruby site\-library. If it was found and loaded, the file "~/.deplate/after/mod/MODULE.rb" will be sourced, too \-\- if available.
|
316
358
|
.PP
|
317
|
-
deplate
|
318
|
-
|
359
|
+
deplate
|
360
|
+
calls the class method
|
361
|
+
Deplate::Core.user_setup
|
362
|
+
after processing the command line argumend. It calls the instance method
|
363
|
+
Deplate#user_initialize
|
364
|
+
after the new instance of the
|
365
|
+
deplate
|
366
|
+
converter was created and initialized, right before actually performing the conversion.
|
319
367
|
.PP
|
320
|
-
In general, configuration is done by patching ruby classes
|
321
|
-
|
368
|
+
In general, configuration is done by patching ruby classes. In the following example, we
|
322
369
|
.TP 3
|
323
370
|
\(bu
|
324
|
-
restrict the markers for unordered lists to
|
371
|
+
restrict the markers for unordered lists to "#"
|
325
372
|
.TP
|
326
373
|
\(bu
|
327
|
-
define Koma\-Script
|
328
|
-
.
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
374
|
+
define Koma\-Script's article class as the default latex class
|
375
|
+
.sp
|
376
|
+
.nf
|
377
|
+
class Deplate::List::Itemize
|
378
|
+
@rx = /^(([ \\t]+)(#)[ \\t]+)(.+)$/
|
379
|
+
end
|
380
|
+
|
381
|
+
class Deplate::Formatter::LaTeX
|
382
|
+
@@latexDocClass = "scrartcl"
|
383
|
+
end
|
384
|
+
.fi
|
385
|
+
.PP
|
386
|
+
Here is another example from my personal "after/fmt/latex.rb" file.
|
387
|
+
.sp
|
388
|
+
.nf
|
389
|
+
class Deplate::Formatter::LaTeX
|
390
|
+
def hook_pre_prepare_my_configuration
|
391
|
+
suppl = @deplate.variables["suppl"] #1
|
392
|
+
suppl &&= "[" + suppl + "]"
|
393
|
+
output_at(:pre, :user_packages, "\\\\usepackage#{suppl}{suppl}")
|
394
|
+
|
395
|
+
t = @deplate.get_clip("title") #2
|
396
|
+
output_at(:pre, :body_title, "\\\\tmltitle{#{t.elt}}") if t
|
397
|
+
a = @deplate.get_clip("author")
|
398
|
+
output_at(:pre, :body_title, "\\\\tmlauthor{#{a.elt}}") if a
|
399
|
+
d = @deplate.get_clip("date")
|
400
|
+
output_at(:pre, :body_title, "\\\\tmldate{#{d.elt}}") if d
|
334
401
|
end
|
335
|
-
|
336
|
-
|
337
|
-
@@latexDocClass = "scrartcl"
|
338
|
-
end
|
339
|
-
|
340
|
-
.PP
|
341
|
-
Here is another example from my personal �after/fmt/latex\&.rb� file\&.
|
342
|
-
|
343
|
-
.IP
|
344
|
-
|
345
|
-
class Deplate::Formatter::LaTeX
|
346
|
-
def hook_pre_prepare_my_configuration
|
347
|
-
suppl = @deplate\&.variables["suppl"] #1
|
348
|
-
suppl &&= "[" + suppl + "]"
|
349
|
-
output_at(:pre, :user_packages, "\\\\usepackage#{suppl}{suppl}")
|
350
|
-
|
351
|
-
t = @deplate\&.get_clip("title") #2
|
352
|
-
output_at(:pre, :body_title, "\\\\tmltitle{#{t\&.elt}}") if t
|
353
|
-
a = @deplate\&.get_clip("author")
|
354
|
-
output_at(:pre, :body_title, "\\\\tmlauthor{#{a\&.elt}}") if a
|
355
|
-
d = @deplate\&.get_clip("date")
|
356
|
-
output_at(:pre, :body_title, "\\\\tmldate{#{d\&.elt}}") if d
|
357
|
-
end
|
358
|
-
end
|
359
|
-
|
402
|
+
end
|
403
|
+
.fi
|
360
404
|
.TP 3
|
361
405
|
1.
|
362
|
-
Add a usepackage statement to the preamble \-\- with optional arguments from the
|
406
|
+
Add a usepackage statement to the preamble \-\- with optional arguments from the "suppl" variable.
|
363
407
|
.TP
|
364
408
|
2.
|
365
|
-
extracts information about the document
|
366
|
-
.LP
|
367
|
-
|
409
|
+
extracts information about the document's title and author and adds some user\-defined commands to the document preamble \-\- but below any usepackage statements.
|
368
410
|
.SS "User configuration of the standard setup"
|
369
|
-
|
370
411
|
.PP
|
371
|
-
deplate
|
372
|
-
|
373
|
-
.
|
374
|
-
|
375
|
-
|
376
|
-
.
|
377
|
-
|
378
|
-
|
379
|
-
|
412
|
+
deplate
|
413
|
+
calls the methods
|
414
|
+
Deplate::Core.user_setup(options)
|
415
|
+
and
|
416
|
+
Deplate::Core#user_initialize
|
417
|
+
if they are defined in order to provide a possibility to hook into the standard setup procedure.
|
418
|
+
.PP
|
419
|
+
Deplate::Core.user_setup
|
420
|
+
is called when starting
|
421
|
+
deplate
|
422
|
+
from the command line and before a instance of
|
423
|
+
Deplate::Core
|
424
|
+
was created. This method should be used to set values in the
|
425
|
+
options
|
426
|
+
structure or to permanently require one of
|
427
|
+
deplate's modules.
|
428
|
+
.PP
|
429
|
+
Deplate::Core#user_initialize
|
430
|
+
is called after an instance of
|
431
|
+
Deplate::Core
|
432
|
+
was created and should be used to set variables specific to this instance.
|
433
|
+
.sp
|
434
|
+
.nf
|
435
|
+
class Deplate::Core
|
436
|
+
def self.user_setup(options)
|
437
|
+
options.field_name = 'some value'
|
438
|
+
require_module(options, 'NAME')
|
439
|
+
end
|
380
440
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
def user_initialize
|
388
|
-
@variables['NAME'] = 'VALUE'
|
389
|
-
end
|
390
|
-
end
|
391
|
-
|
441
|
+
def user_initialize
|
442
|
+
@variables['NAME'] = 'VALUE'
|
443
|
+
end
|
444
|
+
end
|
445
|
+
.fi
|
392
446
|
.SS "Configuration of wiki names"
|
393
|
-
|
394
447
|
.PP
|
395
|
-
Usually, any word in CamelCase (a
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
448
|
+
Usually, any word in CamelCase (a.k.a. wiki name) is turned into a hyperlink. By default only the letters A\-Z and a\-z are allowed here in order to minimize possible conflicts between different encodings and different versions of ruby on different systems with different locales in effect. If this doesn't fit your needs, maybe because you happen to write in a language other than English, which is possible and maybe even likely, you might want to change this. Add something like this with the new character sets to your
|
449
|
+
config.rb
|
450
|
+
file:
|
451
|
+
.sp
|
452
|
+
.nf
|
453
|
+
class Deplate::HyperLink
|
454
|
+
@@uc = 'A\-ZÄÖÜ'
|
455
|
+
@@lc = 'a\-zäöüßáàéèíìóòçñ'
|
456
|
+
end
|
457
|
+
|
458
|
+
# the following re\-compiles the regexps for wiki names
|
459
|
+
Deplate::HyperLink.setup
|
460
|
+
.fi
|
461
|
+
.PP
|
462
|
+
If you really don't like simple wiki names and want to disable the all together, you can put something like this into your config.rb:
|
463
|
+
.sp
|
464
|
+
.nf
|
465
|
+
class Deplate::Core
|
466
|
+
def self.user_setup(options)
|
467
|
+
options.disabled_particles << Deplate::HyperLink::Simple
|
468
|
+
end
|
469
|
+
end
|
470
|
+
.fi
|
407
471
|
.SS "Configuration via deplate.ini"
|
408
|
-
|
409
472
|
.PP
|
410
|
-
If you don
|
411
|
-
|
473
|
+
If you don't want to configure
|
474
|
+
deplate
|
475
|
+
using ruby, you can put some settings into the
|
476
|
+
deplate.ini
|
477
|
+
file, which usually resides in
|
478
|
+
~/.depate
|
479
|
+
and/or
|
480
|
+
#{PWD}/deplate.rc.
|
412
481
|
.PP
|
413
|
-
This file contains a sequence of commands
|
414
|
-
|
482
|
+
This file contains a sequence of commands. Each command must fit in one line. The following commands are allowed:
|
483
|
+
.TP
|
484
|
+
allow FLAGS
|
485
|
+
Allow
|
486
|
+
deplate
|
487
|
+
to do certain things
|
488
|
+
.TP
|
489
|
+
\-\-OPTION
|
490
|
+
Additional command line option
|
415
491
|
.TP
|
416
|
-
mod
|
492
|
+
mod NAME
|
417
493
|
Load the module NAME
|
418
|
-
|
419
494
|
.TP
|
420
|
-
fmt
|
495
|
+
fmt NAME
|
421
496
|
Set the standard formatter
|
422
|
-
|
423
497
|
.TP
|
424
|
-
clip
|
425
|
-
Set the clip NAME (e
|
426
|
-
|
498
|
+
clip NAME=VALUE
|
499
|
+
Set the clip NAME (e.g., "author") to VALUE
|
427
500
|
.TP
|
428
|
-
wiki
|
429
|
-
Define an interwiki (the
|
430
|
-
|
501
|
+
wiki NAME.SUFFIX=BASEURL
|
502
|
+
Define an interwiki (the
|
503
|
+
.SUFFIX
|
504
|
+
part is optional)
|
431
505
|
.TP
|
432
|
-
wikichars
|
433
|
-
Define
|
434
|
-
|
506
|
+
wikichars UPPERCHARS LOWERCHARS
|
507
|
+
Define which characters are allowed in wiki names
|
508
|
+
.TP
|
509
|
+
app NAME=COMMANDLINE
|
510
|
+
Define an external app (e.g., latex, dvips, R, dot, neato, pstoedit, identify, gs ...)
|
435
511
|
.RS
|
436
|
-
.
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
512
|
+
.TP 3
|
513
|
+
\(bu
|
514
|
+
If you get a
|
515
|
+
Exec format error
|
516
|
+
error, this is probably caused by a missing executable suffix. To avoid this error, redefine the app and add a
|
517
|
+
.exe
|
518
|
+
or similar to the name.
|
441
519
|
.RE
|
442
|
-
|
443
|
-
.TP
|
444
|
-
app\~NAME=COMMANDLINE
|
445
|
-
Define an external app (e\&.g\&., latex, dvips, R, dot, neato, pstoedit, identify, gs \&.\&.\&.)
|
446
|
-
|
447
520
|
.TP
|
448
521
|
$ENV=VALUE
|
449
522
|
Set an environment variable
|
450
|
-
|
451
523
|
.TP
|
452
524
|
VAR=VALUE
|
453
525
|
Set variable VAR to VALUE
|
454
|
-
|
455
526
|
.RS
|
456
527
|
.TP 3
|
457
528
|
\(bu
|
458
|
-
Alternatively, variables can contain multi\-line values using the usual heredoc pattern (<<MARKER\\nTEXT
|
459
|
-
.LP
|
529
|
+
Alternatively, variables can contain multi\-line values using the usual heredoc pattern (<<MARKER\\nTEXT...\\nMARKER\\n) as long as the smaller characters ("<<") appear right after the equals sign. Internally, a multi\-line value is processed as array.
|
460
530
|
.RE
|
461
|
-
.IP
|
462
|
-
|
463
531
|
.PP
|
464
|
-
Although this may not always work as expected, you can also set some options
|
465
|
-
|
532
|
+
Although this may not always work as expected, you can also set some options by prepending the name with a colon (":") or by using the
|
533
|
+
option
|
534
|
+
keyword:
|
466
535
|
.TP
|
467
|
-
option
|
536
|
+
option NAME~
|
468
537
|
Set option NAME to false
|
469
|
-
|
470
538
|
.TP
|
471
|
-
option
|
539
|
+
option NAME!
|
472
540
|
Set option NAME to true
|
473
|
-
|
474
541
|
.TP
|
475
|
-
option
|
542
|
+
option NAME?=true|false|yes|no|on|off
|
476
543
|
Set option NAME to a boolean value
|
477
|
-
|
478
544
|
.TP
|
479
|
-
option
|
545
|
+
option NAME%=INTEGER
|
480
546
|
Set option NAME to a numeric value
|
481
|
-
|
482
547
|
.TP
|
483
|
-
option
|
548
|
+
option NAME=VALUE
|
484
549
|
Set option NAME to VALUE as string
|
485
|
-
|
486
550
|
.PP
|
487
|
-
Lines beginning with one of
|
488
|
-
|
551
|
+
Lines beginning with one of
|
552
|
+
*%#;
|
553
|
+
are considered comments.
|
489
554
|
.PP
|
490
|
-
Example
|
555
|
+
Example 2.1:
|
556
|
+
deplate.ini
|
557
|
+
.sp
|
558
|
+
.nf
|
559
|
+
; Disable simple wiki names
|
560
|
+
\-\-no\-simple\-names
|
491
561
|
|
492
|
-
|
562
|
+
; Load some standard modules
|
563
|
+
mod de
|
564
|
+
mod mark\-external\-urls
|
565
|
+
mod colored\-log
|
493
566
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
mod colored\-log
|
498
|
-
|
499
|
-
# Applications
|
500
|
-
app dot=/somewhere/not/in/the/standard/path/dot
|
501
|
-
|
502
|
-
# Clips
|
503
|
-
clip author=Thomas Link
|
504
|
-
|
505
|
-
# Options
|
506
|
-
option allow_exec!
|
507
|
-
option allow_ruby!
|
508
|
-
|
509
|
-
# By default, use only a subset of deplate's standard markup
|
510
|
-
option input_def=deplate\-restricted
|
511
|
-
|
512
|
-
# Create latex output by default
|
513
|
-
option fmt=latex
|
514
|
-
|
515
|
-
# Wikis
|
516
|
-
wikichars A\-Z��� a\-z��������������
|
517
|
-
wiki DEPLATE\&.html=http://deplate\&.sf\&.net/
|
518
|
-
|
519
|
-
# Variables
|
520
|
-
## HTML
|
521
|
-
css=deplate\&.css
|
522
|
-
|
523
|
-
topBar=<<\-\-\-\-
|
524
|
-
[auto]
|
525
|
-
MyOtherHomepage | http://www\&.homepage\&.org
|
526
|
-
\-\-\-\-
|
527
|
-
|
528
|
-
## Save auxiliary files in a subdirectory (BASENAME_files)
|
529
|
-
auxiliaryDirSuffix=_files
|
530
|
-
|
531
|
-
.SS "Templates"
|
567
|
+
; Applications
|
568
|
+
app dot=/somewhere/not/in/the/standard/path/dot
|
569
|
+
app latex=latex_wrapper.sh
|
532
570
|
|
533
|
-
|
534
|
-
|
571
|
+
; Clips
|
572
|
+
clip author=Thomas Link
|
573
|
+
|
574
|
+
; Options
|
575
|
+
; Enable full LaTeX, support for ruby code & external applications
|
576
|
+
allow t x X
|
577
|
+
|
578
|
+
; By default, use only a subset of deplate's standard markup
|
579
|
+
option input_def=deplate\-restricted
|
580
|
+
|
581
|
+
; Create latex output by default
|
582
|
+
option fmt=latex
|
583
|
+
|
584
|
+
; Wikis
|
585
|
+
wikichars A\-ZÄÖÜ a\-zäöüßáàéèíìóòçñ
|
586
|
+
wiki DEPLATE.html=http://deplate.sf.net/
|
535
587
|
|
588
|
+
; Variables
|
589
|
+
;; HTML
|
590
|
+
css=deplate.css
|
591
|
+
|
592
|
+
topBar=<<\-\-\-\-
|
593
|
+
[auto]
|
594
|
+
MyOtherHomepage | http://www.homepage.org
|
595
|
+
\-\-\-\-
|
596
|
+
|
597
|
+
;; Save auxiliary files in a subdirectory (BASENAME_files)
|
598
|
+
auxiliaryDirSuffix=_files
|
599
|
+
.fi
|
600
|
+
.SS "Templates"
|
601
|
+
.PP
|
602
|
+
deplate
|
603
|
+
supports two ways of page templates:
|
536
604
|
.TP 3
|
537
605
|
1.
|
538
606
|
Template variables
|
539
607
|
.TP
|
540
608
|
2.
|
541
609
|
Template files
|
542
|
-
.
|
543
|
-
|
610
|
+
.sp
|
611
|
+
.it 1 an-trap
|
612
|
+
.nr an-no-space-flag 1
|
613
|
+
.nr an-break-flag 1
|
614
|
+
.br
|
615
|
+
\fBTemplate variables (obsolete)\fR
|
616
|
+
.RS 3
|
544
617
|
.PP
|
545
618
|
You can define a template in ruby by setting the following Deplate class variables:
|
546
|
-
|
547
619
|
.TP 3
|
548
620
|
\(bu
|
549
|
-
these variables (array of arrays of strings) can be redefined in Deplate::Core
|
550
|
-
|
621
|
+
these variables (array of arrays of strings) can be redefined in Deplate::Core.user_setup to put some formatted output on every page/file
|
551
622
|
.RS
|
552
623
|
.TP 3
|
553
624
|
\(bu
|
@@ -558,135 +629,154 @@ these variables (array of arrays of strings) can be redefined in Deplate::Core\&
|
|
558
629
|
.TP
|
559
630
|
\(bu
|
560
631
|
@@post_matter_template
|
561
|
-
.LP
|
562
632
|
.RE
|
563
|
-
.IP
|
564
633
|
.TP
|
565
634
|
\(bu
|
566
635
|
this variable (array of strings) can contain some deplate markup that will be prepended to every file read
|
567
|
-
|
568
636
|
.RS
|
569
637
|
.TP 3
|
570
638
|
\(bu
|
571
639
|
@@deplate_template
|
572
|
-
.LP
|
573
640
|
.RE
|
574
|
-
.IP
|
575
|
-
.LP
|
576
|
-
|
577
|
-
.PP
|
578
|
-
Typical use would be (in your config\&.rb file)
|
579
|
-
|
580
|
-
.IP
|
581
|
-
|
582
|
-
class Deplate
|
583
|
-
def self\&.user_setup(options)
|
584
|
-
if options\&.fmt =~ /^html/
|
585
|
-
@@post_matter_template[10] = ['<br>\\n(c) 2004, Me']
|
586
|
-
end
|
587
|
-
@@deplate_template << '#AU: My Name'
|
588
|
-
end
|
589
|
-
end
|
590
|
-
|
591
641
|
.PP
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
642
|
+
Typical use would be (in your
|
643
|
+
config.rb
|
644
|
+
file)
|
645
|
+
.sp
|
646
|
+
.nf
|
647
|
+
class Deplate
|
648
|
+
def self.user_setup(options)
|
649
|
+
if options.fmt =~ /^html/
|
650
|
+
@@post_matter_template[10] = ['<br>\\n(c) 2004, Me']
|
651
|
+
end
|
652
|
+
@@deplate_template << '#AU: My Name'
|
653
|
+
end
|
654
|
+
end
|
655
|
+
.fi
|
656
|
+
.RE
|
657
|
+
.sp
|
658
|
+
.it 1 an-trap
|
659
|
+
.nr an-no-space-flag 1
|
660
|
+
.nr an-break-flag 1
|
661
|
+
.br
|
662
|
+
\fBTemplate files\fR
|
663
|
+
.RS 3
|
664
|
+
.PP
|
665
|
+
Via the
|
666
|
+
\-t
|
667
|
+
or
|
668
|
+
\-\-template
|
669
|
+
command\-line option or by setting the
|
670
|
+
template
|
671
|
+
document variable, you can define simple text templates that will be filled in with content from your
|
672
|
+
deplate
|
673
|
+
file.
|
674
|
+
.PP
|
675
|
+
Since version 0.7,
|
676
|
+
deplate
|
677
|
+
uses a specialized formatter for handling templates. Before 0.7, this was done by search & replace. If you have pre 0.7 templates which don't work any more, you can switch back to the old template mechanism by setting the document option
|
678
|
+
template_version
|
679
|
+
to 1.
|
597
680
|
.PP
|
598
681
|
In templates, only a small number of statements are available:
|
599
|
-
|
600
682
|
.TP
|
601
683
|
Commands
|
602
684
|
GET, ARG, XARG, VAR, OPT, PREMATTER, POSTMATTER, BODY, IF, ELSE, ELSEIF, ENDIF, INC/INCLUDE
|
603
|
-
|
604
685
|
.TP
|
605
686
|
Regions
|
606
687
|
Foreach, Mingle, Ruby, Var
|
607
|
-
|
608
688
|
.TP
|
609
689
|
Macros
|
610
690
|
get, clip, opt, arg, xarg, doc, ruby
|
611
|
-
|
612
691
|
.PP
|
613
|
-
The commands PREMATTER, POSTMATTER, BODY as well as the Mingle region are specific to templates
|
614
|
-
|
692
|
+
The commands PREMATTER, POSTMATTER, BODY as well as the Mingle region are specific to templates.
|
615
693
|
.PP
|
616
|
-
PREMATTER, POSTMATTER, and BODY can be used to fill in formatted content
|
617
|
-
|
694
|
+
PREMATTER, POSTMATTER, and BODY can be used to fill in formatted content for an explanation of
|
695
|
+
deplate's document structure):
|
618
696
|
.TP
|
619
697
|
#PREMATTER
|
620
698
|
The file header, the beginning of the document definition, some text that in multi\-file mode should appear in every output file
|
621
|
-
|
622
699
|
.TP
|
623
700
|
#BODY
|
624
701
|
The text body
|
625
|
-
|
626
702
|
.TP
|
627
703
|
#POSTMATTER
|
628
704
|
Some text that in multi\-file mode should appear in every output file, the end of document definition
|
629
|
-
|
630
705
|
.PP
|
631
|
-
These commands take a list of slots (named or as numbers) as arguments
|
632
|
-
|
706
|
+
These commands take a list of slots (named or as numbers) as arguments. The slots can be single slots or ranges. They can be positive (add selectively) or negative (add with the exception of certain content). Examples:
|
633
707
|
.TP
|
634
|
-
#PREMATTER
|
708
|
+
#PREMATTER: \-doc_def
|
635
709
|
add the prematter without the document type definition
|
636
|
-
|
637
710
|
.TP
|
638
|
-
#PREMATTER
|
711
|
+
#PREMATTER: doc_def mod_packages mod_head
|
639
712
|
add the document type definition, and stuff added by modules
|
640
|
-
|
641
713
|
.TP
|
642
|
-
#PREMATTER
|
714
|
+
#PREMATTER: head_beg..prematter_end
|
643
715
|
add everything from the head on downwards
|
644
|
-
|
645
716
|
.PP
|
646
|
-
A slot cannot be consumed twice
|
647
|
-
|
717
|
+
A slot cannot be consumed twice. I.e., if you use several template commands, the latter will not insert the content that was already inserted by the previous command.
|
648
718
|
.PP
|
649
|
-
The Mingle region can be used to add some text to a specific slot in the original document
|
650
|
-
|
719
|
+
The Mingle region can be used to add some text to a specific slot in the original document. Filling in templates takes place after the document was produced. A template actually processed by deplate like normal text but with a different active rule set. Thus, if you define a slot or a type for a region in the template file these definitions refer to the template output which usually is not quite what you want. You can use Mingle to make them refer to the original document. See
|
720
|
+
html\-left\-tabbar\-js.html
|
721
|
+
in the
|
722
|
+
templates
|
723
|
+
subdirectory of the distribution for an example.
|
651
724
|
.PP
|
652
|
-
Curly braces in templates could cause problems because
|
653
|
-
|
725
|
+
Curly braces in templates could cause problems because
|
726
|
+
deplate
|
727
|
+
maybe interpretes them as macros. If
|
728
|
+
deplate
|
729
|
+
mixes up your template, you should prefix these curly braces that cause problems with a backslash.
|
654
730
|
.PP
|
655
|
-
Backslashes have always to be doubled
|
656
|
-
|
731
|
+
Backslashes have always to be doubled.
|
657
732
|
.PP
|
658
733
|
A LaTeX template could then look like this:
|
734
|
+
.sp
|
735
|
+
.nf
|
736
|
+
% The author and date clips are automatically set by the #AUTHOR and
|
737
|
+
% #DATE commands
|
738
|
+
% (c) {get: date}, {get: author}
|
659
739
|
|
660
|
-
|
740
|
+
\\\\documentclass[12pt,a4paper]{letter}
|
661
741
|
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
#PREMATTER: \-doc_def
|
666
|
-
|
667
|
-
\\\\address{{get: author}\\\\\\\\
|
668
|
-
Where I live}
|
669
|
-
\\\\signature{{get: author}}
|
670
|
-
|
671
|
-
\\\\begin{letter}{{get: addresseeAddress}}
|
672
|
-
|
673
|
-
\\\\opening{Dear {get: addresseeName},}
|
674
|
-
|
675
|
-
#BODY
|
676
|
-
|
677
|
-
\\\\closing{Sincerly,}
|
678
|
-
|
679
|
-
\\\\vfill{}
|
680
|
-
\\\\encl{{val: enclosure}}
|
681
|
-
|
682
|
-
\\\\end{letter}
|
683
|
-
|
684
|
-
#POSTMATTER
|
685
|
-
|
686
|
-
.PP
|
687
|
-
You could now copy this example template to �~/\&.deplate/templates/letter\&.tex� and call deplate as:
|
742
|
+
% Insert all the prematter stuff except the documentclass definition,
|
743
|
+
% which is provided by this template
|
744
|
+
#PREMATTER: \-doc_def
|
688
745
|
|
689
|
-
|
746
|
+
\\\\address{{get: author}\\\\\\\\
|
747
|
+
Where I live}
|
748
|
+
\\\\signature{{get: author}}
|
749
|
+
|
750
|
+
% addresseeAddress and addresseeName refer to document variables defined
|
751
|
+
% using the #VAR command or provided at the command line
|
752
|
+
\\\\begin{letter}{{get: addresseeAddress}}
|
753
|
+
|
754
|
+
\\\\opening{Dear {get: addresseeName},}
|
755
|
+
|
756
|
+
% Insert the body
|
757
|
+
#BODY
|
690
758
|
|
691
|
-
|
692
|
-
|
759
|
+
\\\\closing{Sincerly,}
|
760
|
+
|
761
|
+
\\\\vfill{}
|
762
|
+
% "enclosure" refers to a clip define by the #PUT command
|
763
|
+
\\\\encl{{val: enclosure}}
|
764
|
+
|
765
|
+
\\\\end{letter}
|
766
|
+
|
767
|
+
% Insert post\-body stuff
|
768
|
+
#POSTMATTER
|
769
|
+
.fi
|
770
|
+
.PP
|
771
|
+
You could now copy this example template to "~/.deplate/templates/letter.tex" and call
|
772
|
+
deplate
|
773
|
+
as:
|
774
|
+
.sp
|
775
|
+
.nf
|
776
|
+
deplate \-f latex \-t letter.tex DEPLATE.FILE
|
777
|
+
.fi
|
778
|
+
.RE
|
779
|
+
.SH "REFERENCES"
|
780
|
+
.TP 3
|
781
|
+
1.\ Vim viki plugin
|
782
|
+
\%http://www.vim.org/scripts/script.php?script_id=861
|