All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "David E. Wheeler" <david@justatheory.com>
Cc: git@vger.kernel.org
Subject: Re: Bad Man Page URLs
Date: Thu, 5 Apr 2012 22:54:57 -0400	[thread overview]
Message-ID: <20120406025457.GA23997@sigill.intra.peff.net> (raw)
In-Reply-To: <20120406023223.GB16264@sigill.intra.peff.net>

On Thu, Apr 05, 2012 at 10:32:23PM -0400, Jeff King wrote:

> That being said, it would be nice for the prebuilt manpages to have
> something more location-agnostic in them. These links are generated by
> asciidoc's "link:" directive. The HTML versions properly use relative
> links, but the links are expanded into full URLs for the manpages. Which
> makes sense, since there's no concept of a relative link here.
> 
> So we can tweak it by using a custom link macro (we already have
> "linkgit" for linking to actual commands). But what should the agnostic
> version say? Just saying "look at everday.html in the git documentation"
> is not as nice as a real URL, but we really don't have any more
> information than that. Maybe they should be pointing to some canonical
> version on the web?

I dug on this a little more. It seems that the "link" macro in asciidoc
is overridable, so we could just redefine it as appropriate. However,
the existing implementation actually generates a reasonable-looking
docbook <ulink>, and it is docbook that is responsible for turning it
into an absolute URL.

So I think technically the docbook part of the toolchain would be the
right place to fix this. But it may be easier to hack around it at the
asciidoc level.

Something like the code below would work:

diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index aea8627..1edbabe 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -93,3 +93,10 @@ ifdef::backend-xhtml11[]
 [linkgit-inlinemacro]
 <a href="{target}.html">{target}{0?({0})}</a>
 endif::backend-xhtml11[]
+
+ifdef::generic-location[]
+ifdef::backend-docbook[]
+[link-inlinemacro]
+<ulink url="http://official-location/{target}">{0={target}}</ulink>
+endif::backend-docbook[]
+endif::generic-location[]

though it assumes that link targets are relative. There are a handful of
instances where that is not the case (we can either introduce a linkabs
for them, or leave them and switch most of the existing link: macros
over to linkrel: or something).

-Peff

  reply	other threads:[~2012-04-06  2:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06  1:48 Bad Man Page URLs David E. Wheeler
2012-04-06  2:32 ` Jeff King
2012-04-06  2:54   ` Jeff King [this message]
2012-04-06  4:22     ` Jonathan Nieder
2012-04-06  5:46       ` Jeff King
2012-04-06  6:17         ` Jonathan Nieder
2012-04-06  7:15         ` Junio C Hamano
2012-04-06  7:23           ` Jeff King
2012-04-26 20:12           ` David E. Wheeler
2012-04-26 20:19             ` Jonathan Nieder
2012-04-26 20:24               ` David E. Wheeler
2012-04-26 20:29                 ` Jonathan Nieder
2012-04-26 20:34                   ` David E. Wheeler
2012-05-02 21:46                     ` Jakub Narebski
2012-04-26 21:02               ` Jeff King
2012-04-26 21:58                 ` Scott Chacon
2012-04-26 22:11                   ` David E. Wheeler
2012-04-26 22:12                   ` Jonathan Nieder
2012-04-26 22:16                   ` Junio C Hamano
2012-04-26 22:25                     ` Scott Chacon
2012-04-26 22:34                       ` Jonathan Nieder

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=20120406025457.GA23997@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=david@justatheory.com \
    --cc=git@vger.kernel.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.