All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 1/2] docs: Fix all links to Xen man pages in html
Date: Wed, 16 Jan 2019 16:16:56 +0000	[thread overview]
Message-ID: <20190116161657.3634-1-anthony.perard@citrix.com> (raw)

Second try, this time also works for all links to xen-vbd-interface(7).

We don't try anymore to have pod2html generate relative links, instead
we do it ourself.

First, we modify all links to man pages to have what looks like an
absolute URL and pod2html will just write it in the html output.
Absolute URL in POD are in the form L<text|scheme:...> so let's just use
a scheme that isn't real, but easy to find in the resulting html output:
"relative:".

Then we fix the output and remove all the bogus scheme "relative" and
can end up with nice relative links.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2:
    adding a comment

CC: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index cbc61e3f1d..44aebf079d 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -96,8 +96,12 @@ endif
 html/man/%.$(1).html: man/%.$(1).pod Makefile
 ifneq ($(POD2HTML),)
 	@$(INSTALL_DIR) $$(@D)
-	sed -r -e 's%L<([^>]+)\(([1-9])\)>%L<\1(\2)|\1.\2>%g' $$< | \
-		(cd man; $(POD2HTML) --podpath=. --htmlroot=. --outfile=../$$@)
+	# Fix up links between man-pages
+	# 1) L<xl(1)> -> L<xl(1)|relative:xl.1.html>
+	# 2) <a href="relative:xl.1.html"> -> <a href="xl.1.html">
+	sed -r -e 's%L<([^>]+)\(([1-9])\)>%L<\1(\2)|relative:\1.\2.html>%g' $$< | \
+		$(POD2HTML) | \
+		sed -r -e 's%( href=")relative:%\1%g' > $$@
 else
 	@echo "pod2html not installed; skipping $$@"
 endif
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-01-16 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 16:16 Anthony PERARD [this message]
2019-01-16 16:16 ` [PATCH v2 2/2] man: Highlight reference in xl-disk-configuration(5) Anthony PERARD
2019-01-22 11:39   ` Juergen Gross
2019-01-22 10:27 ` [PATCH v2 1/2] docs: Fix all links to Xen man pages in html Anthony PERARD
2019-01-22 11:38 ` Juergen Gross
2019-01-22 11:42   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190116161657.3634-1-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.