1
0
Fork 0

Resolved multi-page manual webdoc hyperlink path issues

website
Mike Gerwitz 2012-05-08 19:06:24 -04:00
parent d31fed33c0
commit 55648e35a6
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 8 additions and 5 deletions

View File

@ -61,6 +61,12 @@ webify()
root="$2"
tmp="$1.tmp"
# if necessary, rewrite links to point to the proper directory (we do not use
# absolute paths, as that is not friendly to viewing the documentation on a
# filesystem)
shref='sed \"s#href=\\\"\\([^\\\"]\\+\\)\\\"#href=\\\"'"$root"'\\1\\\"#g\"'
shref="$shref | sed 's#//\\\"#\\\"#g'"
echo "Styling $path..."
# We do not use -i here because we have some piping to do. We also use a $root
@ -75,14 +81,11 @@ webify()
| awk '
/<body>/ {
print "<body class=\"man\">";
system( " \
awk \"/body/{i=1;next;} i\" includes/header.html \
| sed \"s#href=\\\"\\([^\\\"]\\+\\)\\\"#href=\\\"'$root'\\1\\\"#g\"\
" );
system( "awk \"/body/{i=1;next;} i\" includes/header.html | '"$shref"'" );
next
}
/<\/body>/ {
system( "cat includes/footer.html" );
system( "cat includes/footer.html | '"$shref"'" );
exit
}
{ print }