From e6b26829f4cb9a6fc887eb7d0614dc0e3fb9f248 Mon Sep 17 00:00:00 2001 From: Tomas Pospisek Date: Wed, 30 Apr 2014 16:38:40 +0200 Subject: [PATCH] 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. --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 9502c989..82a774a5 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,11 @@ A2XM=a2x -f manpage --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>/' helper=./bin/build-helper MANDIR=docs/man @@ -86,6 +91,7 @@ MANSTATICALL=$(MANSTATICMAN) $(MANSTATICHTML) # Creating the type html page %.html: %.text $(A2XH) $^ + $(CROSSLINK) $^ man: $(MANTYPEALL) $(MANREFALL) $(MANSTATICALL)