# [RFC PATCH] Documentation: set a base URL for relative links

2 messages from 2009-12-03 to 2009-12-03. Participants: Todd Zullinger, Junio C Hamano.
Thread: https://gitlist.dev/t/21834

## Todd Zullinger, 2009-12-03 01:50

Subject: [RFC PATCH] Documentation: set a base URL for relative links
Message-ID: <20091203015005.GH23717@inocybe.localdomain>
URL: https://gitlist.dev/e/20091203015005.GH23717%40inocybe.localdomain

```
The man.base.url.for.relative.links setting is used when generating the
NOTES sections of various man pages.  If unset, the output looks like
this:

        1. Everyday Git
           [set $man.base.url.for.relative.links]/everyday.html

Reported-by: Michal Schmidt (Fedora bug #543481)
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---

This was reported to the Fedora bugzilla.  I checked and it's been
broken in the Fedora builds for quite a while.  In origin/man, the
first time it appeared was 3ae5cb60 (Autogenerated manpages for
v1.6.5.1-75-g02d56), which looks to be around the time that kernel.org
switched from F9 to F11.

I don't know the doc toolchain well enough to know how best to fix
this without breaking anything.  It would be ideal if the base URL
used was substituted and controllable via make variables.  That would
allow packagers to make it point to the on-disk documentation and make
git's documentation even easier to use when disconnected.

Any help or suggestions to refine this and test it on various docbook
versions would be most welcome.

 Documentation/manpage-base.xsl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/manpage-base.xsl b/Documentation/manpage-base.xsl
index a264fa6..50ce029 100644
--- a/Documentation/manpage-base.xsl
+++ b/Documentation/manpage-base.xsl
@@ -7,6 +7,10 @@
 <xsl:param name="man.output.quietly" select="1"/>
 <xsl:param name="refentry.meta.get.quietly" select="1"/>
 
+<!-- set a base URL for relative links -->
+<xsl:param name="man.base.url.for.relative.links"
+	>http://www.kernel.org/pub/software/scm/git/docs/</xsl:param>
+
 <!-- convert asciidoc callouts to man page format;
      git.docbook.backslash and git.docbook.dot params
      must be supplied by another XSL file or other means -->
-- 
1.6.6.rc0

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just because everything is different doesn't mean anything has
changed.
    -- Irene Peter

```

## Junio C Hamano, 2009-12-03 02:16

Subject: Re: [RFC PATCH] Documentation: set a base URL for relative links
Message-ID: <7vy6lk7qfr.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy6lk7qfr.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20091203015005.GH23717@inocybe.localdomain>

```
Todd Zullinger <tmz@pobox.com> writes:

> I don't know the doc toolchain well enough to know how best to fix
> this without breaking anything.  It would be ideal if the base URL
> used was substituted and controllable via make variables.  That would
> allow packagers to make it point to the on-disk documentation and make
> git's documentation even easier to use when disconnected.

Thanks. It indeed appears that update to FC11 at k.org brought a few
issues to the documentation area.

I think we can do something like this and let distro people to decide what
URL to use.

 Documentation/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3f59952..abb75eb 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -104,6 +104,10 @@ ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
 
+ifdef MAN_BASE_URL
+XMLTO_EXTRA += --stringparam man.base.url.for.relative.links=$(MAN_BASE_URL)
+endif
+
 # If your target system uses GNU groff, it may try to render
 # apostrophes as a "pretty" apostrophe using unicode.  This breaks
 # cut&paste, so you should set GNU_ROFF to force them to be ASCII

```
