html2index 1.2.1 → 1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/html2index +4 -10
- data/doc/html/html2index.html +430 -582
- data/doc/man/html2index.1.gz +0 -0
- data/doc/pdf/html2index.pdf +0 -0
- data/doc/rst/html2index.rst +18 -14
- data/html2index.gemspec +11 -7
- data/lib/argparser.rb +9 -18
- data/lib/basic_logging.rb +202 -0
- data/lib/configuration.rb +29 -36
- data/lib/constants.rb +6 -12
- data/lib/definition.rb +5 -10
- data/lib/dictionary.rb +5 -10
- data/lib/file_checking.rb +5 -10
- data/lib/html2index.rb +32 -40
- data/lib/template.rb +14 -21
- data/lib/translating.rb +5 -12
- data/lib/user_input.rb +4 -12
- data/lib/version.rb +16 -12
- metadata +17 -18
- data/lib/logging.rb +0 -206
data/doc/html/html2index.html
CHANGED
|
@@ -1,441 +1,194 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"
|
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
3
|
<head>
|
|
5
|
-
<meta
|
|
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
|
-
margin-
|
|
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
|
-
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
75
|
-
div.hint, div.important, div.note, div.tip, div.warning {
|
|
76
|
-
margin: 2em ;
|
|
77
|
-
border: medium outset ;
|
|
78
|
-
padding: 1em }
|
|
79
|
-
|
|
80
|
-
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
81
|
-
div.important p.admonition-title, div.note p.admonition-title,
|
|
82
|
-
div.tip p.admonition-title {
|
|
83
|
-
font-weight: bold ;
|
|
84
|
-
font-family: sans-serif }
|
|
85
|
-
|
|
86
|
-
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
87
|
-
div.danger p.admonition-title, div.error p.admonition-title,
|
|
88
|
-
div.warning p.admonition-title, .code .error {
|
|
89
|
-
color: red ;
|
|
90
|
-
font-weight: bold ;
|
|
91
|
-
font-family: sans-serif }
|
|
92
|
-
|
|
93
|
-
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
94
|
-
compound paragraphs.
|
|
95
|
-
div.compound .compound-first, div.compound .compound-middle {
|
|
96
|
-
margin-bottom: 0.5em }
|
|
97
|
-
|
|
98
|
-
div.compound .compound-last, div.compound .compound-middle {
|
|
99
|
-
margin-top: 0.5em }
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
div.dedication {
|
|
103
|
-
margin: 2em 5em ;
|
|
104
|
-
text-align: center ;
|
|
105
|
-
font-style: italic }
|
|
106
|
-
|
|
107
|
-
div.dedication p.topic-title {
|
|
108
|
-
font-weight: bold ;
|
|
109
|
-
font-style: normal }
|
|
110
|
-
|
|
111
|
-
div.figure {
|
|
112
|
-
margin-left: 2em ;
|
|
113
|
-
margin-right: 2em }
|
|
114
|
-
|
|
115
|
-
div.footer, div.header {
|
|
116
|
-
clear: both;
|
|
117
|
-
font-size: smaller }
|
|
118
|
-
|
|
119
|
-
div.line-block {
|
|
120
|
-
display: block ;
|
|
121
|
-
margin-top: 1em ;
|
|
122
|
-
margin-bottom: 1em }
|
|
123
|
-
|
|
124
|
-
div.line-block div.line-block {
|
|
125
|
-
margin-top: 0 ;
|
|
126
|
-
margin-bottom: 0 ;
|
|
127
|
-
margin-left: 1.5em }
|
|
4
|
+
<meta name="generator" content="vim - Vi Improved, a programmer's editor; HTML Tidy for Linux version 5.8.0
|
|
5
|
+
"/>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content=
|
|
8
|
+
"width=device-width, initial-scale=1" />
|
|
9
|
+
<title>Html2index</title>
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
/*<![CDATA[*/
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
:Author: Michael Uplawski
|
|
15
|
+
:Contact: michael.uplawski@uplawski.eu
|
|
16
|
+
:License: WTFPL 2.0, see http://www.wtfpl.net/about/
|
|
17
|
+
|
|
18
|
+
Stylesheet for use with Docutils.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
body {
|
|
22
|
+
background-color:#a0a090;
|
|
23
|
+
font-family: Verdana,Helvetica,Univers;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
p {width: 80%;}
|
|
27
|
+
|
|
28
|
+
h1.title {color:#800080;font-size:2em;}
|
|
29
|
+
h2 {color:darkblue;font-size:1.5em;}
|
|
30
|
+
h3 {color:#3030f0;font-size:1em;}
|
|
31
|
+
h4 {color:#000080;font-size:1em;margin-left:2em;}
|
|
32
|
+
|
|
33
|
+
nav:before {
|
|
34
|
+
content:'Contents';
|
|
35
|
+
font-weight:bold;
|
|
36
|
+
color:darkblue;
|
|
37
|
+
font-size:1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
p, ul.simple, ol.simple, dt {margin-left:2em;}
|
|
41
|
+
dd {margin-left:4em;}
|
|
42
|
+
|
|
43
|
+
/* correct left margin of nested block tags*/
|
|
44
|
+
dd p, li p {margin-left:0;}
|
|
45
|
+
dd * ul {margin-left:0 ! important; }
|
|
46
|
+
dd ul {margin-left:0 ! important; }
|
|
47
|
+
dd dl dt, dd dl dd {margin-left:0 ! important;}
|
|
48
|
+
|
|
49
|
+
dt {font-weight:bold;}
|
|
50
|
+
em {color:#000080;
|
|
51
|
+
background-color:#b0b0a0;
|
|
52
|
+
}
|
|
53
|
+
pre.literal-block {
|
|
54
|
+
padding:0.5em;
|
|
55
|
+
border-radius:0.5em;
|
|
56
|
+
background-color:rgba(150, 240, 250, 0.5);
|
|
57
|
+
margin-left:4em;
|
|
58
|
+
font-family: Monospace;
|
|
59
|
+
font-size:1.2em;
|
|
60
|
+
}
|
|
61
|
+
blockquote {background-color:#ffc090;
|
|
62
|
+
padding:0.5em;
|
|
63
|
+
width:80%;
|
|
64
|
+
border-radius:0.5em;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*]]>*/
|
|
68
|
+
</style>
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<main id="html2index">
|
|
72
|
+
<h1 class="title">HTML2Index</h1>
|
|
128
73
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
background-color: #ffffee ;
|
|
134
|
-
width: 40% ;
|
|
135
|
-
float: right ;
|
|
136
|
-
clear: right }
|
|
74
|
+
<p class="subtitle" id=
|
|
75
|
+
"creates-an-index-or-glossary-of-marked-expressions-in-an-html-file">
|
|
76
|
+
Creates an index or glossary of marked expressions in an
|
|
77
|
+
HTML-file</p>
|
|
137
78
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
font-size: medium }
|
|
79
|
+
<section id="synopsis">
|
|
80
|
+
<h2>SYNOPSIS</h2>
|
|
141
81
|
|
|
142
|
-
|
|
143
|
-
|
|
82
|
+
<p><strong>html2index -s input.html [-o output.html] [-t
|
|
83
|
+
template.html] [-c config] [-d]</strong>
|
|
84
|
+
</p>
|
|
144
85
|
|
|
145
|
-
|
|
146
|
-
|
|
86
|
+
<p><strong>html2index -v</strong>
|
|
87
|
+
</p>
|
|
147
88
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
89
|
+
<p><strong>html2index -h</strong>
|
|
90
|
+
</p>
|
|
91
|
+
</section>
|
|
151
92
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
font-weight: bold }
|
|
155
|
-
|
|
156
|
-
div.topic {
|
|
157
|
-
margin: 2em }
|
|
158
|
-
|
|
159
|
-
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
160
|
-
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
161
|
-
margin-top: 0.4em }
|
|
162
|
-
|
|
163
|
-
h1.title {
|
|
164
|
-
text-align: center }
|
|
93
|
+
<section id="description">
|
|
94
|
+
<h2>DESCRIPTION</h2>
|
|
165
95
|
|
|
166
|
-
|
|
167
|
-
|
|
96
|
+
<p>The program identifies in an HTML source all expressions
|
|
97
|
+
which need to be copied to the generated index and searches
|
|
98
|
+
given dictionaries on the Web for an explanation of each
|
|
99
|
+
expression.</p>
|
|
168
100
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
173
|
-
clear: left ;
|
|
174
|
-
float: left ;
|
|
175
|
-
margin-right: 1em }
|
|
176
|
-
|
|
177
|
-
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
178
|
-
clear: right ;
|
|
179
|
-
float: right ;
|
|
180
|
-
margin-left: 1em }
|
|
181
|
-
|
|
182
|
-
img.align-center, .figure.align-center, object.align-center {
|
|
183
|
-
display: block;
|
|
184
|
-
margin-left: auto;
|
|
185
|
-
margin-right: auto;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
table.align-center {
|
|
189
|
-
margin-left: auto;
|
|
190
|
-
margin-right: auto;
|
|
191
|
-
}
|
|
101
|
+
<p>The resulting glossary is written to a new HTML-file or
|
|
102
|
+
its HTML-code printed to STDOUT.</p>
|
|
192
103
|
|
|
193
|
-
|
|
194
|
-
|
|
104
|
+
<p><strong>NOTE</strong>: The default dictionaries are
|
|
105
|
+
French: Larousse and JargonF. Non-French speakers MUST define
|
|
106
|
+
the dictionary by editing the configuration file
|
|
107
|
+
~/.config/HTML2Index/config as described under Configuration
|
|
108
|
+
below.</p>
|
|
109
|
+
</section>
|
|
195
110
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
text-align: center }
|
|
111
|
+
<section id="options">
|
|
112
|
+
<h2>OPTIONS</h2>
|
|
199
113
|
|
|
200
|
-
|
|
201
|
-
|
|
114
|
+
<dl class="field-list simple">
|
|
115
|
+
<dt>-d, --debug<span class="colon">:</span></dt>
|
|
202
116
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
117
|
+
<dd>
|
|
118
|
+
<p>Be verbose</p>
|
|
119
|
+
</dd>
|
|
206
120
|
|
|
207
|
-
|
|
208
|
-
/* text-align: left } */
|
|
121
|
+
<dt>-s, --source=SOURCE<span class="colon">:</span></dt>
|
|
209
122
|
|
|
210
|
-
|
|
211
|
-
|
|
123
|
+
<dd>
|
|
124
|
+
<p>Source is the the original html-file which contains
|
|
125
|
+
marked expressions (see <strong>Preparations</strong>,
|
|
126
|
+
below).</p>
|
|
127
|
+
</dd>
|
|
212
128
|
|
|
213
|
-
|
|
214
|
-
vertical-align: middle }
|
|
129
|
+
<dt>-o, --out=GLOSSARY<span class="colon">:</span></dt>
|
|
215
130
|
|
|
216
|
-
|
|
217
|
-
|
|
131
|
+
<dd>
|
|
132
|
+
<p>Glossary is the generated file in HTML-format.</p>
|
|
133
|
+
</dd>
|
|
218
134
|
|
|
219
|
-
|
|
220
|
-
|
|
135
|
+
<dt>-t, --template=TEMPLATE<span class=
|
|
136
|
+
"colon">:</span></dt>
|
|
221
137
|
|
|
222
|
-
|
|
223
|
-
|
|
138
|
+
<dd>
|
|
139
|
+
<p>A html file containing placeholders for the references
|
|
140
|
+
to the dictionaries used and the generated glossary. The
|
|
141
|
+
placeholders are currently defined as %=dict_list=% and
|
|
142
|
+
%=glossary=%. You can set different field-delimiters and
|
|
143
|
+
names in the configuration-file. See below under
|
|
144
|
+
<em>EXAMPLE-Template</em> for a rudimentary example.</p>
|
|
145
|
+
</dd>
|
|
224
146
|
|
|
225
|
-
|
|
226
|
-
list-style: lower-alpha }
|
|
147
|
+
<dt>-c, --config=CONFIG<span class="colon">:</span></dt>
|
|
227
148
|
|
|
228
|
-
|
|
229
|
-
|
|
149
|
+
<dd>
|
|
150
|
+
<p>Configuration-file. Command-line arguments override
|
|
151
|
+
the settings in this file. You find a functional
|
|
152
|
+
configuration after the first program-execution in
|
|
153
|
+
<em>~/.config/HTML2Index</em>. The file is commented and
|
|
154
|
+
can immediately be adapted to your needs.</p>
|
|
155
|
+
</dd>
|
|
156
|
+
</dl>
|
|
230
157
|
|
|
231
|
-
|
|
232
|
-
|
|
158
|
+
<section id="common-options">
|
|
159
|
+
<h3>Common Options</h3>
|
|
233
160
|
|
|
234
|
-
|
|
235
|
-
list-style: upper-roman }
|
|
161
|
+
<p><strong>-h, --help</strong> Show this message</p>
|
|
236
162
|
|
|
237
|
-
p
|
|
238
|
-
|
|
239
|
-
|
|
163
|
+
<p><strong>-v, --version</strong> Show program version</p>
|
|
164
|
+
</section>
|
|
165
|
+
</section>
|
|
240
166
|
|
|
241
|
-
|
|
242
|
-
|
|
167
|
+
<section id="example-usage">
|
|
168
|
+
<h2>EXAMPLE Usage</h2>
|
|
243
169
|
|
|
244
|
-
p
|
|
245
|
-
|
|
246
|
-
|
|
170
|
+
<p>Here is a html-page containing instructions on how to
|
|
171
|
+
enable and disable a touchpad using the xinput command (or
|
|
172
|
+
any other HTML-file) in the French (or any other)
|
|
173
|
+
language.</p>
|
|
247
174
|
|
|
248
|
-
p.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
p.rubric {
|
|
252
|
-
font-weight: bold ;
|
|
253
|
-
font-size: larger ;
|
|
254
|
-
color: maroon ;
|
|
255
|
-
text-align: center }
|
|
256
|
-
|
|
257
|
-
p.sidebar-title {
|
|
258
|
-
font-family: sans-serif ;
|
|
259
|
-
font-weight: bold ;
|
|
260
|
-
font-size: larger }
|
|
261
|
-
|
|
262
|
-
p.sidebar-subtitle {
|
|
263
|
-
font-family: sans-serif ;
|
|
264
|
-
font-weight: bold }
|
|
265
|
-
|
|
266
|
-
p.topic-title {
|
|
267
|
-
font-weight: bold }
|
|
268
|
-
|
|
269
|
-
pre.address {
|
|
270
|
-
margin-bottom: 0 ;
|
|
271
|
-
margin-top: 0 ;
|
|
272
|
-
font: inherit }
|
|
273
|
-
|
|
274
|
-
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
275
|
-
margin-left: 2em ;
|
|
276
|
-
margin-right: 2em }
|
|
277
|
-
|
|
278
|
-
pre.code .ln { color: grey; } /* line numbers */
|
|
279
|
-
pre.code, code { background-color: #eeeeee }
|
|
280
|
-
pre.code .comment, code .comment { color: #5C6576 }
|
|
281
|
-
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
282
|
-
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
283
|
-
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
284
|
-
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
285
|
-
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
175
|
+
<p><strong>touchpad_fr.html</strong>
|
|
176
|
+
</p>
|
|
286
177
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
font-style: oblique }
|
|
178
|
+
<section id="execution">
|
|
179
|
+
<h3>Execution</h3>
|
|
290
180
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
font-weight: bold }
|
|
181
|
+
<p>Executing HTML2Index with the -s argument and the
|
|
182
|
+
HTML-file as its value, like this:</p>
|
|
294
183
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
white-space: nowrap }
|
|
300
|
-
|
|
301
|
-
span.pre {
|
|
302
|
-
white-space: pre }
|
|
303
|
-
|
|
304
|
-
span.problematic {
|
|
305
|
-
color: red }
|
|
184
|
+
<pre class=
|
|
185
|
+
"literal-block">:~$ html2index -s /[path]/touchpad_fr.html</pre>
|
|
186
|
+
<p>will produce output like this with expressions from the
|
|
187
|
+
HTML-file explained in the French language :</p>
|
|
306
188
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
table.citation {
|
|
312
|
-
border-left: solid 1px gray;
|
|
313
|
-
margin-left: 1px }
|
|
314
|
-
|
|
315
|
-
table.docinfo {
|
|
316
|
-
margin: 2em 4em }
|
|
317
|
-
|
|
318
|
-
table.docutils {
|
|
319
|
-
margin-top: 0.5em ;
|
|
320
|
-
margin-bottom: 0.5em }
|
|
321
|
-
|
|
322
|
-
table.footnote {
|
|
323
|
-
border-left: solid 1px black;
|
|
324
|
-
margin-left: 1px }
|
|
325
|
-
|
|
326
|
-
table.docutils td, table.docutils th,
|
|
327
|
-
table.docinfo td, table.docinfo th {
|
|
328
|
-
padding-left: 0.5em ;
|
|
329
|
-
padding-right: 0.5em ;
|
|
330
|
-
vertical-align: top }
|
|
331
|
-
|
|
332
|
-
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
333
|
-
font-weight: bold ;
|
|
334
|
-
text-align: left ;
|
|
335
|
-
white-space: nowrap ;
|
|
336
|
-
padding-left: 0 }
|
|
337
|
-
|
|
338
|
-
/* "booktabs" style (no vertical lines) */
|
|
339
|
-
table.docutils.booktabs {
|
|
340
|
-
border: 0px;
|
|
341
|
-
border-top: 2px solid;
|
|
342
|
-
border-bottom: 2px solid;
|
|
343
|
-
border-collapse: collapse;
|
|
344
|
-
}
|
|
345
|
-
table.docutils.booktabs * {
|
|
346
|
-
border: 0px;
|
|
347
|
-
}
|
|
348
|
-
table.docutils.booktabs th {
|
|
349
|
-
border-bottom: thin solid;
|
|
350
|
-
text-align: left;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
354
|
-
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
355
|
-
font-size: 100% }
|
|
356
|
-
|
|
357
|
-
ul.auto-toc {
|
|
358
|
-
list-style-type: none }
|
|
359
|
-
|
|
360
|
-
</style>
|
|
361
|
-
</head>
|
|
362
|
-
<body>
|
|
363
|
-
<div class="document" id="html2index">
|
|
364
|
-
<h1 class="title">HTML2Index</h1>
|
|
365
|
-
<h2 class="subtitle" id="creates-an-index-or-glossary-of-marked-expressions-in-an-html-file">Creates an index or glossary of marked expressions in an HTML-file</h2>
|
|
366
|
-
|
|
367
|
-
<div class="section" id="synopsis">
|
|
368
|
-
<h1>SYNOPSIS</h1>
|
|
369
|
-
<blockquote>
|
|
370
|
-
<p><strong>html2index -s input.html [-o output.html] [-t template.html] [-c config] [-d]</strong></p>
|
|
371
|
-
<p><strong>html2index -v</strong></p>
|
|
372
|
-
<p><strong>html2index -h</strong></p>
|
|
373
|
-
</blockquote>
|
|
374
|
-
</div>
|
|
375
|
-
<div class="section" id="description">
|
|
376
|
-
<h1>DESCRIPTION</h1>
|
|
377
|
-
<p>The program identifies in an HTML source all expressions which need to be copied
|
|
378
|
-
to the generated index and searches given dictionaries on the Web for an
|
|
379
|
-
explanation of each expression.</p>
|
|
380
|
-
<p>The resulting glossary is written to a new HTML-file or its HTML-code printed to STDOUT.</p>
|
|
381
|
-
<p><strong>NOTE</strong>: The default dictionaries are French: Larousse and JargonF. Non-French speakers MUST define the dictionary by editing the configuration file ~/.config/HTML2Index/config as described under Configuration below.</p>
|
|
382
|
-
</div>
|
|
383
|
-
<div class="section" id="options">
|
|
384
|
-
<h1>OPTIONS</h1>
|
|
385
|
-
<table class="docutils field-list" frame="void" rules="none">
|
|
386
|
-
<col class="field-name" />
|
|
387
|
-
<col class="field-body" />
|
|
388
|
-
<tbody valign="top">
|
|
389
|
-
<tr class="field"><th class="field-name">-d, --debug:</th><td class="field-body">Be verbose</td>
|
|
390
|
-
</tr>
|
|
391
|
-
<tr class="field"><th class="field-name" colspan="2">-s, --source=SOURCE:</th></tr>
|
|
392
|
-
<tr class="field"><td> </td><td class="field-body">Source is the the original html-file
|
|
393
|
-
which contains marked expressions (see
|
|
394
|
-
<strong>Preparations</strong>, below).</td>
|
|
395
|
-
</tr>
|
|
396
|
-
<tr class="field"><th class="field-name" colspan="2">-o, --out=GLOSSARY:</th></tr>
|
|
397
|
-
<tr class="field"><td> </td><td class="field-body">Glossary is the generated file in HTML-format.</td>
|
|
398
|
-
</tr>
|
|
399
|
-
<tr class="field"><th class="field-name" colspan="2">-t, --template=TEMPLATE:</th></tr>
|
|
400
|
-
<tr class="field"><td> </td><td class="field-body">A html file containing placeholders for the references to the dictionaries used and
|
|
401
|
-
the generated glossary. The placeholders are
|
|
402
|
-
currently defined as %=dict_list=% and
|
|
403
|
-
%=glossary=%. You can set different
|
|
404
|
-
field-delimiters and names in the
|
|
405
|
-
configuration-file. See below under
|
|
406
|
-
<em>EXAMPLE-Template</em> for a rudimentary example.</td>
|
|
407
|
-
</tr>
|
|
408
|
-
<tr class="field"><th class="field-name" colspan="2">-c, --config=CONFIG:</th></tr>
|
|
409
|
-
<tr class="field"><td> </td><td class="field-body">Configuration-file. Command-line arguments override the settings in this file. You find a functional
|
|
410
|
-
configuration after the first program-execution in <em>~/.config/HTML2Index</em>. The file is commented and
|
|
411
|
-
can immediately be adapted to your needs.</td>
|
|
412
|
-
</tr>
|
|
413
|
-
</tbody>
|
|
414
|
-
</table>
|
|
415
|
-
<div class="section" id="common-options">
|
|
416
|
-
<h2>Common Options</h2>
|
|
417
|
-
<p><strong>-h, --help</strong> Show this message</p>
|
|
418
|
-
<p><strong>-v, --version</strong> Show program version</p>
|
|
419
|
-
</div>
|
|
420
|
-
</div>
|
|
421
|
-
<div class="section" id="example-usage">
|
|
422
|
-
<h1>EXAMPLE Usage</h1>
|
|
423
|
-
<p>Here is a html-page containing instructions on how to enable and disable a
|
|
424
|
-
touchpad using the xinput command (or any other HTML-file) in the French (or
|
|
425
|
-
any other) language.</p>
|
|
426
|
-
<p><strong>touchpad_fr.html</strong></p>
|
|
427
|
-
<div class="section" id="execution">
|
|
428
|
-
<h2>Execution</h2>
|
|
429
|
-
<p>Executing HTML2Index with the -s argument and the HTML-file as its value, like this:</p>
|
|
430
|
-
<pre class="literal-block">
|
|
431
|
-
:~$ html2index -s /[path]/touchpad_fr.html
|
|
432
|
-
</pre>
|
|
433
|
-
<p>will produce output like this with expressions from the HTML-file explained in
|
|
434
|
-
the French language :</p>
|
|
435
|
-
<pre class="literal-block">
|
|
436
|
-
vi
|
|
437
|
-
(JargonF): 1. [Unix]. « Visual Interface » (littéralement, « interface
|
|
438
|
-
visuelle », ça ne s'invente pas !) éditeur de texte du pléistocène codé par
|
|
189
|
+
<pre class="literal-block">vi
|
|
190
|
+
(JargonF): 1. [Unix]. « Visual Interface » (littéralement, « interface
|
|
191
|
+
visuelle », ça ne s'invente pas !) éditeur de texte du pléistocène codé par
|
|
439
192
|
Bill Joy, aussi fondateur de Sun. Des aficionados d'Unix s'en servent
|
|
440
193
|
encore, même s'il est très concurrencé par Emacs. Son principal avantage
|
|
441
194
|
est que quel que soit l'état de votre système (par exemple complètement
|
|
@@ -443,157 +196,245 @@ vi
|
|
|
443
196
|
correctement.
|
|
444
197
|
La version la plus répandue est vim.
|
|
445
198
|
|
|
446
|
-
2.
|
|
199
|
+
2. [nom de domaine]. Nom de domaine de premier niveau des îles Vierges étasuniennes.
|
|
447
200
|
------------------------------------------------------------
|
|
448
201
|
xinput
|
|
449
|
-
(JargonF): commande.
|
|
202
|
+
(JargonF): commande. [X11] Utilitaire facilitant la gestion des
|
|
450
203
|
périphériques X Window d'entrée. Il peut en fournir la liste, détailler
|
|
451
204
|
leurs propriétés et modifier celles qui peuvent l'être.
|
|
452
205
|
http://www.souris-libre.fr/savoir_faire/touchpad/touchpad_fr.html Exemple
|
|
453
|
-
d'utilisation: désactivation et activation rapide du pavé tactile
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
</
|
|
458
|
-
|
|
459
|
-
<
|
|
460
|
-
<
|
|
461
|
-
|
|
462
|
-
<
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
<
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
<p
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
<p>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
<
|
|
479
|
-
|
|
480
|
-
</
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
</
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
<
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
<
|
|
497
|
-
|
|
498
|
-
<
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
<
|
|
517
|
-
</
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
<
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
to
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
</
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
<
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
<
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
</
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
</
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
<
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
<
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
206
|
+
d'utilisation: désactivation et activation rapide du pavé tactile.</pre>
|
|
207
|
+
<p>If you name an output file with the -o option,
|
|
208
|
+
html2index will direct its output in HTML-format to this
|
|
209
|
+
file.</p>
|
|
210
|
+
</section>
|
|
211
|
+
|
|
212
|
+
<section id="preparations">
|
|
213
|
+
<h3>Preparations</h3>
|
|
214
|
+
|
|
215
|
+
<section id="mark-catchwords">
|
|
216
|
+
<h4>Mark catchwords</h4>
|
|
217
|
+
|
|
218
|
+
<p>In the source-code of the original HTML- page,
|
|
219
|
+
expressions for the future glossary are marked by means
|
|
220
|
+
of</p>
|
|
221
|
+
|
|
222
|
+
<ul class="simple">
|
|
223
|
+
<li>
|
|
224
|
+
<p>a tag</p>
|
|
225
|
+
</li>
|
|
226
|
+
|
|
227
|
+
<li>
|
|
228
|
+
<p>an attribute of this tag</p>
|
|
229
|
+
</li>
|
|
230
|
+
|
|
231
|
+
<li>
|
|
232
|
+
<p>the value of the attribute.</p>
|
|
233
|
+
</li>
|
|
234
|
+
</ul>
|
|
235
|
+
|
|
236
|
+
<p>By default, the <em>span</em>-tag with an attribute
|
|
237
|
+
<em>lang="fy"</em> is used, 'fy' meaning Frisian, a
|
|
238
|
+
language which is rarely used on the Web.., I
|
|
239
|
+
venture.</p>
|
|
240
|
+
|
|
241
|
+
<p><em>Example</em>:</p>
|
|
242
|
+
|
|
243
|
+
<pre class=
|
|
244
|
+
"literal-block"><span lang="fy" xml:lang="fy">pavé tactile</span></pre>
|
|
245
|
+
<p>You can, though, define your own tag, attribute and
|
|
246
|
+
attribute-value, if you prefer to mark expressions in
|
|
247
|
+
your original html-file differently, like in</p>
|
|
248
|
+
|
|
249
|
+
<p><em>Example</em>:</p>
|
|
250
|
+
|
|
251
|
+
<pre class=
|
|
252
|
+
"literal-block"><em class="expression">Tripane</em></pre>
|
|
253
|
+
<p>Remember that you can combine css classes and thus
|
|
254
|
+
economize on html-elements, if you use them anyway to
|
|
255
|
+
style your html-content. This would complicate the task
|
|
256
|
+
for html2index only a little bit, as we will see further
|
|
257
|
+
below.</p>
|
|
258
|
+
</section>
|
|
259
|
+
|
|
260
|
+
<section id="configuration">
|
|
261
|
+
<h4>Configuration</h4>
|
|
262
|
+
|
|
263
|
+
<p>Apart from the way that expressions are marked in the
|
|
264
|
+
original html, you can prepare a few settings for
|
|
265
|
+
HTML2Index, which influence its behaviour. Command-line
|
|
266
|
+
options override the values stored in the
|
|
267
|
+
configuration-file.</p>
|
|
268
|
+
|
|
269
|
+
<p>A default configuration will be stored in the file
|
|
270
|
+
<em>~/.config/HTML2Index/config</em> the first time that
|
|
271
|
+
you run html2index. It should be sufficiently commented
|
|
272
|
+
to allow you to comprehend and alter any values in the
|
|
273
|
+
file.</p>
|
|
274
|
+
|
|
275
|
+
<p>However, an explanation of each one of the available
|
|
276
|
+
variables follows:</p>
|
|
277
|
+
|
|
278
|
+
<dl class="field-list">
|
|
279
|
+
<dt>debug<span class="colon">:</span></dt>
|
|
280
|
+
|
|
281
|
+
<dd>
|
|
282
|
+
<p>Does the same as the command-line options '-d' or
|
|
283
|
+
'--debug'. Accepts the values false or true or can be
|
|
284
|
+
left empty. If set to true, this setting causes
|
|
285
|
+
html2index to be very verbose. Usually, you do not
|
|
286
|
+
need to change the default value to this variable,
|
|
287
|
+
which is <em>false</em>.</p>
|
|
288
|
+
</dd>
|
|
289
|
+
|
|
290
|
+
<dt>dictionaries<span class="colon">:</span></dt>
|
|
291
|
+
|
|
292
|
+
<dd>
|
|
293
|
+
<p>Here, you <strong>HAVE</strong> to define the
|
|
294
|
+
online-dictionaries to consult, if you do not want to
|
|
295
|
+
stick with the defaults, which are Larousse and
|
|
296
|
+
JargonF, two French speaking sites, which also
|
|
297
|
+
provide explanations in the French language only.</p>
|
|
298
|
+
|
|
299
|
+
<p>The dictionaries are defined with four variables,
|
|
300
|
+
each: <em>name, url, xpath, color</em>. Each
|
|
301
|
+
dictionary-definition must start with a dash,
|
|
302
|
+
followed by a white-space, then the first variable.
|
|
303
|
+
Each variable-name must be enclosed by colons (see
|
|
304
|
+
comments in the config-file).</p>
|
|
305
|
+
|
|
306
|
+
<dl class="field-list simple">
|
|
307
|
+
<dt>name<span class="colon">:</span></dt>
|
|
308
|
+
|
|
309
|
+
<dd>
|
|
310
|
+
<p>The name of the dictionary, how it will be
|
|
311
|
+
referred to in the Glossary. An example could be
|
|
312
|
+
'Merriam-Webster'</p>
|
|
313
|
+
</dd>
|
|
314
|
+
|
|
315
|
+
<dt>url<span class="colon">:</span></dt>
|
|
316
|
+
|
|
317
|
+
<dd>
|
|
318
|
+
<p>Note here the part from the url to a
|
|
319
|
+
search-result in the chosen dictionary, which
|
|
320
|
+
precedes the searched expression. You determine
|
|
321
|
+
this string by doing a search in the
|
|
322
|
+
online-dictionary, then copy&paste the url as
|
|
323
|
+
it is displayed in your browser. Rearrange
|
|
324
|
+
possible request-parameters (following '?') to
|
|
325
|
+
ensure that the searched word or expression is
|
|
326
|
+
the very last item in the url. Remove only the
|
|
327
|
+
searched expression and note the remainder as the
|
|
328
|
+
value to the variable <em>url</em>. For
|
|
329
|
+
Merriam-Webster, this url fragment would be (in
|
|
330
|
+
January 2026): "<a class="reference external"
|
|
331
|
+
href=
|
|
332
|
+
"https://www.merriam-webster.com/dictionary/">https://www.merriam-webster.com/dictionary/</a>"</p>
|
|
333
|
+
</dd>
|
|
334
|
+
|
|
335
|
+
<dt>xpath<span class="colon">:</span></dt>
|
|
336
|
+
|
|
337
|
+
<dd>
|
|
338
|
+
<p>This is the xpath which identifies the
|
|
339
|
+
HTML-element in a search-result which contains
|
|
340
|
+
the explanation of an expression. Many resources
|
|
341
|
+
on the Web explain how to compose an xpath. Be as
|
|
342
|
+
specific as possible, to avoid a
|
|
343
|
+
miss-interpretation of the xpath-expression, use
|
|
344
|
+
html-attributes which may be applied to an HTML
|
|
345
|
+
container-tag. Especially <em>id</em>, if present
|
|
346
|
+
but also css-classes can help to identify a tag
|
|
347
|
+
unambiguously.</p>
|
|
348
|
+
</dd>
|
|
349
|
+
|
|
350
|
+
<dt>color<span class="colon">:</span></dt>
|
|
351
|
+
|
|
352
|
+
<dd>
|
|
353
|
+
<p>A hexadecimal rgb color value in single quotes
|
|
354
|
+
is attributed to each dictionary to facilitate
|
|
355
|
+
the identification of the dictionary which
|
|
356
|
+
provides a specific explanation in the glossary.
|
|
357
|
+
Exemplary colors are <em>'800000'</em> or
|
|
358
|
+
<em>'500050'</em>. Take care to choose colors
|
|
359
|
+
which harmonize with the background in your
|
|
360
|
+
template-file, if you use one.</p>
|
|
361
|
+
</dd>
|
|
362
|
+
</dl>
|
|
363
|
+
</dd>
|
|
364
|
+
|
|
365
|
+
<dt>template<span class="colon">:</span></dt>
|
|
366
|
+
|
|
367
|
+
<dd>
|
|
368
|
+
<p>An HTML-file which contains placeholders. Two
|
|
369
|
+
placeholders are needed at the time of this writing,
|
|
370
|
+
one to name the dictionaries which are used to
|
|
371
|
+
look-up definitions, another one to locate the spot
|
|
372
|
+
where the new glossary will be written. See below
|
|
373
|
+
under <em>EXAMPLE-Template</em> for a rudimentary
|
|
374
|
+
example. The default template is internally
|
|
375
|
+
defined.</p>
|
|
376
|
+
</dd>
|
|
377
|
+
|
|
378
|
+
<dt>fdelim<span class="colon">:</span></dt>
|
|
379
|
+
|
|
380
|
+
<dd>
|
|
381
|
+
<p>A character sequence which is used to mark
|
|
382
|
+
placeholders in the HTML-template file. The default
|
|
383
|
+
is '<em>%-</em>', meaning that a percent-symbol
|
|
384
|
+
followed by a dash marks the beginning, a dash
|
|
385
|
+
followed by a percent-symbol the end of a
|
|
386
|
+
placeholder, like in <strong>%-dict-list-%</strong>
|
|
387
|
+
for the placeholder named 'dict-list'.</p>
|
|
388
|
+
</dd>
|
|
389
|
+
|
|
390
|
+
<dt>placeholders<span class="colon">:</span></dt>
|
|
391
|
+
|
|
392
|
+
<dd>
|
|
393
|
+
<p>A list of placeholder names. Currently, there are
|
|
394
|
+
only two placeholders recognized by Html2Index:
|
|
395
|
+
<em>dict_list</em> and <em>glossary</em>. As the
|
|
396
|
+
value to these two variables, note the name that you
|
|
397
|
+
chose for the placeholders in your HTML-template. The
|
|
398
|
+
defaults are <em>dict_list</em> for
|
|
399
|
+
<em>dict_list</em> and <em>index</em> for
|
|
400
|
+
<em>glossary</em>.</p>
|
|
401
|
+
</dd>
|
|
402
|
+
|
|
403
|
+
<dt>html_tag<span class="colon">:</span></dt>
|
|
404
|
+
|
|
405
|
+
<dd>
|
|
406
|
+
<p>This is the tag which encloses marked expressions
|
|
407
|
+
in the original HTML-page (the source-file). Default
|
|
408
|
+
is <em>span</em></p>
|
|
409
|
+
</dd>
|
|
410
|
+
|
|
411
|
+
<dt>html_attribute<span class="colon">:</span></dt>
|
|
412
|
+
|
|
413
|
+
<dd>
|
|
414
|
+
<p>An attribute of the html_tag which encloses marked
|
|
415
|
+
expressions in the original HTML-page (the
|
|
416
|
+
source-file). Default is <em>lang</em>.</p>
|
|
417
|
+
</dd>
|
|
418
|
+
|
|
419
|
+
<dt>html_value<span class="colon">:</span></dt>
|
|
420
|
+
|
|
421
|
+
<dd>
|
|
422
|
+
<p>The value of an attribute of the html_tag which
|
|
423
|
+
encloses marked expressions in the original HTML-page
|
|
424
|
+
(the source-file). Default is <em>fy</em>.</p>
|
|
425
|
+
</dd>
|
|
426
|
+
</dl>
|
|
427
|
+
</section>
|
|
428
|
+
</section>
|
|
429
|
+
</section>
|
|
430
|
+
|
|
431
|
+
<section id="example-template">
|
|
432
|
+
<h2>EXAMPLE-Template</h2>
|
|
433
|
+
|
|
434
|
+
<p>Assuming that the defaults are used, the following could
|
|
435
|
+
be a working HTML-template to use with HTML2Index:</p>
|
|
436
|
+
|
|
437
|
+
<pre class="literal-block"><html>
|
|
597
438
|
<head><title>Glossary</title></head>
|
|
598
439
|
<body>
|
|
599
440
|
<h1>Glossary</h1>
|
|
@@ -604,35 +445,42 @@ HTML-template to use with HTML2Index:</blockquote>
|
|
|
604
445
|
<!-- will be replaced by a definition list <dl><dt><dd>... </dd></dt></dl> -->
|
|
605
446
|
%-glossary-%
|
|
606
447
|
</body>
|
|
607
|
-
</html>
|
|
608
|
-
</
|
|
609
|
-
|
|
610
|
-
<
|
|
611
|
-
<
|
|
612
|
-
|
|
613
|
-
<p>html2index warns you if the output-file exists and asks
|
|
614
|
-
to replace it with a new version.</p>
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
<
|
|
628
|
-
|
|
629
|
-
<
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
448
|
+
</html></pre>
|
|
449
|
+
</section>
|
|
450
|
+
|
|
451
|
+
<section id="errors-and-warnings">
|
|
452
|
+
<h2>ERRORS and WARNINGS</h2>
|
|
453
|
+
|
|
454
|
+
<p>html2index warns you if the output-file exists and asks
|
|
455
|
+
you if you want to replace it with a new version.</p>
|
|
456
|
+
|
|
457
|
+
<p>The program also tries to determine the file-type of the
|
|
458
|
+
input (HTML) file and gives out a warning if the file is
|
|
459
|
+
considered unsuitable.</p>
|
|
460
|
+
|
|
461
|
+
<p>Each time, that an expression cannot be found in one of
|
|
462
|
+
the targeted dictionaries, a warning is given. All these
|
|
463
|
+
problematic expressions will be listed in a temporary file,
|
|
464
|
+
which is named after html2index has terminated.</p>
|
|
465
|
+
</section>
|
|
466
|
+
|
|
467
|
+
<section id="source-code-and-development">
|
|
468
|
+
<h2>SOURCE CODE and DEVELOPMENT</h2>
|
|
469
|
+
|
|
470
|
+
<p>html2index is developed in Ruby and can be installed as a
|
|
471
|
+
Ruby-Gem. As Ruby is an interpreter-language, the source-code
|
|
472
|
+
of the installed version is always accessible. You can also
|
|
473
|
+
decompress the gem-file to take a look at the code.</p>
|
|
474
|
+
|
|
475
|
+
<dl class="field-list simple">
|
|
476
|
+
<dt>AUTHOR<span class="colon">:</span></dt>
|
|
477
|
+
|
|
478
|
+
<dd>
|
|
479
|
+
<p>Michael Uplawski
|
|
480
|
+
<michael[dot]uplawski[at]uplawski[dot]eu></p>
|
|
481
|
+
</dd>
|
|
482
|
+
</dl>
|
|
483
|
+
</section>
|
|
484
|
+
</main>
|
|
637
485
|
</body>
|
|
638
486
|
</html>
|