1TXT2TAGS(1)                 General Commands Manual                TXT2TAGS(1)
2
3
4

NAME

6       txt2tags - text formatting and conversion tool
7
8

SYNOPSIS

10       txt2tags [OPTION]... [FILE]...
11
12

DESCRIPTION

14       txt2tags  is a GPL format conversion tool written in Python that gener‐
15       ates HTML, XHTML, SGML, LaTeX, Lout,  Man  Page,  MoinMoin,  Wikipedia,
16       DokuWiki,  Google  Code Wiki, MagicPoint and PageMaker documents from a
17       single text file with minimal markup.
18
19
20       The user just need to know the very few and simple txt2tags marks,  and
21       write plain text files. The program does all the dirty work, adding the
22       complicated tags and dealing with the target document's gotchas.
23
24
25       The same text file can be converted to all target formats, with no fur‐
26       ther editing. This is the txt2tags purpose: ONE source, MULTI targets.
27
28
29       Please visit the program site at http://txt2tags.sourceforge.net.
30
31

OPTIONS

33        -C, --config-file
34              read config from an external file (works like %!includeconf)
35
36
37            --css-sugar
38              insert CSS-friendly tags for HTML and XHTML targets
39
40
41            --css-inside
42              insert CSS file contents inside HTML/XHTML headers
43
44
45            --dump-config
46              print all the config found and exit
47
48
49            --dump-source
50              print the document source, with includes expanded
51
52
53            --encoding
54              set target file encoding (utf-8, iso-8859-1, etc)
55
56
57            --gui
58              invoke Graphical Tk Interface
59
60
61        -h, --help
62              print help information and exit
63
64
65        -H, --no-headers
66              suppress header, title and footer information
67
68
69            --headers
70              show header, title and footer information (default ON)
71
72
73        -i, --infile=FILE
74              set FILE as the input file name ('-' for STDIN)
75
76
77            --mask-email
78              hide email from spam robots. x@y.z turns <x (a) y z>
79
80
81        -n, --enum-title
82              enumerate all title lines as 1, 1.1, 1.1.1, etc
83
84
85            --no-dump-config
86              turn off the dump config action
87
88
89            --no-dump-source
90              turn off the dump source action
91
92
93            --no-encoding
94              clear the encoding setting
95
96
97            --no-enum-title
98              turn off the title auto numbering
99
100
101            --no-infile
102              clear all the previous infile declarations
103
104
105            --no-mask-email
106              unhide emails, turning off the --mask-email option
107
108
109            --no-outfile
110              clear the previous outfile declaration
111
112
113            --no-quiet
114              show messages, turning off the --quiet option
115
116
117            --no-rc
118              do not read the user config file ~/.txt2tagsrc
119
120
121            --no-style
122              clear the style setting
123
124
125            --no-toc
126              do not add TOC (Table of Contents) to target document
127
128
129            --no-toc-only
130              turn off the --toc-only option
131
132
133        -o, --outfile=FILE
134              set FILE as the output file name ('-' for STDOUT)
135
136
137        -q, --quiet
138              quiet mode, suppress all output (except errors)
139
140
141            --rc
142              read user config file ~/.txt2tagsrc (default ON)
143
144
145            --style=FILE
146              use FILE as the document style (like Html CSS)
147
148
149       -t, --target=TYPE
150              set  target  document  type.  currently  supported: html, xhtml,
151              sgml, tex, lout, man, mgp, wiki, gwiki, doku, moin, pm6, txt
152
153
154            --toc
155              add TOC (Table of Contents) to target document
156
157
158            --toc-level=N
159              set maximum TOC level (deepness) to N
160
161
162            --toc-only
163              print document TOC and exit
164
165
166        -v, --verbose
167              print informative messages during conversion
168
169
170        -V, --version
171              print program version and exit
172
173
174       By default, converted output is saved to 'file.<type>'.  Use  --outfile
175       to  force an output file name.  If input file is '-', reads from STDIN.
176       If output file is '-', dumps output to STDOUT.
177
178

STRUCTURE

180       Txt2tags source file can have three areas:
181
182
183       Header The first three lines. They are used  for  document  identifica‐
184              tion.   If  you don't need headers, you must left the first line
185              blank or specify the no-header setting.
186
187
188       Settings
189              Starts at the fourth line.  All  settings  have  the  %!keyword:
190              value  format. Settings can also be made by a configuration file
191              or command line.
192
193
194       Body   Your real document source! Your only  request  area  to  have  a
195              valid txt2tags file.
196
197

SETTINGS

