threads / discuss / 30854

Missing hyperlinks in HTML docs

Subject: Missing hyperlinks in HTML docs

## tl;dr

3 messages between Jun 20, 2012 and Jun 21, 2012.

replies: 2people: 2as markdown or json

Michael Hertling· Jun 20, 2012, 20:43 UTC · lore
Dear Git community,

beginning with v1.7.11-rc3, some HTML docs built along with Git are lacking hyperlinks on my system. Steps to reproduce, e.g.:

gunzip -c git-1.7.11.rc3.tar.gz | tar xf - (cd git-1.7.11.rc3 && ./configure && make -C Documentation git.html)

The resulting git.html does not have hyperlinks to the individual Git commands, making this file somewhat useless. Doing the same with v1.7.11-rc2, i.e.

gunzip -c git-1.7.11.rc2.tar.gz | tar xf - (cd git-1.7.11.rc2 && ./configure && make -C Documentation git.html)

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.

Regards,

Michael
Jeff King· Jun 21, 2012, 06:24 UTC · re: Michael Hertling · lore

Re: Missing hyperlinks in HTML docs

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[]

← back to recent threads