]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
docs: Fix links in html generation of man pages
authorAnthony PERARD <anthony.perard@citrix.com>
Tue, 15 Jan 2019 15:48:37 +0000 (15:48 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 15 Jan 2019 17:25:40 +0000 (17:25 +0000)
Currently, all links to other man pages are sent to
http://man.he.net/man$mansection/$manpage, but that site doesn't have
Xen man pages, so all links to other Xen man pages are broken.

In order to fix that, this is going to be a bit complex.

First, we need to teach pod2html on where other .pod files can be found,
otherwise it isn't going make any links to our pages. This is done with
--podpath.

Second, pod2html doesn't actually understand our format
"$manpage.$mansection.pod". But instead of teaching it (which is
probably impossible) we are going to modify our .pod files in order to
tell pod2html which file to look for. This is done with the sed command
by transforming for example: "L<xl.conf(5)>" to "L<xl.conf(5)|xl.conf.5>".

Last but not least, in order to have relative links to the other
generated man page, we are going against the rules, we are going to use
"--htmlroot=." so that pod2html doesn't prepand "/" to all "relative"
links. We are also going to `cd` into the "man" dir and set podpath to
"." so that pod2html is going to generate relative links to other pod
file in the form "./$man" insteadof "man/$man" or "../$man" with other
compination of options. The result of --podpath + --podroot can be check
in pod2html's cache file "pod2html.tmp".

All of this is going to generate links in the form "./$html_manpage".

But all of this doesn't work for xen-vbd-interface(7), because it's not
a pod file... maybe we could generate pod2html's cache (pod2html.tmp)
file to add en entry.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
docs/Makefile

index 013fa8eede12d70e6d3351222688b93d3b99d21c..cbc61e3f1d25c88adc44ebf43e09fc42e720fd71 100644 (file)
@@ -96,7 +96,8 @@ endif
 html/man/%.$(1).html: man/%.$(1).pod Makefile
 ifneq ($(POD2HTML),)
        @$(INSTALL_DIR) $$(@D)
-       $(POD2HTML) --infile=$$< --outfile=$$@
+       sed -r -e 's%L<([^>]+)\(([1-9])\)>%L<\1(\2)|\1.\2>%g' $$< | \
+               (cd man; $(POD2HTML) --podpath=. --htmlroot=. --outfile=../$$@)
 else
        @echo "pod2html not installed; skipping $$@"
 endif