This repository has been archived by the owner on Dec 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmanpage.html
456 lines (399 loc) · 14.9 KB
/
manpage.html
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<STYLE>body{margin:3em;} pre{background:#ffc;}</STYLE>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>txt2tags(1) man page</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<CENTER>
<H1>txt2tags(1) man page</H1>
</CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<UL>
<LI><A HREF="#name">NAME</A>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#markup">MARKUP</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#source">SOURCE FILES</A>
<LI><A HREF="#settings">SETTINGS</A>
<LI><A HREF="#commands">COMMANDS</A>
<LI><A HREF="#macros">MACROS</A>
<LI><A HREF="#examples">EXAMPLES</A>
<LI><A HREF="#files">FILES</A>
<LI><A HREF="#environment">ENVIRONMENT</A>
<LI><A HREF="#author">AUTHOR</A>
<LI><A HREF="#bugs">BUGS</A>
<LI><A HREF="#copyright">COPYRIGHT</A>
</UL>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<H1 ID="name">NAME</H1>
<P>
txt2tags - text formatting and conversion tool
</P>
<H1 ID="synopsis">SYNOPSIS</H1>
<P>
<B>txt2tags</B> [<I>options</I>] [<I>FILE</I>...]
</P>
<H1 ID="description">DESCRIPTION</H1>
<P>
<B>txt2tags</B> reads a text file with minimal markup and convert it to:
<I>ASCII Art</I>,
<I>AsciiDoc</I>,
<I>Creole</I>,
<I>DocBook</I>,
<I>DokuWiki</I>,
<I>Google Code Wiki</I>,
<I>HTML</I>,
<I>LaTeX</I>,
<I>Lout</I>,
<I>MagicPoint</I>,
<I>Man page</I>,
<I>MoinMoin</I>,
<I>PageMaker</I>,
<I>Plain Text</I>,
<I>PmWiki</I>,
<I>SGML</I>,
<I>Wikipedia</I> and
<I>XHTML</I>.
</P>
<P>
This man page was created by <B>txt2tags</B> from a simple text file. The same text file is also converted to HTML for the online version of this manual.
</P>
<P>
ONE source, MULTI targets - <A HREF="http://txt2tags.org">http://txt2tags.org</A>
</P>
<H1 ID="markup">MARKUP</H1>
<PRE>
Headers First 3 lines of the source file
Title = words =
Numbered title + words +
Comment % comments
Separator line -----------------------...
Strong line =======================...
Image [filename.jpg]
Link [label url]
Bold **words**
Italic //words//
Underline __words__
Strike --words--
Monospaced ``words``
Raw ""words""
Tagged ''words''
Paragraph words
Quote <TAB>words
List - words
Numbered list + words
Definition list : words
Table | cell1 | cell2 | cell3...
Verbatim line ``` words
Raw line """ words
Tagged line ''' words
Verbatim block ```
lines
```
Raw block """
lines
"""
Tagged block '''
lines
'''
</PRE>
<H1 ID="options">OPTIONS</H1>
<DL>
<DT> <B>--art-chars</B>=<I>PATTERN</I></DT><DD>
Define <I>PATTERN</I> as the pattern of characters used to compose the ASCII Art decorations, in the following order: corner, border, side, bar1, bar2, level2, level3, level4, level5. The default pattern value is +-|-==-^". This option is only used by the ASCII Art target.
<P></P>
<DT><B>-C</B>, <B>--config-file</B>=<I>FILE</I></DT><DD>
Read configuration from the external file <I>FILE</I>. The configuration must be on the <I>%!keyword:value</I> format. See <A HREF="#settings">SETTINGS</A> section for details.
<P></P>
<DT> <B>--css-sugar</B></DT><DD>
Improves the generated HTML/XHTML code to be used with CSS files. Tag attributes are removed, presentation tags are avoided, header is composed by H1, H2 and H3 tags, new DIVs are created: <I>#header</I>, <I>#body</I>, <I>.toc</I>.
<P></P>
<DT> <B>--css-inside</B></DT><DD>
Insert CSS file contents inside HTML/XHTML headers. Use <CODE>--style</CODE> to specify a CSS file to be read.
<P></P>
<DT> <B>--dump-config</B></DT><DD>
Print all the configuration found and exit.
<P></P>
<DT> <B>--dump-source</B></DT><DD>
Print the document source, with includes (<CODE>%!include</CODE>) expanded.
<P></P>
<DT> <B>--encoding</B>=<I>CODE</I></DT><DD>
Inform the character set (file encoding) used by the source document. Examples are UTF-8 and iso-8859-1. The encoding is not changed during conversion, so the output document will have the same encoding as the sources.
<P></P>
<DT> <B>--gui</B></DT><DD>
Invoke Graphical Tk Interface.
<P></P>
<DT><B>-h</B>, <B>--help</B></DT><DD>
Print help information and exit.
<P></P>
<DT><B>-H</B>, <B>--no-headers</B></DT><DD>
Suppress header and footer from the output. Only the contents (body) will be shown.
<P></P>
<DT> <B>--headers</B></DT><DD>
Show header and footer in the output. Default is ON.
<P></P>
<DT> <B>--height</B>=<I>NUM</I></DT><DD>
Set the output's height to <I>NUM</I> rows. This option is only used by the ASCII Art target, when also using <CODE>--slides</CODE>.
<P></P>
<DT><B>-i</B>, <B>--infile</B>=<I>FILE</I></DT><DD>
Set <I>FILE</I> as the input file name, the source document. Use '-' to read the sources from the STDIN.
<P></P>
<DT> <B>--mask-email</B></DT><DD>
Hide emails from spam robots. Removes @ and dots. The address [email protected] turns to <foo (a) bar com>.
<P></P>
<DT><B>-n</B>, <B>--enum-title</B></DT><DD>
Turn on automatic numbering for titles. They will be prefixed by 1, 1.1, 1.1.1, ...
<P></P>
<DT> <B>--no-dump-config</B></DT><DD>
Cancel the <CODE>--dump-config</CODE> action.
<P></P>
<DT> <B>--no-dump-source</B></DT><DD>
Cancel the <CODE>--dump-source</CODE> action.
<P></P>
<DT> <B>--no-encoding</B></DT><DD>
Clear the encoding setting.
<P></P>
<DT> <B>--no-enum-title</B></DT><DD>
Turn off the automatic numbering for titles.
<P></P>
<DT> <B>--no-infile</B></DT><DD>
Clear all the previous infile declarations.
<P></P>
<DT> <B>--no-targets</B></DT><DD>
Cancel the <CODE>--targets</CODE> action.
<P></P>
<DT> <B>--no-mask-email</B></DT><DD>
Turn off the email masking feature.
<P></P>
<DT> <B>--no-outfile</B></DT><DD>
Clear the previous outfile declaration.
<P></P>
<DT> <B>--no-quiet</B></DT><DD>
Show messages, turning off the <CODE>--quiet</CODE> option.
<P></P>
<DT> <B>--no-rc</B></DT><DD>
Do not read the user configuration file ~/.txt2tagsrc.
<P></P>
<DT> <B>--no-slides</B></DT><DD>
Turn off the slides feature.
<P></P>
<DT> <B>--no-style</B></DT><DD>
Clear all the style settings.
<P></P>
<DT> <B>--no-toc</B></DT><DD>
Remove the Table of Contents from the output.
<P></P>
<DT> <B>--no-toc-only</B></DT><DD>
Turn off the <CODE>--toc-only</CODE> action.
<P></P>
<DT><B>-o</B>, <B>--outfile</B>=<I>FILE</I></DT><DD>
Set <I>FILE</I> as the output file name. Use '-' to send the results to STDOUT.
<P></P>
<DT><B>-q</B>, <B>--quiet</B></DT><DD>
Quiet mode. Suppress all output, except errors.
<P></P>
<DT> <B>--rc</B></DT><DD>
Read the user configuration file ~/.txt2tagsrc. Default is ON.
<P></P>
<DT> <B>--slides</B></DT><DD>
Format output as presentation slides. This option is only used by the ASCII Art target.
<P></P>
<DT> <B>--style</B>=<I>FILE</I></DT><DD>
Use <I>FILE</I> as the document's style file. Used to define CSS files for HTML/XHTML documents and packages for LaTeX. This option can be used multiple times to include multiple files.
<P></P>
<DT><B>-t</B>, <B>--target</B>=<I>TYPE</I></DT><DD>
Set the output document format to <I>TYPE</I>. Some popular types are: <I>html</I>, <I>xhtml</I>, <I>tex</I>, <I>man</I>, <I>txt</I>. Use the <CODE>--targets</CODE> option to see all the available formats.
<P></P>
<DT> <B>--targets</B></DT><DD>
Print a list of all the available targets and exit.
<P></P>
<DT> <B>--toc</B></DT><DD>
Include an automatic Table of Contents (TOC) to the output, between the Header and the Body. You can also specify the TOC position using the <CODE>%%TOC</CODE> macro.
<P></P>
<DT> <B>--toc-level</B>=<I>NUM</I></DT><DD>
Set the maximum TOC level to <I>NUM</I>. All titles deeper than <I>NUM</I> will not be included in the Table of Contents.
<P></P>
<DT> <B>--toc-only</B></DT><DD>
Print the Table of Contents and exit.
<P></P>
<DT><B>-v</B>, <B>--verbose</B></DT><DD>
Print informative messages during conversion. This option can be used multiple times to increase the number of messages shown.
<P></P>
<DT><B>-V</B>, <B>--version</B></DT><DD>
Print program version and exit.
<P></P>
<DT> <B>--width</B>=<I>NUM</I></DT><DD>
Set the output's width to <I>NUM</I> columns. This option is only used by the ASCII Art target.
</DL>
<H1 ID="source">SOURCE FILES</H1>
<P>
The source files are usually identified by the <I>.t2t</I> extension (such as <CODE>myfile.t2t</CODE>). You may have three areas inside your sources:
</P>
<DL>
<DT><B>Header</B> (optional)</DT><DD>
The first three lines of the file. Leave the first line blank if you don't need headers. Used for document title, author, version and date information.
<P></P>
<DT><B>Settings</B> (optional)</DT><DD>
Begins right after the Header (4th or 2nd line) and ends when the Body area starts.
Used for settings (configurations) in the <CODE>%!keyword:value</CODE> format.
<P></P>
<DT><B>Body</B></DT><DD>
Begins at the first valid text line (not comment or setting) after the Header area and goes until the end of the document. Used for the document contents.
</DL>
<H1 ID="settings">SETTINGS</H1>
<P>
Settings let you customize <B>txt2tags</B>, they're similar to options. They can be used at: source document's Settings area, <CODE>~/.txt2tagsrc</CODE> file, external file called with <CODE>--config-file</CODE>.
</P>
<DL>
<DT><B>%!target</B></DT><DD>
Set the output format, just like <CODE>--target</CODE>. Example:
<PRE>
%!target: html
</PRE>
<P></P>
<DT><B>%!options(target)</B></DT><DD>
Set the default options to each target. You must use the command line options. Example:
<PRE>
%!options(html): --toc --toc-level 3 --css-sugar
</PRE>
<P></P>
<DT><B>%!includeconf</B></DT><DD>
Include configurations from an external file into the current, just like <CODE>--config-file</CODE>. Example:
<PRE>
%!includeconf: myconfig.t2t
</PRE>
<P></P>
<DT><B>%!style</B></DT><DD>
Set a style file for the document, just like <CODE>--style</CODE>. Can be used multiple times. Example:
<PRE>
%!style: colors.css
</PRE>
<P></P>
<DT><B>%!encoding</B></DT><DD>
Set the character set used by the document, just like <CODE>--encoding</CODE>. Example:
<PRE>
%!encoding: UTF-8
</PRE>
<P></P>
<DT><B>%!preproc</B></DT><DD>
Input search/replace filter used to change the Body of the source document BEFORE any parsing by txt2tags. Search uses Python regular expressions. Example:
<PRE>
%!preproc: "JJS" "John J. Smith"
</PRE>
<P></P>
<DT><B>%!postproc</B></DT><DD>
Output search/replace filter used to change the generated document AFTER all the txt2tags processing. Search uses Python regular expressions. Example:
<PRE>
%!postproc(html): "<B>" "<STRONG>"
</PRE>
</DL>
<P>
If the same keyword appears more than once, the last found will be the one used (except: options, preproc and postproc, which are cumulative). Invalid keywords are ignored. The parsing order is: <CODE>~/.txt2tagsrc</CODE>, source document's Config area, <CODE>--config-file</CODE> option.
</P>
<H1 ID="commands">COMMANDS</H1>
<P>
Commands perform tasks during conversion time. They must be placed at the source document's Body.
</P>
<DL>
<DT><B>%!csv: file.csv</B></DT><DD>
Includes an external CSV file as a table.
<P></P>
<DT><B>%!include: file.t2t</B></DT><DD>
Includes a txt2tags file in the document.
<P></P>
<DT><B>%!include: ``file.txt``</B></DT><DD>
Includes a text file (verbatim) in the document.
<P></P>
<DT><B>%!include: ''file.html''</B></DT><DD>
Includes an already tagged file in the document.
</DL>
<H1 ID="macros">MACROS</H1>
<P>
Macros are handy shortcuts to insert dynamic contents in your document. They must be placed at the source document's Body. Except <CODE>%%toc</CODE>, all macros can be customized with special directives, like <CODE>%Y</CODE> and <CODE>%f</CODE>. See the txt2tags User Guide for details.
</P>
<DL>
<DT><B>%%date</B></DT><DD>
Insert the current date. The default format is <CODE>%%date(%Y%m%d)</CODE>, which gives YYYYMMDD.
<P></P>
<DT><B>%%infile</B></DT><DD>
Insert the source file path. The default format is <CODE>%%infile(%f)</CODE>. Useful for footer links like <CODE>[See source %%infile]</CODE>.
<P></P>
<DT><B>%%mtime</B></DT><DD>
Insert the source file modification time. The default format is <CODE>%%date(%Y%m%d)</CODE>, which gives YYYYMMDD.
<P></P>
<DT><B>%%outfile</B></DT><DD>
Insert the output file path. The default format is <CODE>%%outfile(%f)</CODE>. Useful for self mentioning like "This is the manpage.html file".
<P></P>
<DT><B>%%toc</B></DT><DD>
Specifies where the Table of Contents will be placed. You can even use it multiple times. Note that you must also use the <CODE>--toc</CODE> option.
</DL>
<H1 ID="examples">EXAMPLES</H1>
<DL>
<DT><CODE>txt2tags -t html file.t2t</CODE></DT><DD>
<P></P>
Convert to HTML, saving to file.html.
<P></P>
<DT><CODE>txt2tags -t html -o - file.t2t</CODE></DT><DD>
<P></P>
Convert to HTML, sending results to STDOUT.
<P></P>
<DT><CODE>txt2tags -t html --toc file.t2t</CODE></DT><DD>
<P></P>
Convert to HTML, including automatic Table Of Contents.
<P></P>
<DT><CODE>txt2tags -t html --toc --toc-level 2 -n file.t2t</CODE></DT><DD>
<P></P>
Convert to HTML, with a two level Table of Contents and numbered titles.
<P></P>
<DT><CODE>txt2tags --toc-only file.t2t</CODE></DT><DD>
<P></P>
Just show the Table of Contents, no conversion is done.
<P></P>
<DT><CODE>txt2tags -t html --css-sugar --style base.css --style ui.css file.t2t</CODE></DT><DD>
<P></P>
Convert to HTML, preparing the resulting code to be used with CSS, and also include calls to two external CSS files.
<P></P>
<DT><CODE>txt2tags -t art --slides --width 80 --height 25 -o - file.t2t | more</CODE></DT><DD>
<P></P>
Create ASCII Art presentation slides, ready to be shown in a 80x25 terminal screen/window.
<P></P>
<DT><CODE>(echo ; echo "**bold**") | txt2tags -t html -H -</CODE></DT><DD>
<P></P>
Handy one-liner for quick tests using STDIN.
<P></P>
<DT><CODE>txt2tags -t html -o - file.t2t | tidy > file.html</CODE></DT><DD>
<P></P>
Send results to STDOUT, then fine tune the code with an external program before saving the output file.
</DL>
<H1 ID="files">FILES</H1>
<DL>
<DT>~/.txt2tagsrc</DT><DD>
Default user configuration file.
</DL>
<H1 ID="environment">ENVIRONMENT</H1>
<DL>
<DT>T2TCONFIG</DT><DD>
If non-null, sets the full pathname for the default user configuration file.
</DL>
<H1 ID="author">AUTHOR</H1>
<P>
Aurelio Jargas <<verde (a) aurelio net>>
</P>
<H1 ID="bugs">BUGS</H1>
<P>
<A HREF="http://bugs.txt2tags.org">http://bugs.txt2tags.org</A>
</P>
<H1 ID="copyright">COPYRIGHT</H1>
<P>
Copyright (C) 2001-2012 Aurelio Jargas, GNU GPL v2
</P>
<!-- html code generated by txt2tags 2.6.641 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -t html ./manpage.t2t -->
<a style="position:fixed;top:0;left:5;background:white;" href="/">« txt2tags.org</a></BODY></HTML>