aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--mht.1119
2 files changed, 120 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 88c43e9..a8335d5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,3 @@
install:
install hwrap mht /usr/local/bin/
+ install -m 644 mht.1 /usr/share/man/man1/
diff --git a/mht.1 b/mht.1
new file mode 100644
index 0000000..5f8157b
--- /dev/null
+++ b/mht.1
@@ -0,0 +1,119 @@
+.Dd $Mdocdate$
+.Dt mht 1
+.Os
+.
+.Sh NAME
+.Nm mht
+.Nd troff for HTML
+.
+.Sh SYNOPSIS
+.Nm
+.Op Ar file
+.
+.Sh DESCIPTION
+.Pp
+.Nm
+is a utility that generates HTML from
+.Xr troff 1
+source code.
+.Pp
+While
+.Nm
+is named like a troff macro package and uses troff syntax, it is a standalone utility that does not use troff itself.
+As such, it supports only a subset of the standard troff requests.
+.
+.Sh USAGE
+.Pp
+This section describes the various types of requests supported by
+.Nm .
+On the left side are the name and arity of each request, separated by a slash.
+On the right side is the HTML expansion of each request.
+.Pp
+In the HTML expansion of all element requests, a backslash and a dollar sign followed by a number (e.g. \\$1) signify a parameter expansion.
+.Pp
+In block element requests, a percent sign (%) signifies the lines following the request until the next block element request.
+.Pp
+Finally, in contiguous element requests, whatever text is on the outside of the area delimited by braces ({...}) is removed when two of the same contiguous element requests are placed next to one another.
+.Ss Standard troff requests
+.Bl -tag
+.It Sy \&br/0
+<br>
+.El
+.Ss Contiguous element requests
+.Bl -tag
+.It Sy \&Qp/0
+<blockquote>{<p>%</p>}</blockquote>
+.El
+.Ss Block element requests
+.Bl -tag
+.It Sy \&Pp/0
+<p>%</p>
+.It Sy \&Pr/0
+<pre>%</pre>
+.It Sy \&Sh/0
+<h3>%</h3>
+.It Sy \&Sh/1
+<h\\$1>%</h\\$1>
+.It Sy \&Ti/0
+<title>%</title>
+.Ss Inline element requests
+.Bl -tag
+.It Sy \&Au/1
+<meta name="author" content="\\$1"/>
+.It Sy \&Bd/1
+<b>\\$1</b>
+.It Sy \&Bd/2
+<b>\\$1</b>\\$2
+.It Sy \&Bd/3
+\\$3<b>\\$1</b>\\$2
+.It Sy \&br/0
+<br/>
+.It Sy \&Cd/1
+<code>\\$1</code>
+.It Sy \&Cd/2
+<code>\\$1</code>\\$2
+.It Sy \&Cd/3
+\\$3<code>\\$1</code>\\$2
+.It Sy \&Cs/1
+<meta http-equiv="Content-Type" content="text/html; charset=\\$1"/>
+.It Sy \&Em/1
+<em>\\$1</em>
+.It Sy \&Em/2
+<em>\\$1</em>\\$2
+.It Sy \&Em/3
+\\$3<em>\\$1</em>\\$2
+.It Sy \&Hy/2
+<a href="\\$2">\\$1</a>
+.It Sy \&Im/2
+<img src="\\$1" alt="\\$2"/>
+.It Sy \&It/1
+<i>\\$1</i>
+.It Sy \&It/2
+<i>\\$1</i>\\$2
+.It Sy \&It/3
+\\$3<i>\\$1</i>\\$2
+.It Sy \&St/1
+<strong>\\$1</strong>
+.It Sy \&St/2
+<strong>\\$1</strong>\\$2
+.It Sy \&St/3
+\\$3<strong>\\$1</strong>\\$2
+.It Sy \&Tt/1
+<tt>\\$1</tt>
+.It Sy \&Tt/2
+<tt>\\$1</tt>\\$2
+.It Sy \&Tt/3
+\\$3<tt>\\$1</tt>\\$2
+.It Sy \&Ul/1
+<u>\\$1</u>
+.It Sy \&Ul/2
+<u>\\$1</u>\\$2
+.It Sy \&Ul/3
+\\$3<u>\\$1</u>\\$2
+.El
+.
+.Sh AUTHORS
+.Pp
+.Nm
+is written by John Ankarström
+.Aq Mt john (at) ankarstrom.se .