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