Skip to contentSkip to conversation

docs: Fix all links to Xen man pages in html

PATCH In review Anthony PERARD 3 participants 6 messages Jan 16, 2019 – Jan 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 docs: Fix all links to Xen man pages in html

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.

---
v2:
adding a comment

CC Andrew Cooper <[email protected]>
---
 docs/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
docs/Makefile +6 -2
index cbc61e3f1d..44aebf079d 100644
@@ -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
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH v2 2/2 man: Highlight reference in xl-disk-configuration(5)

Provide a better way to see the link to a different manpage, with simple words.

---
 docs/man/xl-disk-configuration.5.pod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/man/xl-disk-configuration.5.pod +1 -1
index d3eedc1926..eea893ef91 100644
@@ -123,7 +123,7 @@ raw
 =item Description
 
 Virtual device as seen by the guest (also referred to as guest drive
-designation in some specifications).  L<xen-vbd-interface(7)>
+designation in some specifications).  See L<xen-vbd-interface(7)>.
 
 =item Supported values
 
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

Re: [PATCH v2 2/2] man: Highlight reference in xl-disk-configuration(5)

Quoted 6 lines · Anthony PERARD

Provide a better way to see the link to a different manpage, with simple words.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
In reply to Anthony PERARD
Quoted 11 lines · Anthony PERARD

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:".

Quoted 5 lines

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

Juergen, could you release-ack this patch and the following one[1]?

Thanks,

[1] xen: Highlight reference in xl-disk-configuration(5)

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw
In reply to Anthony PERARD
Quoted 11 lines · Anthony PERARD

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:".

Quoted 5 lines

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

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Anthony PERARD

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:".

Quoted 7 lines
Quoted 5 lines

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

Now pushed. Thanks.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel