From 5c9e8a65fe89e5e6baca8651000885d8467356ff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 31 Dec 2010 11:11:02 +0000 Subject: [PATCH] podwrapper: Fix up the HTML output so most inter-page links work. --- podwrapper.sh.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/podwrapper.sh.in b/podwrapper.sh.in index bd71005..c766054 100755 --- a/podwrapper.sh.in +++ b/podwrapper.sh.in @@ -182,4 +182,23 @@ if [ -n "$html_output" ]; then --css "pod.css" --htmldir "$abs_top_builddir/html" \ < $tmpdir/full.pod > "$html_output".tmp mv "$html_output".tmp "$html_output" + + # Fix up some of the mess in the HTML output, mainly to make links + # between man pages work properly. + + # Rewrite manpage(n) to manpage(n) if + # there is a linkable manual page. + sed_cmd="sed" + for f in $(cd "$abs_top_builddir/html" && ls -1 *.html); do + b=$(basename $f .html) + m=$(echo $b | sed 's/\(.*\)\.\([1-9]\)$/\1(\2)/') + sed_cmd="$sed_cmd -e 's,$m,$m,g'" + done + echo $sed_cmd + eval $sed_cmd < "$html_output" > "$html_output".tmp + mv "$html_output".tmp "$html_output" + + # Fix links like L + sed 's,guestfs-\1(\([1-9]\)),guestfs-\1(\2),g' < "$html_output" > "$html_output".tmp + mv "$html_output".tmp "$html_output" fi -- 1.8.3.1