File: rttool.en.html

package info (click to toggle)
rttool 1.0.3.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: ruby: 1,629; makefile: 12
file content (306 lines) | stat: -rw-r--r-- 10,476 bytes parent folder | download | duplicates (6)
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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<?xml version="1.0" encoding="iso-2022-jp" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
<title>RTtool</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-2022-jp" />
<!-- head-element:nil -->
</head>
<body>
<h2>Index</h2>

<ul>
<li><p><a href="#label:1">What's new</a></p>
<ul>
<li><a href="#label:2">[2009/01/25] 1.0.3 released</a></li>
<li><a href="#label:3">[2006/09/20] 1.0.2 released</a></li>
<li><a href="#label:4">[2005/10/28] 1.0.1 released</a></li>
<li><a href="#label:5">[2005/10/26] 1.0.0 released</a></li>
</ul></li>
<li><a href="#label:6">Abstract</a></li>
<li><a href="#label:7">Environment</a></li>
<li><a href="#label:8">Install</a></li>
<li><a href="#label:9">RT Syntax</a></li>
<li><a href="#label:13">Attributes</a></li>
<li><p><a href="#label:19">Examples</a></p>
<ul>
<li><a href="#label:20">The Easiest RT</a></li>
<li><a href="#label:21">Use the Escape Attribute</a></li>
<li><a href="#label:22">More Complex RT</a></li>
<li><a href="#label:23">RT Included by RD (RD/RT)</a></li>
</ul></li>
<li><a href="#label:24">License</a></li>
</ul>
<hr />

<h1><a name="Title:" href="#Title:">Title:</a> <a name="label:0">RTtool</a></h1><!-- RDLabel: "RTtool" -->

<h2><a name="1" href="#1">1</a> <a name="label:1">What's new</a></h2><!-- RDLabel: "What's new" -->

<h3><a name="1.1" href="#1.1">1.1</a> <a name="label:2">[2009/01/25] 1.0.3 released</a></h3><!-- RDLabel: "[2009/01/25] 1.0.3 released" -->

<ul>
<li>HTML XSS bug fix.</li>
<li>RTtool works with Ruby 1.9 now.</li>
</ul>
<h3><a name="1.2" href="#1.2">1.2</a> <a name="label:3">[2006/09/20] 1.0.2 released</a></h3><!-- RDLabel: "[2006/09/20] 1.0.2 released" -->

<ul>
<li>Bugfix about linefeed.</li>
</ul>
<h3><a name="1.3" href="#1.3">1.3</a> <a name="label:4">[2005/10/28] 1.0.1 released</a></h3><!-- RDLabel: "[2005/10/28] 1.0.1 released" -->

<ul>
<li>RTtool does not use .rd2rc anymore.</li>
</ul>
<h3><a name="1.4" href="#1.4">1.4</a> <a name="label:5">[2005/10/26] 1.0.0 released</a></h3><!-- RDLabel: "[2005/10/26] 1.0.0 released" -->

<ul>
<li>Escape.</li>
<li>English document.</li>
<li>Removed Ruby-1.8 warning.</li>
</ul>
<h2><a name="2" href="#2">2</a> <a name="label:6">Abstract</a></h2><!-- RDLabel: "Abstract" -->

<p>RT is a simple and human-readable table format.
RTtool is a converter from RT into various formats.
RT can be incorporated into RD.</p>
<p>At this time, RTtool can convert RT into HTML and plain text.
To convert into plain text, you need <a href="http://w3m.sourceforge.net/">w3m</a>.</p>
<h2><a name="3" href="#3">3</a> <a name="label:7">Environment</a></h2><!-- RDLabel: "Environment" -->

<h2><a name="4" href="#4">4</a> <a name="label:8">Install</a></h2><!-- RDLabel: "Install" -->

<p>Please execute the following commands.</p>
<pre>ruby -ropen-uri -e 'URI("http://www.rubyist.net/~rubikitch/archive/rttool-1.0.3.tar.gz").read.display' &gt; rttool-1.0.3.tar.gz</pre>
<pre>tar xzvf rttool-1.0.3.tar.gz</pre>
<p>When you failed, please download it from the next link.</p>
<ul>
<li><a href="http://www.rubyist.net/~rubikitch/archive/rttool-1.0.3.tar.gz">rttool-1.0.3.tar.gz</a></li>
</ul>
<p>Then, install it.</p>
<pre>cd rttool-1.0.3
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install</pre>
<h2><a name="5" href="#5">5</a> <a name="label:9">RT Syntax</a></h2><!-- RDLabel: "RT Syntax" -->

