/doc/English/manpage.html
http://txt2tags.googlecode.com/ · HTML · 456 lines · 400 code · 54 blank · 2 comment · 0 complexity · 113e4709f1869182e248d7171a821957 MD5 · raw file
- <!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">
- <TITLE>TXT2TAGS</TITLE>
- </HEAD><BODY BGCOLOR="white" TEXT="black">
- <CENTER>
- <H1>TXT2TAGS</H1>
- <FONT SIZE="4">Aug, 2010</FONT>
- </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 foo@bar.com 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-2010 Aurelio Jargas, GNU GPL v2
- </P>
- <!-- html code generated by txt2tags 2.6.492 (http://txt2tags.org) -->
- <!-- cmdline: txt2tags -t html doc/English/manpage.t2t -->
- </BODY></HTML>