199       The  conversion  of  a  source  file can be customized in two different
200       ways.  External   configurations   are   taken   from   the   RC   file
201       (~/.txt2tagsrc)  or  other  user-selected file. Internal configurations
202       are made with settings. Both use the same syntax:
203
204
205       %!target:
206              defines the main target
207
208
209       %!options(target):
210              defines the options to each target
211
212
213       %!include: file.t2t
214              includes a txt2tags file in the document
215
216
217       %!include: ``file.txt``
218              includes a text file (verbatim) in the document
219
220
221       %!include: ''file.html''
222              includes a literal file in the document, as it is
223
224
225       %!style:
226              to set a CSS (Cascading Style Sheets) file for  XHTML  and  HTML
227              targets or to load \usepackage modules in TEX target
228
229
230       %!encoding:
231              to set a character set (like iso-8859-1) for i18n issues
232
233
234       %!includeconf:
235              used  to  include  configurations from an external file into the
236              current
237
238
239       %!guicolors:
240              color settings for the GUI interface (Tk)
241
242
243       %!preproc:
244              your customized filter (macro) which will  be  processed  BEFORE
245              the document parsing
246
247
248       %!postproc:
249              your customized filter (macro) which will be processed AFTER the
250              document parsing
251
252
253   SETTINGS RULES
254              ·  Settings are valid only inside the Config Area, and are  con‐
255                 sidered  plain comments if found on the document Body. Except
256                 include, which is a valid Body command.
257
258
259              ·  If the same keyword appears more  than  once  on  the  Config
260                 Area,  the  last found will be the one used. Except: options,
261                 preproc and postproc, which are cumulative.
262
263
264              ·  A setting line with an invalid keyword will be  considered  a
265                 plain comment line.
266
267
268              ·  This  settings  have precedence over txt2tagsrc file, but not
269                 on command line options.
270
271

SYNTAX

273       A very simple markup syntax is used on the document source  (the  plain
274       text  file) to identify structures and formatting.  Here's the complete
275       list:
276
277
278   Basic
279         Headers           The first 3 lines of the source file
280         Title             = words =
281         Numbered title    + words +
282         Paragraph         words
283
284
285
286   Beautifiers
287         Bold              **words**
288         Italic            //words//
289         Underline         __words__
290         Strike            --words--
291         Monospaced        ``words``
292
293
294
295   Text Blocks
296         Quote             <TAB>words
297         List              - words
298         Numbered list     + words
299         Definition list   : words
300         Verbatim line     ``` words
301         Verbatim area     ```<LineBreak> lines <LineBreak>```
302         Raw line          """ words
303         Raw area          """<LineBreak> lines <LineBreak>"""
304         Table             | cell1 | cell2 | cell3...
305
306
307
308   Other
309         Separator line    -----------------------...
310         Strong line       =======================...
311         Links             [label url]
312         Image             [filename.jpg]
313         Raw Text          ""words""
314         Comment           % comments
315
316
317
318       Please read the Txt2tags  User  Guide  (on  the  program  documentation
319       directory) for a detailed description of each mark.
320
321

EXAMPLES

323       Assuming  you have written a file.t2t marked file, let's have some con‐
324       verting fun.
325
326
327       Convert to HTML, saving to file.html
328              $ txt2tags -t html file.t2t
329
330
331       The same, using redirection
332              $ txt2tags -t html -o - file.t2t > file.html
333
334
335       Including Table Of Contents
336              $ txt2tags -t html --toc file.t2t
337
338
339       Including TOC and numbering titles
340              $ txt2tags -t html --toc --enum-title file.t2t
341
342
343       Contents quick view
344              $ txt2tags --toc-only file.t2t
345
346
347       Quick one-liner test from STDIN
348              $ (echo ; echo "**bold**") | txt2tags -t html -H -
349
350

MACROS

352       %%date Allows to include the current  date,  in  the  format  YYYYMMDD.
353              Optional   formatting  can  be  specified  using the %%date(for‐
354              mat-string) syntax.
355
356
357       %%infile
358              Used to get information about the source file. Optional  format‐
359              ting can be specified using the %%infile(format-string) syntax.
360
361              Useful  for  footer  link like [See source %%infile], so you can
362              change the filename and its references will be updated.
363
364
365       %%mtime
366              Gets information about the source  file  modification  time.  It
367              uses the same formatters accepted by the %%date macro.
368
369
370       %%outfile
371              Used  to get information about the converted file. Optional for‐
372              matting can be specified using the %%outfile(format-string) syn‐
373              tax.
374
375              Useful  for self mentioning like "This is the manpage.man file",
376              so you can change  the  filename  and  its  references  will  be
377              updated.
378
379
380       %%toc  The  %%toc macro specifies where the TOC of the document will be
381              placed. You can place it wherever needed  inside  the  document,
382              one or more times.
383
384              NOTE: %%toc will be expanded only with the --toc option.
385
386

AUTHOR

388       Written and maintained by Aurelio Jargas <verde@aurelio.net>
389
390
391       This  Manual  Page  was  written  by  Jose Inacio Coelho <jic@technolo‐
392       gist.com> as a text file, then converted to man format by txt2tags!
393
394
396       Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,  2007,  2008  Aurelio
397       Jargas
398
399
400       This  is free software; see the source for copying conditions. There is
401       NO warranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR
402       PURPOSE.
403
404
405
406
407
408
409                                   Jul, 2008                       TXT2TAGS(1)
Impressum