crosslink html man pages
This is using sed --in-place, which might not be available in all sed versions. If that's a concern, then please replace with awk script or move to build-helper and use temporary files. Also the regex is a heuristic. It works for our man pages here but it might have false positive matches in the future.
This commit is contained in:
parent
e5a12803ff
commit
e6b26829f4
1 changed files with 6 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -20,6 +20,11 @@
|
||||||
|
|
||||||
A2XM=a2x -f manpage --no-xmllint -a encoding=UTF-8
|
A2XM=a2x -f manpage --no-xmllint -a encoding=UTF-8
|
||||||
A2XH=a2x -f xhtml --no-xmllint -a encoding=UTF-8
|
A2XH=a2x -f xhtml --no-xmllint -a encoding=UTF-8
|
||||||
|
# Create cross-links in html man pages
|
||||||
|
# We look for something like "cdist-type(7)" and make a href out of it
|
||||||
|
# The first matching group is the man page name and the second group
|
||||||
|
# is the man page section (1 or 7)
|
||||||
|
CROSSLINK=sed --in-place 's/\([[:alnum:]_-]*\)(\([17]\))/<a href="..\/man\2\/\1.html">&<\/a>/'
|
||||||
helper=./bin/build-helper
|
helper=./bin/build-helper
|
||||||
|
|
||||||
MANDIR=docs/man
|
MANDIR=docs/man
|
||||||
|
@ -86,6 +91,7 @@ MANSTATICALL=$(MANSTATICMAN) $(MANSTATICHTML)
|
||||||
# Creating the type html page
|
# Creating the type html page
|
||||||
%.html: %.text
|
%.html: %.text
|
||||||
$(A2XH) $^
|
$(A2XH) $^
|
||||||
|
$(CROSSLINK) $^
|
||||||
|
|
||||||
man: $(MANTYPEALL) $(MANREFALL) $(MANSTATICALL)
|
man: $(MANTYPEALL) $(MANREFALL) $(MANSTATICALL)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue