git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Missing hyperlinks in HTML docs

From
Jeff King <peff@peff.net>
Date
Jun 21, 2012, 06:24 UTC
Message-ID
<20120621062410.GB19485@sigill.intra.peff.net>
In-Reply-To
<4FE235DC.9080202@online.de>
On Wed, Jun 20, 2012 at 10:43:08PM +0200, Michael Hertling wrote:
Show 21 quoted lines
> shows that git.html does have the expected hyperlinks; e.g., diffing
> git-1.7.11.rc{2,3}/Documentation/git.html reveals the following hunk:
> 
> @@ -964,7 +964,6 @@
>  <h3 id="_main_porcelain_commands">Main porcelain commands</h3>
>  <div class="dlist"><dl>
>  <dt class="hdlist1">
> -<a href="git-add.html">git-add(1)</a>
>  </dt>
>  <dd>
>  <p>
> 
> Other files, e.g. git-add.html, are affected, too.
> 
> AFAICS, this is caused by fe77b41, more precisely the change of the
> Documentation/asciidoc.conf file. Indeed, reverting that commit on
> v1.7.11-rc3 results in git.html containing hyperlinks as expected.
> 
> Can anyone confirm this? If so, is this intended behaviour? So far,
> I haven't found any clues in the release notes / mailing list / etc.
> Am I doing something wrong? Do I miss something? Thanks for any hint.

Eek. I can easily replicate it here. The problem is that the new git-relative-html-prefix attribute is not defined by default (whereas we want it defined but blank). Which puzzles me, as I thought I tested how fe77b41 impacted files outside of technical/. But obviously I screwed something up.

The patch below should solve it.
-- >8 --
Subject: docs: always define git-relative-html-prefix attribute

Commit fe77b41 introduced a new attribute to let the linkgit macro create cross-directory HTML references from the technical/ and howto/ subdirectories back to the main documentation. We define that attribute to "../" on the command-line when building inside those subdirectories, and otherwise leave it unset under the assumption that it would default to being blank. Instead, asciidoc omits the link entirely, leading to broken documentation. Fix this by defining git-relative-html-prefix to blank in asciidoc.conf (and an instance on the command-line, when present, will override it).

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/asciidoc.conf | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 6d06271..a26d245 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -90,6 +90,8 @@ endif::backend-docbook[]
 endif::doctype-manpage[]
 
 ifdef::backend-xhtml11[]
+[attributes]
+git-relative-html-prefix=
 [linkgit-inlinemacro]
 <a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
 endif::backend-xhtml11[]
Previous: Michael HertlingNext: Michael Hertling
Message 2 of 3 in “Missing hyperlinks in HTML docs”
  1. Michael HertlingJun 20, 2012
  2. Jeff KingJun 21, 2012
  3. Michael HertlingJun 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.