/doc/English/manpage.t2t

http://txt2tags.googlecode.com/ · Unknown · 409 lines · 276 code · 133 blank · 0 comment · 0 complexity · fd3f61cecc18fe517d67d54581b7b927 MD5 · raw file

  1. TXT2TAGS
  2. Aug, 2010
  3. %!target: man
  4. %!encoding: UTF-8
  5. %!postproc(man): ' \(#\w+\)' ''
  6. %!options(html): --mask-email --toc
  7. %!postproc(html): <HEAD> '<HEAD>\n<STYLE>body{margin:3em;} pre{background:#ffc;}</STYLE>'
  8. %% LOG
  9. %% sep 2003 jic : creation
  10. %% 25 sep 2003 anamim : text revision. misspellings, rewording phrases, etc
  11. %% 01 jun 2004 aurelio: updated to v2.0
  12. %% 20 jul 2004 jic : included: settings area, few marks, areas; reorganizing
  13. %% 22 jul 2004 anamim : revision
  14. %% 30 ago 2004 aurelio: little typos
  15. %% 13 nov 2004 jic : updated to v2.1
  16. %% 28 dec 2004 aurelio: updated to v2.2
  17. %% 21 may 2005 aurelio: updated to v2.3
  18. %% 12 aug 2010 aurelio: updated to v2.6, rewrite (r250)
  19. = NAME =[name]
  20. txt2tags - text formatting and conversion tool
  21. = SYNOPSIS =[synopsis]
  22. **txt2tags** [//options//] [//FILE//...]
  23. = DESCRIPTION =[description]
  24. **txt2tags** reads a text file with minimal markup and convert it to:
  25. //ASCII Art//,
  26. //AsciiDoc//,
  27. //Creole//,
  28. //DocBook//,
  29. //DokuWiki//,
  30. //Google Code Wiki//,
  31. //HTML//,
  32. //LaTeX//,
  33. //Lout//,
  34. //MagicPoint//,
  35. //Man page//,
  36. //MoinMoin//,
  37. //PageMaker//,
  38. //Plain Text//,
  39. //PmWiki//,
  40. //SGML//,
  41. //Wikipedia// and
  42. //XHTML//.
  43. % TRANSLATOR: please keep the alphabetical order of this list.
  44. This man page was created by **txt2tags** from a simple text file. The same text file is also converted to HTML for the online version of this manual.
  45. ONE source, MULTI targets - http://txt2tags.org
  46. = MARKUP =[markup]
  47. ```
  48. Headers First 3 lines of the source file
  49. Title = words =
  50. Numbered title + words +
  51. Comment % comments
  52. Separator line -----------------------...
  53. Strong line =======================...
  54. Image [filename.jpg]
  55. Link [label url]
  56. Bold **words**
  57. Italic //words//
  58. Underline __words__
  59. Strike --words--
  60. Monospaced ``words``
  61. Raw ""words""
  62. Tagged ''words''
  63. Paragraph words
  64. Quote <TAB>words
  65. List - words
  66. Numbered list + words
  67. Definition list : words
  68. Table | cell1 | cell2 | cell3...
  69. Verbatim line ``` words
  70. Raw line """ words
  71. Tagged line ''' words
  72. Verbatim block ```
  73. lines
  74. ```
  75. Raw block """
  76. lines
  77. """
  78. Tagged block '''
  79. lines
  80. '''
  81. ```
  82. = OPTIONS =[options]
  83. : **--art-chars**=//PATTERN//
  84. Define //PATTERN// 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.
  85. : **-C**, **--config-file**=//FILE//
  86. Read configuration from the external file //FILE//. The configuration must be on the //%!keyword:value// format. See [SETTINGS #settings] section for details.
  87. : **--css-sugar**
  88. 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: //#header//, //#body//, //.toc//.
  89. : **--css-inside**
  90. Insert CSS file contents inside HTML/XHTML headers. Use ``--style`` to specify a CSS file to be read.
  91. : **--dump-config**
  92. Print all the configuration found and exit.
  93. : **--dump-source**
  94. Print the document source, with includes (``%!include``) expanded.
  95. : **--encoding**=//CODE//
  96. 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.
  97. : **--gui**
  98. Invoke Graphical Tk Interface.
  99. : **-h**, **--help**
  100. Print help information and exit.
  101. : **-H**, **--no-headers**
  102. Suppress header and footer from the output. Only the contents (body) will be shown.
  103. : **--headers**
  104. Show header and footer in the output. Default is ON.
  105. : **--height**=//NUM//
  106. Set the output's height to //NUM// rows. This option is only used by the ASCII Art target, when also using ``--slides``.
  107. : **-i**, **--infile**=//FILE//
  108. Set //FILE// as the input file name, the source document. Use '-' to read the sources from the STDIN.
  109. : **--mask-email**
  110. Hide emails from spam robots. Removes @ and dots. The address ""foo@bar.com"" turns to <foo (a) bar com>.
  111. : **-n**, **--enum-title**
  112. Turn on automatic numbering for titles. They will be prefixed by 1, 1.1, 1.1.1, ...
  113. : **--no-dump-config**
  114. Cancel the ``--dump-config`` action.
  115. : **--no-dump-source**
  116. Cancel the ``--dump-source`` action.
  117. : **--no-encoding**
  118. Clear the encoding setting.
  119. : **--no-enum-title**
  120. Turn off the automatic numbering for titles.
  121. : **--no-infile**
  122. Clear all the previous infile declarations.
  123. : **--no-targets**
  124. Cancel the ``--targets`` action.
  125. : **--no-mask-email**
  126. Turn off the email masking feature.
  127. : **--no-outfile**
  128. Clear the previous outfile declaration.
  129. : **--no-quiet**
  130. Show messages, turning off the ``--quiet`` option.
  131. : **--no-rc**
  132. Do not read the user configuration file ~/.txt2tagsrc.
  133. : **--no-slides**
  134. Turn off the slides feature.
  135. : **--no-style**
  136. Clear all the style settings.
  137. : **--no-toc**
  138. Remove the Table of Contents from the output.
  139. : **--no-toc-only**
  140. Turn off the ``--toc-only`` action.
  141. : **-o**, **--outfile**=//FILE//
  142. Set //FILE// as the output file name. Use '-' to send the results to STDOUT.
  143. : **-q**, **--quiet**
  144. Quiet mode. Suppress all output, except errors.
  145. : **--rc**
  146. Read the user configuration file ~/.txt2tagsrc. Default is ON.
  147. : **--slides**
  148. Format output as presentation slides. This option is only used by the ASCII Art target.
  149. : **--style**=//FILE//
  150. Use //FILE// 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.
  151. : **-t**, **--target**=//TYPE//
  152. Set the output document format to //TYPE//. Some popular types are: //html//, //xhtml//, //tex//, //man//, //txt//. Use the ``--targets`` option to see all the available formats.
  153. : **--targets**
  154. Print a list of all the available targets and exit.
  155. : **--toc**
  156. 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 ``%%TOC`` macro.
  157. : **--toc-level**=//NUM//
  158. Set the maximum TOC level to //NUM//. All titles deeper than //NUM// will not be included in the Table of Contents.
  159. : **--toc-only**
  160. Print the Table of Contents and exit.
  161. : **-v**, **--verbose**
  162. Print informative messages during conversion. This option can be used multiple times to increase the number of messages shown.
  163. : **-V**, **--version**
  164. Print program version and exit.
  165. : **--width**=//NUM//
  166. Set the output's width to //NUM// columns. This option is only used by the ASCII Art target.
  167. :
  168. = SOURCE FILES =[source]
  169. The source files are usually identified by the //.t2t// extension (such as ``myfile.t2t``). You may have three areas inside your sources:
  170. : **Header** (optional)
  171. 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.
  172. : **Settings** (optional)
  173. Begins right after the Header (4th or 2nd line) and ends when the Body area starts.
  174. Used for settings (configurations) in the ``%!keyword:value`` format.
  175. : **Body**
  176. 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.
  177. :
  178. = SETTINGS =[settings]
  179. Settings let you customize **txt2tags**, they're similar to options. They can be used at: source document's Settings area, ``~/.txt2tagsrc`` file, external file called with ``--config-file``.
  180. : **%!target**
  181. Set the output format, just like ``--target``. Example:
  182. ``` %!target: html
  183. : **%!options(target)**
  184. Set the default options to each target. You must use the command line options. Example:
  185. ``` %!options(html): --toc --toc-level 3 --css-sugar
  186. : **%!includeconf**
  187. Include configurations from an external file into the current, just like ``--config-file``. Example:
  188. ``` %!includeconf: myconfig.t2t
  189. : **%!style**
  190. Set a style file for the document, just like ``--style``. Can be used multiple times. Example:
  191. ``` %!style: colors.css
  192. : **%!encoding**
  193. Set the character set used by the document, just like ``--encoding``. Example:
  194. ``` %!encoding: UTF-8
  195. : **%!preproc**
  196. Input search/replace filter used to change the Body of the source document BEFORE any parsing by txt2tags. Search uses Python regular expressions. Example:
  197. ``` %!preproc: "JJS" "John J. Smith"
  198. : **%!postproc**
  199. Output search/replace filter used to change the generated document AFTER all the txt2tags processing. Search uses Python regular expressions. Example:
  200. ``` %!postproc(html): "<B>" "<STRONG>"
  201. :
  202. 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: ``~/.txt2tagsrc``, source document's Config area, ``--config-file`` option.
  203. = COMMANDS =[commands]
  204. Commands perform tasks during conversion time. They must be placed at the source document's Body.
  205. : **%!csv: file.csv**
  206. Includes an external CSV file as a table.
  207. : **%!include: file.t2t**
  208. Includes a txt2tags file in the document.
  209. : **%!include: ""``file.txt``""**
  210. Includes a text file (verbatim) in the document.
  211. : **%!include: ""''file.html''""**
  212. Includes an already tagged file in the document.
  213. :
  214. = MACROS =[macros]
  215. Macros are handy shortcuts to insert dynamic contents in your document. They must be placed at the source document's Body. Most macros can be customized with special directives, like ``%Y`` and ``%f``. See the txt2tags User Guide for details.
  216. : **""%%date""**
  217. Insert the current date. The default format is ``%%date(%Y%m%d)``, which gives YYYYMMDD.
  218. : **""%%infile""**
  219. Insert the source file path. The default format is ``%%infile(%f)``. Useful for footer links like ``[See source %%infile]``.
  220. : **""%%mtime""**
  221. Insert the source file modification time. The default format is ``%%date(%Y%m%d)``, which gives YYYYMMDD.
  222. : **""%%outfile""**
  223. Insert the output file path. The default format is ``%%outfile(%f)``. Useful for self mentioning like "This is the %%outfile file".
  224. : **""%%toc""**
  225. Specifies where the Table of Contents will be placed. You can even use it multiple times. Note that you must also use the ``--toc`` option.
  226. : **""%%appurl""**
  227. Insert the txt2tags URL: %%appurl.
  228. : **""%%appname""**
  229. Insert the %%appname name.
  230. : **""%%appversion""**
  231. Insert the current version number of txt2tags (currently %%appversion).
  232. : **""%%target""**
  233. Insert the target name being processed.
  234. : **""%%encoding""**
  235. Insert the encoding name choosen.
  236. : **""%%cmdline""**
  237. Insert the command line used to generate the target document.
  238. : **""%%header1""**, **""%%header2""**, **""%%header3""**,
  239. Insert the headers.
  240. :
  241. = EXAMPLES =[examples]
  242. : ``txt2tags -t html file.t2t``
  243. Convert to HTML, saving to file.html.
  244. : ``txt2tags -t html -o - file.t2t``
  245. Convert to HTML, sending results to STDOUT.
  246. : ``txt2tags -t html --toc file.t2t``
  247. Convert to HTML, including automatic Table Of Contents.
  248. : ``txt2tags -t html --toc --toc-level 2 -n file.t2t``
  249. Convert to HTML, with a two level Table of Contents and numbered titles.
  250. : ``txt2tags --toc-only file.t2t``
  251. Just show the Table of Contents, no conversion is done.
  252. : ``txt2tags -t html --css-sugar --style base.css --style ui.css file.t2t``
  253. Convert to HTML, preparing the resulting code to be used with CSS, and also include calls to two external CSS files.
  254. : ``txt2tags -t art --slides --width 80 --height 25 -o - file.t2t | more``
  255. Create ASCII Art presentation slides, ready to be shown in a 80x25 terminal screen/window.
  256. : ``(echo ; echo "**bold**") | txt2tags -t html -H -``
  257. Handy one-liner for quick tests using STDIN.
  258. : ``txt2tags -t html -o - file.t2t | tidy > file.html``
  259. Send results to STDOUT, then fine tune the code with an external program before saving the output file.
  260. :
  261. = FILES =[files]
  262. : ~/.txt2tagsrc
  263. Default user configuration file.
  264. :
  265. = ENVIRONMENT =[environment]
  266. : T2TCONFIG
  267. If non-null, sets the full pathname for the default user configuration file.
  268. :
  269. = AUTHOR =[author]
  270. Aurelio Jargas <verde@aurelio.net>
  271. %% TRANSLATOR: Activate the following line and add your language, name and email/site.
  272. % Man page translated to LANGUAGE by YOUR NAME <YOUR EMAIL OR WEBSITE>.
  273. = BUGS =[bugs]
  274. http://bugs.txt2tags.org
  275. = COPYRIGHT =[copyright]
  276. Copyright (C) 2001-%%date(%Y) Aurelio Jargas, GNU GPL v2