<ul>
<li><p>RT consists of three Blocks.</p>
<dl>
<dt><a name="label:10" id="label:10"></a>ConfigBlock</dt><!-- RDLabel: "ConfigBlock" -->
<dd>
<p>ConfigBlock consist of groups of "attribute = value".
The following examples has <code>caption</code> attribute.
ConfigBlock can be omitted.</p>
</dd>
<dt><a name="label:11" id="label:11"></a>HeaderBlock</dt><!-- RDLabel: "HeaderBlock" -->
<dd>
<p>A part of THEAD by HTML.
HeaderBlock sets a header of the table.
A header is located at the center.
HeaderBlock can be omitted.</p>
</dd>
<dt><a name="label:12" id="label:12"></a>BodyBlock</dt><!-- RDLabel: "BodyBlock" -->
<dd>
<p>A part of TBODY by HTML.
BodyBlock sets data of the table.
A number is located at the right and others are located at left.</p>
</dd>
</dl></li>
<li><p>The default delimiter on HeaderBlock and BodyBlock is a comma or a Tab.</p>
<ul>
<li>It is not necessary to be always harmonious with an upper line.</li>
<li>Arbitrary character can be a delimiter by changing <code>delimiter</code> attribute.</li>
</ul></li>
<li><code>==</code> stretches the left column. (colspan)</li>
<li><code>||</code> stretches the upper row. (rowspan)</li>
</ul>
<h2><a name="6" href="#6">6</a> <a name="label:13">Attributes</a></h2><!-- RDLabel: "Attributes" -->

<p>In ConfigBlock, these attributes can be set.</p>
<dl>
<dt><a name="label:14" id="label:14"></a>caption</dt><!-- RDLabel: "caption" -->
<dd>
<p>The caption of the table.</p>
</dd>
<dt><a name="label:15" id="label:15"></a>delimiter</dt><!-- RDLabel: "delimiter" -->
<dd>
<p>The delimiter of the table.</p>
</dd>
<dt><a name="label:16" id="label:16"></a>rowspan</dt><!-- RDLabel: "rowspan" -->
<dd>
<p>A string which stretches the left column. (defalut: <code>==</code>)</p>
</dd>
<dt><a name="label:17" id="label:17"></a>colspan</dt><!-- RDLabel: "colspan" -->
<dd>
<p>A string which stretches the upper row. (default: <code>||</code>)</p>
</dd>
<dt><a name="label:18" id="label:18"></a>escape</dt><!-- RDLabel: "escape" -->
<dd>
<p>An escape character.
This attribute is disabled by default.</p>
</dd>
</dl>
<h2><a name="7" href="#7">7</a> <a name="label:19">Examples</a></h2><!-- RDLabel: "Examples" -->

<h3><a name="7.1" href="#7.1">7.1</a> <a name="label:20">The Easiest RT</a></h3><!-- RDLabel: "The Easiest RT" -->

<pre>$ cat examples/easiest.rt
1, 2, 3
4, 5, 6
7, 8, 9

$ rt2 examples/easiest.rt
┌─┬─┬─┐
└3柑 1└3柑 2└3柑 3└3柑
└3校─┼─┼─┤
└3柑 4└3柑 5└3柑 6└3柑
└3校─┼─┼─┤
└3柑 7└3柑 8└3柑 9└3柑
└瘢雹─┴─┴─┘

$ rt2 -r rt/rt2html-lib examples/easiest.rt
&lt;!-- setup --&gt;
&lt;table border="1"&gt;
&lt;!-- setup end --&gt;

&lt;!-- Header --&gt;
&lt;!-- Header end --&gt;

&lt;!-- Body --&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td align="right"&gt;1&lt;/td&gt;&lt;td align="right"&gt;2&lt;/td&gt;&lt;td align="right"&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="right"&gt;4&lt;/td&gt;&lt;td align="right"&gt;5&lt;/td&gt;&lt;td align="right"&gt;6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="right"&gt;7&lt;/td&gt;&lt;td align="right"&gt;8&lt;/td&gt;&lt;td align="right"&gt;9&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;!-- Body end --&gt;

&lt;!-- teardown --&gt;
&lt;/table&gt;
&lt;!-- teardown end --&gt;</pre>
<h3><a name="7.2" href="#7.2">7.2</a> <a name="label:21">Use the Escape Attribute</a></h3><!-- RDLabel: "Use the Escape Attribute" -->

<pre>$ cat examples/escape.rt
delimiter = ;
escape = \

\z   ; \;1 ; 2

$ rt2 examples/escape.rt
┌─┬─┬─┐
└3柑\z└3柑;1└3柑 2└3柑
└瘢雹─┴─┴─┘

