README
1Scripts and tools to format embedded manual pages, or to format C
2source code files. Each has an embedded man page in the source.
3
4ccformat c code formatter
5 usage: ccformat (copy stdin to stdout)
6 usage: ccformat files... (format files in place)
7
8enter set project-specific environment
9 usage: enter project-name
10
11mansect extract manual page section from source file
12 usage: mansect file.suffix
13 usage: mansect -type file
14
15srctoman extract man page from source file
16 usage: srctoman file.suffix
17 usage: srctoman -type file
18
19man2html quick script to htmlize nroff -man output
20
21postlink quick script to hyperlink HTML text
22
23See the proto/README file for the following tools that generate
24HTML and ASCII forms of README documents and of some manual pages.
25
26fixman quick hack to patch postconf.proto text into C sorce
27
28makereadme create README_FILES table of contents (AAAREADME)
29
30html2readme convert HTML to README file
31
32postconf2html postconf.proto -> postconf.5.html
33
34postconf2man postconf.proto -> postconf.5 (nroff input)
35
36xpostconf extract selected sections from postconf.proto
37
38xpostdef re-compute the defaults in postconf.proto
39
readme2html
1#!/bin/sh
2
3# Crude script to convert plain READMEs to HTML
4
5echo '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
6 "http://www.w3.org/TR/html4/loose.dtd">
7
8<html>
9
10<head>
11
12<title>Title Here</title>
13
14<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
15
16</head>
17
18<body>
19
20<h1>Title Here</h1>'
21
22sed '
23 s/&/\&/g
24 s/</\</g
25 s/>/\>/g
26' "$@" | awk '
27/^====+$/ { print "<h2>" line "</h2>"; line = ""; getline; next }
28NF == 0 { print line; print $0; print "<p>"; line = $0; next }
29 { print line; line = $0 }
30END { print line }
31'
32
33echo '
34</body>
35
36</html>'
37