Joseph K. Myers

Tuesday, November 4, 2003

thtml

This is released, but was sitting there for a long time.

It is a pure plain text formatter.

Indented text on one line is considered a paragraph, so pre-formatted text will not properly work as input. Non-indented text is considered a heading, unless it is in a specifically unformatted section.

You may specify sections in text. Generic levels are begun by

---

with an implicit identifier ':'

--- :

Unformatted sections have an identifier '$'

--- $

All sections are ended with two hyphens:

--

For the purposes of HTML id attributes, a name and number may be added to a section, such as:

--- $ source 1

This will presumably be identified in HTML as id="source-1"

Additionally supported is superscript, A25, Bx, and subscript KSP, N0 (see sups.txt).

It is easy to embed thtml into template-makers to transform a large number of documents into an HTML framework, such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "DTD/xhtml1-transitional.dtd">
<html><head>
<title><!--#perl getenv('title'); --></title>
<link rel="stylesheet" href="html.css" />
</head><body>

<!--#perl {
        local $/;
        my $name = getenv('name');
        `thtml < $name.txt`;
} -->

</body></html>

This example uses ptl (see ptl.txt).

getenv('title') is specific to the example implementation, using make.pl and UAR UDB database sources. In a real situation, any technique could be used for embedding data and using thtml.