$ rt2 -r rt/rt2html-lib examples/escape.rt
&lt;!-- setup --&gt;
&lt;table border="1"&gt;
&lt;!-- setup end --&gt;

&lt;!-- Header --&gt;
&lt;!-- Header end --&gt;

&lt;!-- Body --&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left"&gt;\z&lt;/td&gt;&lt;td align="left"&gt;;1&lt;/td&gt;&lt;td align="right"&gt;2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;!-- Body end --&gt;

&lt;!-- teardown --&gt;
&lt;/table&gt;
&lt;!-- teardown end --&gt;</pre>
<h3><a name="7.3" href="#7.3">7.3</a> <a name="label:22">More Complex RT</a></h3><!-- RDLabel: "More Complex RT" -->

<pre>$ cat examples/test1.rt
caption = Test Table

     , Human, == , Dog , ==
||  , M  , F ,M,F

  x  , 1.0 , 2.0, 1.1, 1.2
  y  , 0.4 , 0.5, 0.3, 0.1

$ rt2 examples/test1.rt
          Test Table
┌─┬─────┬─────┐
└3柑  └3柑  Human   └3柑   Dog    └3柑
└3柑  └3校──┬──┼──┬──┤
└3柑  └3柑 M  └3柑 F  └3柑 M  └3柑 F  └3柑
└3校─┼──┼──┼──┼──┤
└3柑x └3柑 1.0└3柑 2.0└3柑 1.1└3柑 1.2└3柑
└3校─┼──┼──┼──┼──┤
└3柑y └3柑 0.4└3柑 0.5└3柑 0.3└3柑 0.1└3柑
└瘢雹─┴──┴──┴──┴──┘

$ rt2 -r rt/rt2html-lib examples/test1.rt
&lt;!-- setup --&gt;
&lt;table border="1"&gt;
&lt;caption&gt;Test Table&lt;/caption&gt;
&lt;!-- setup end --&gt;

&lt;!-- Header --&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th rowspan="2"&gt;&lt;/th&gt;&lt;th colspan="2"&gt;Human&lt;/th&gt;&lt;th colspan="2"&gt;Dog&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;M&lt;/th&gt;&lt;th&gt;F&lt;/th&gt;&lt;th&gt;M&lt;/th&gt;&lt;th&gt;F&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;!-- Header end --&gt;

&lt;!-- Body --&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left"&gt;x&lt;/td&gt;&lt;td align="right"&gt;1.0&lt;/td&gt;&lt;td align="right"&gt;2.0&lt;/td&gt;&lt;td align="right"&gt;1.1&lt;/td&gt;&lt;td align="right"&gt;1.2&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left"&gt;y&lt;/td&gt;&lt;td align="right"&gt;0.4&lt;/td&gt;&lt;td align="right"&gt;0.5&lt;/td&gt;&lt;td align="right"&gt;0.3&lt;/td&gt;&lt;td align="right"&gt;0.1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;!-- Body end --&gt;

&lt;!-- teardown --&gt;
&lt;/table&gt;
&lt;!-- teardown end --&gt;</pre>
<h3><a name="7.4" href="#7.4">7.4</a> <a name="label:23">RT Included by RD (RD/RT)</a></h3><!-- RDLabel: "RT Included by RD (RD/RT)" -->

<pre>$ cat examples/rttest.rd
=begin
= Sample RD/RT

This RD contains a table.
It is so-called RD/RT.

=end
=begin RT
caption = Test Table

     , Human, == , Dog , ==
||  , M  , F ,M,F

  x  , 1.0 , 2.0, 1.1, 1.2
  y  , 0.4 , 0.5, 0.3, 0.1

=end
=begin
It is simple.
=end

$ rdrt2 examples/rttest.rd | w3m -dump -T text/html
= Sample RD/RT

This RD contains a table. It is so-called RD/RT.

          Test Table
┌─┬─────┬─────┐
└3柑  └3柑  Human   └3柑   Dog    └3柑
└3柑  └3校──┬──┼──┬──┤
└3柑  └3柑 M  └3柑 F  └3柑 M  └3柑 F  └3柑
└3校─┼──┼──┼──┼──┤
└3柑x └3柑 1.0└3柑 2.0└3柑 1.1└3柑 1.2└3柑
└3校─┼──┼──┼──┼──┤
└3柑y └3柑 0.4└3柑 0.5└3柑 0.3└3柑 0.1└3柑
└瘢雹─┴──┴──┴──┴──┘

It is simple.</pre>
<h2><a name="8" href="#8">8</a> <a name="label:24">License</a></h2><!-- RDLabel: "License" -->

<p>Ruby's</p>

</body>
</html>