← Previous | ↑ Home | → Next |
dk-t2h [_options_] [_file(s)_]
The program converts text from the specified files or standard input to HTML. Alternatively you can use the -e (echo) option to convert text specified on the command line.
Option | Purpose |
---|---|
-i string ‑‑input‑encoding=string |
Expected input encoding, see the Encoding names table below. The encoding specified here is overwritten, if a BOM (byte order marker) is found at start of input. The default is the systems native encoding and endianness. |
-l --code-lines |
Wrap all lines into "<code title="001">…</code>". |
-e --echo |
Convert the command line arguments, do not treat them as file names. |
-f --full |
Produce a full HTML file, not just a fragment. Options -e and -f are mutually exclusive. |
-t string --title=string |
Title for full HTML file, ignored if the -f option is not present. |
--verbose | Show error message upon interrupt by SIGPIPE. |
When producing UTF-16 or 32 bit UNICODE output a BOM is written at start of output. You can suppress the BOM by appending "nobom" to the encoding, i.e. "-o utf-16-le,nobom".
To require a BOM you can append "bom" to the encoding, i.e. "-o utf-8,bom".
0 on success, all other status codes indicate an error.
On Windows the file name length is restricted to _MAX_PATH (260) characters if the file name contains a wildcard (* or ? character).
This program uses DK libraries version 4.
To convert a text file x.txt into a full HTML file:
dk-t2h -f -t "Page title" < x.txt > x.html
Option | Purpose |
---|---|
-f | Produce full HTML file. A complete HTML page <html><body>…</body></html> is produced. Some <link rel=…> are prepared as comments. When activating these links you should replace some placeholders by useful values manually. |
-t "Page title" | Page title for the HTML file. |
To convert a text file x.txt into a HTML segment:
dk-t2h < x.txt > x.html
To convert source code file x.c into a HTML segment:
dk-t2h -l < x.c > x.html
Option | Purpose |
---|---|
-l | Mark input as source code. Each code line is placed in a <code title="001">…</code> construct. When the user moves the mouse over a line, the line number is shown as tooltip. The entire output should be placed in a <pre>…</pre> environment. |
To convert text specified as command line arguments:
dk-t2h -e Testing german umlauts ÄÖÜäöüß
Option | Purpose |
---|---|
-e | Use input text from command line arguments instead of standard input. |
← Previous | ↑ Home | → Next |