shithub: tcp80

Download patch

ref: 5d5e1b7ad6a3a53ea6cc4cd86a4e231cf2b88cfb
parent: 12530f4c386dc481ebe76db1f0733ba6df37cc13
author: grobe0ba <grobe0ba@tcp80.org>
date: Mon Aug 1 16:10:12 EDT 2022

better-ish documentation

diff: cannot open b/doctools//null: file does not exist: 'b/doctools//null'
--- /dev/null
+++ b/README
@@ -1,0 +1,1 @@
+SEE README.html
--- /dev/null
+++ b/README.html
@@ -1,0 +1,201 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>tcp80 README</title>
+</head>
+<body>
+<style type="text/css">body{width: 50rem; max-width: 96%; margin: 0 auto;}pre{border: 1px solid;}</style>
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="margin-top: 0; margin-bottom: 0.50in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<header><h1><span style="font-size: 12pt"><b>tcp80 README
+</b></span></h1><span style="font-size: 12pt"><b></b></span><span style="font-size: 10pt"><b></b></span><span style="font-size: 10pt"></span></header></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<header><span style="font-size: 10pt"><b>What is tcp80?
+</b></span><span style="font-size: 10pt"></span></header><span style="font-size: 10pt">tcp80 is an HTTP daemon originally written by cinap_lenrek, and then forked
+by several people, to include kvik, phil9, and myself. This fork is a
+combination of kvik and phil9&rsquo;s ports, which includes phil9&rsquo;s integration of
+execfs, and a functional MIME type system to send the correct Content-Type
+headers that modern browsers insist upon.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">Other features in this fork include the ability to redirect error pages so
+can use your own, usually generated dynamically using the built-in execfs,
+and the ability to serve different content based on the Host header sent by
+the client.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">This server is also entirely capable of running
+<a href="https://shithub.us/garden/shithub">shithub</a> using the built-in execfs.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">Running a basic tcp80 setup is very simple, and requires only one file, and
+one directory.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">First, you must ensure
+</span><span style="font-size: 10pt"><tt>/usr/web</tt></span><span style="font-size: 10pt">
+exists, and world readable/executable. Once this requirement is met, you need
+only create the world readable/executable file
+</span><span style="font-size: 10pt"><tt>/rc/bin/service/tcp80</tt></span><span style="font-size: 10pt">
+with contents:
+<pre><code>#!/bin/rc
+exec /bin/tcp80
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">This is sufficient for serving static files, and uses none of the advanced
+features available.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h2><span style="font-size: 10pt"><b>Advanced Features
+</b></span><span style="font-size: 10pt"></span></h2><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h3><span style="font-size: 10pt"><b>Serving different static content based on request hostname
+</b></span><span style="font-size: 10pt"></span></h3><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">This feature requires a configuration file containing mappings, the format of
+which is quite simple.
+Each line contains a regex to match the hostname against, followed by at least
+one tab, and a path from which to serve files, as in the following example:
+<pre>server1.domain.org          /usr/webroot/server1
+aardvark.different.org      /usr/webroot/aardvark
+</pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">Once you have your configuration stored, you must change your
+</span><span style="font-size: 10pt"><tt>/rc/bin/service/tcp80</tt></span><span style="font-size: 10pt">
+script. If you use captures in the regular expression, they can be used in the
+pathname section.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt"><pre><code>#!/bin/rc
+exec /bin/tcp80 -h /sys/lib/hostrules
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">This currently does not affect the execution of execfs rules, which exist in a
+single "namespace", however the configuration will likely be expanded to support
+the use of different execfs rules for each hostname.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h3><span style="font-size: 10pt"><b>Error Page Redirection
+</b></span><span style="font-size: 10pt"></span></h3><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">It is possible to produce custom error pages. The normal action when tcp80
+encounters a situation requiring an error response, such as a 404 Not Found,
+it produces a very simple HTML snippet. This feature allows you to replace this
+functionality, however, it does so in a non-standard way.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">Instead of allowing for the direct replacement of this snippet, it issues a
+</span><span style="font-size: 10pt"><tt>301 Moved Permanently</tt></span><span style="font-size: 10pt">
+response. This redirects the browser to a URL containing the error code and the
+location that generated it. For example, if you were to access
+</span><span style="font-size: 10pt"><tt>http://server.domain.com/nonexistent.html</tt></span><span style="font-size: 10pt">
+tcp80 would redirect the client to
+</span><span style="font-size: 10pt"><tt>http://server.domain.com/404/nonexistent.html</tt></span><span style="font-size: 10pt">
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">To use this feature, you pass multiple
+</span><span style="font-size: 10pt"><tt>-e</tt></span><span style="font-size: 10pt">
+options to tcp80 in your
+</span><span style="font-size: 10pt"><tt>/rc/bin/service/tcp80</tt></span><span style="font-size: 10pt">
+script.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt"><pre><code>#!/bin/rc
+exec /bin/tcp80 -e 404 -e 403
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h3><span style="font-size: 10pt"><b>Integrated execfs
+</b></span><span style="font-size: 10pt"></span></h3><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">The integrated execfs functionality is the most advanced and powerful feature
+available in tcp80. Used correctly, it can provide a powerful tool for dynamic
+websites. Used incorrectly, it can destroy your server, open security holes,
+and probably set your house on fire while you&rsquo;re trying to fix the security.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">execfs uses the same configuration format as documented above, consiting of a
+regex to match the pathname (instead of hostname) against, at least one tab,
+and a script to run. If the regular expression contains captures, they can be
+used in the script section as arguments. See the shithub
+<a href="https://shithub.us/garden/shithub/HEAD/gitrules/f.html">gitrules</a> file for an example.
+</span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h2><span style="font-size: 10pt"><b>An Example Configuration (for shithub)
+</b></span><span style="font-size: 10pt"></span></h2><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt"><pre><code>/rc/bin/service/tcp80:
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
+&lt;[3]/srv/clone{
+    d=&lsquo;{&lt;[0=3]read}
+    bind /srv/$d /srv
+    &lt;[3=0]{
+        bind /usr/web /mnt/static
+        exec /bin/tcp80 -r /sys/lib/tcp80 &gt;&gt;[2]/sys/log/httpd/log
+    }
+}
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt"><pre><code>/rc/bin/service/tcp443:
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
+&lt;[3]/srv/clone{
+    d=&lsquo;{&lt;[0=3]read}
+    bind /srv/$d /srv
+    &lt;[3=0]{
+        bind /usr/web /mnt/static
+        exec /bin/tlssrv -c/sys/lib/tls/cert.pem -lhttpd -r&lsquo;{cat $3/remote} /bin/tcp80 \
+                -r /sys/lib/tcp80 &gt;&gt;[2]/sys/log/httpd/log
+    }
+}
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt"><pre><code>/lib/namespace.httpd:
+bind /mnt/static /usr/web/static
+</code></pre></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="margin-top: 0; margin-bottom: 0.17in"></p>
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<h2><span style="font-size: 10pt"><b>Contact Information
+</b></span><span style="font-size: 10pt"></span></h2><span style="font-size: 10pt"></span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">If you find a bug, or have a patch, please feel free to send email to
+<a href="mailto:grobe0ba@tcp80.org">grobe0ba@tcp80.org</a> </span></p><p style="margin-top: 0; margin-bottom: 0.17in"></p>
+
+<p style="line-height: 1.2em; text-indent: 0.00in; margin-top: 0; margin-bottom: 0; text-align: justify;">
+<span style="font-size: 10pt">For all other inquiries, I can be found in gridchat, or grobe0ba in
+#cat-v on OFTC.
+</span></p><p style="margin-top: 0; margin-bottom: 0.50in"></p>
+</body>
+</html>
+
--- a/README.md
+++ /dev/null
@@ -1,69 +1,0 @@
-# To run the shithub software:
-
-`/rc/bin/service/tcp80`:
-
-```
-#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/ori -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
-
-<[3]/srv/clone{
-	d=`{<[0=3]read}
-	bind /srv/$d /srv
-	# ugly, but we don't want to leak the clone fd into
-	# procs that may stick around.
-	<[3=0]{
-		bind /usr/web /mnt/static
-        exec /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
-	}
-}
-```
-
-`/rc/bin/service/tcp443`:
-
-```
-#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/ori -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
-
-<[3]/srv/clone{
-	d=`{<[0=3]read}
-	bind /srv/$d /srv
-	# ugly, but we don't want to leak the clone fd into
-	# procs that may stick around.
-	<[3=0]{
-		bind /usr/web /mnt/static
-        exec tlssrv -c/sys/lib/tls/cert.pem -lhttpd -r`{cat $3/remote} /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
-	}
-}
-```
-
-`/lib/namespace.httpd`:
-
-```
-bind /mnt/static /usr/web/static
-```
-
-It is possible to redirect error pages by passing `-e error`, like
-`tcp80 -e 404 -e 403`. This will send a `301 Moved Permanently` to
-e.g. `/404` or `/403`. It will also append the path to it:
-Attempting to access `http://server/nopage.html` would redirect to
-`http://server/404/nopage.html`.
-
-
-It is also possible to define a set of hostnames to change the bind mounts for
-`/usr/web` based on the Host header. To use this feature, you pass
-`-h file` to tcp80. The format of the file is the same as that for execfs,
-a regex for the hostname, any number of tabs, with a path to be mounted over
-`/usr/web`.
-
-```
-server1.domain.com          /usr/webroot/server1
-aardvark.different.org      /usr/webroot/aardvark
-```
-
-This does not affect execfs scripts directly, although the bind mounts happen
-prior to their execution. If you are using the same scripts for multiple
-hostnames, you can check the environment using `ns` to find out what is
-mounted over `/usr/web`. If you are using shithub, or anything similar which
-hooks on `/index.html`, it will still take precedence over any static files.
-
-You can work around this by not hooking `/index.html`, instead hook something
-like `/shithub.html` and then redirect to it.
-
--- /dev/null
+++ b/README.ms
@@ -1,0 +1,214 @@
+.br
+..
+.po 1i
+.fp 1 R LucidaSans
+.fp 2 I LucidaSansI
+.fp 3 B LucidaSansB
+.fp 4 BI LucidaSanI
+.fp 5 CW LucidaCW
+.paragraph 0
+.margin 0
+.HTML "tcp80 README
+.\".html - <link rel="stylesheet" href="index.css"/>
+.html - <style type="text/css">body{width: 50rem; max-width: 96%; margin: 0 auto;}pre{border: 1px solid;}</style>
+.SH
+.LG
+.ihtml header <header>
+.ihtml h1 <h1>
+tcp80 README
+.ihtml h1
+.NL
+.R
+.SH
+What is tcp80?
+.R
+.ihtml header
+.\".html nav <nav data-sblg-nav="1" data-sblg-navcontent="1">
+tcp80 is an HTTP daemon originally written by cinap_lenrek, and then forked
+by several people, to include kvik, phil9, and myself. This fork is a
+combination of kvik and phil9's ports, which includes phil9's integration of
+execfs, and a functional MIME type system to send the correct Content-Type
+headers that modern browsers insist upon.
+
+Other features in this fork include the ability to redirect error pages so
+can use your own, usually generated dynamically using the built-in execfs,
+and the ability to serve different content based on the Host header sent by
+the client.
+
+This server is also entirely capable of running
+.ihtml a <a href="https://shithub.us/garden/shithub">
+shithub
+.ihtml a
+using the built-in execfs.
+
+Running a basic tcp80 setup is very simple, and requires only one file, and
+one directory.
+
+First, you must ensure
+.CW /usr/web
+exists, and world readable/executable. Once this requirement is met, you need
+only create the world readable/executable file
+.CW /rc/bin/service/tcp80
+with contents:
+.ihtml pre <pre>
+.ihtml code <code>
+#!/bin/rc
+exec /bin/tcp80
+.ihtml code
+.ihtml pre
+
+This is sufficient for serving static files, and uses none of the advanced
+features available.
+
+.ihtml h2 <h2>
+.NL
+.R
+.SH
+Advanced Features
+.R
+.ihtml h2
+
+.ihtml h3 <h3>
+.NL
+.R
+.SH
+Serving different static content based on request hostname
+.R
+.ihtml h3
+
+This feature requires a configuration file containing mappings, the format of
+which is quite simple.
+Each line contains a regex to match the hostname against, followed by at least
+one tab, and a path from which to serve files, as in the following example:
+.ihtml pre <pre>
+.ithml code <code>
+server1.domain.org          /usr/webroot/server1
+aardvark.different.org      /usr/webroot/aardvark
+.ihtml code
+.ihtml pre
+
+Once you have your configuration stored, you must change your
+.CW /rc/bin/service/tcp80
+script. If you use captures in the regular expression, they can be used in the
+pathname section.
+
+.ihtml pre <pre>
+.ihtml code <code>
+#!/bin/rc
+exec /bin/tcp80 -h /sys/lib/hostrules
+.ihtml code
+.ihtml pre
+
+This currently does not affect the execution of execfs rules, which exist in a
+single "namespace", however the configuration will likely be expanded to support
+the use of different execfs rules for each hostname.
+
+.ihtml h3 <h3>
+.NL
+.R
+.SH
+Error Page Redirection
+.R
+.ihtml h3
+
+It is possible to produce custom error pages. The normal action when tcp80
+encounters a situation requiring an error response, such as a 404 Not Found,
+it produces a very simple HTML snippet. This feature allows you to replace this
+functionality, however, it does so in a non-standard way.
+
+Instead of allowing for the direct replacement of this snippet, it issues a
+.CW "301 Moved Permanently
+response. This redirects the browser to a URL containing the error code and the
+location that generated it. For example, if you were to access
+.CW http://server.domain.com/nonexistent.html
+tcp80 would redirect the client to
+.CW http://server.domain.com/404/nonexistent.html
+
+To use this feature, you pass multiple
+.CW -e
+options to tcp80 in your
+.CW /rc/bin/service/tcp80
+script.
+
+.ihtml pre <pre>
+.ihtml code <code>
+#!/bin/rc
+exec /bin/tcp80 -e 404 -e 403
+.ihtml code
+.ihtml pre
+
+.ihtml h3 <h3>
+.NL
+.R
+.SH
+Integrated execfs
+.R
+.ihtml h3
+
+The integrated execfs functionality is the most advanced and powerful feature
+available in tcp80. Used correctly, it can provide a powerful tool for dynamic
+websites. Used incorrectly, it can destroy your server, open security holes,
+and probably set your house on fire while you're trying to fix the security.
+
+execfs uses the same configuration format as documented above, consiting of a
+regex to match the pathname (instead of hostname) against, at least one tab,
+and a script to run. If the regular expression contains captures, they can be
+used in the script section as arguments. See the shithub
+.ihtml a <a href="https://shithub.us/garden/shithub/HEAD/gitrules/f.html">
+gitrules
+.ihtml a
+file for an example.
+
+.ihtml h2 <h2>
+.NL
+.R
+.SH
+An Example Configuration (for shithub)
+.R
+.ihtml h2
+
+.ihtml pre <pre>
+.ihtml code <code>
+/rc/bin/service/tcp80:
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
+<[3]/srv/clone{
+    d=`{<[0=3]read}
+    bind /srv/$d /srv
+    <[3=0]{
+        bind /usr/web /mnt/static
+        exec /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+    }
+}
+
+/rc/bin/service/tcp443:
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
+<[3]/srv/clone{
+    d=`{<[0=3]read}
+    bind /srv/$d /srv
+    <[3=0]{
+        bind /usr/web /mnt/static
+        exec /bin/tlssrv -c/sys/lib/tls/cert.pem -lhttpd -r`{cat $3/remote} /bin/tcp80 \\
+                -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+    }
+}
+
+/lib/namespace.httpd:
+bind /mnt/static /usr/web/static
+.ihtml code
+.ihtml pre
+
+.ihtml h2 <h2>
+.NL
+.R
+.SH
+Contact Information
+.R
+.ihtml h2
+
+If you find a bug, or have a patch, please feel free to send email to
+.ihtml a <a href="mailto:grobe0ba@tcp80.org">
+grobe0ba@tcp80.org
+.ihtml a
+
+For all other inquiries, I can be found in gridchat, or grobe0ba in
+#cat-v on OFTC.
--- /dev/null
+++ b/doctools/fixhtml
@@ -1,0 +1,6 @@
+#!/bin/rc
+{
+	echo ',s/\n<\/a>/<\/a> /g'
+	echo w
+	echo q
+} | sam -d $1 >[2]/dev/null
--- /dev/null
+++ b/doctools/htmlsingle
@@ -1,0 +1,8 @@
+#!/bin/sed -f
+
+/<\?xml/d;/<!DOCTYPE/,/>/d
+s/<html>//
+/<head>/,/<\/head>/d
+s/<body>//
+s/<\/body>//
+s/<\/html>//
--- /dev/null
+++ b/mkfile.doc
@@ -1,0 +1,10 @@
+HFILES=README.html
+
+all:V: $HFILES 
+
+%.html: %.ms
+    htmlroff -u -ms -mhtml $stem.ms > $stem.html
+    rc ./doctools/fixhtml $stem.html
+
+clean:V:
+    rm -f $HFILES