]>
git.proxmox.com Git - mirror_ovs.git/blob - build-aux/dist-docs
6 if test ! -d "$1" ||
test $# != 1; then
8 $0: HTML documentation generator for Open vSwitch
11 The VERSION environment variable should be set to the Open vSwitch version.
12 Must be invoked from an Open vSwitch build directory.
13 Most conveniently invoked via "make dist-docs".
22 # Check for programs we'll need.
28 if test -x "$dir/$1"; then
33 echo >&2 "$0: $1 not found in \$PATH, please install and try again"
39 # Create dist-docs directory.
41 abs_distdir
=`pwd`/dist-docs
46 ${MAKE-make} install-man mandir
="$abs_distdir"/man
47 (cd $distdir && mv `find man -type f` .
&& rm -rf man
)
48 manpages
=`cd $distdir && echo *`
50 # Start writing index.html.
51 exec 3>$distdir/index.html
54 <meta charset="UTF-8"></head>
55 <link rel="stylesheet" type="text/css" href="style.css">
56 <title>Open vSwitch $VERSION Documentation</title>
58 <h1>Open vSwitch $VERSION Manpages</h1>
62 # Add manpages to index.html, translating them into PDF, HTML, and plain text.
63 # The HTML is just slightly marked up from the plain text version; although
64 # groff supports better HTML output, on my system some of the OVS manpages
65 # cause the groff HTML output engine to segfault (!).
67 for manpage
in $manpages; do
68 man
-l -Tps $manpage | ps2pdf
- > $manpage.pdf
69 GROFF_NO_SGR
=1 man
-l -Tutf8 $manpage |
sed 's/.\b//g' > $manpage.txt
70 (echo '<html><head><meta charset="UTF-8"></head><body><pre>'
71 GROFF_NO_SGR
=1 man
-l -Tutf8 $manpage |
sed '
75 s,\(.\)\b\1,<b>\1</b>,g
76 s,_\b\(.\),<u>\1</u>,g'
77 echo '</pre></body></html>'
80 name
=`echo $manpage | sed 's/\.\([0-9]\)$/(\1)/'`
81 echo " <tr><td>$name</td><td><a href=\"$manpage.pdf\">PDF</a>, <a href=\"$manpage.html\">HTML</a>, <a href=\"$manpage.txt\">plain text</a></td></tr>"
89 # Create CSS style file.
90 cat >$distdir/style.css
<<'EOF'
91 div { vertical-align:top; }
93 vertical-align:baseline;
96 text-decoration: none;
110 font-family: Arial,Helvetica,sans-serif;
114 background-color:#f5f5f5;