git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Jeff King <peff@peff.net>, Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH] docs: fix cross-directory linkgit references
Date: Thu,  7 Jun 2012 23:03:23 +0200	[thread overview]
Message-ID: <1339103003-18447-1-git-send-email-Matthieu.Moy@imag.fr> (raw)

From: Jeff King <peff@peff.net>

Most of our documentation is in a single directory, so using
linkgit:git-config[1] just generates a relative link in the
same directory. However, this is not the case with the API
documentation in technical/*, which need to refer to
git-config from the parent directory.

We can fix this by passing a special prefix attribute when building
in a subdirectory, and respecting that prefix in our linkgit
definitions.

We only have to modify the html linkgit definition.  For
manpages, we can ignore this for two reasons:

  1. we do not generate actual links to the file in
     manpages, but instead just give the name and section of
     the linked manpage

  2. we do not currently build manpages for subdirectories,
     only html

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
This if Peff's patch, with

* One missing -a in Makefile added

* Rebased on 04ab6ae77657 (api-credentials.txt: add "see also"
  section) in next to get recently added instances of linkgit:../ and
  fix them.

 Documentation/Makefile                      | 2 ++
 Documentation/asciidoc.conf                 | 2 +-
 Documentation/technical/api-config.txt      | 2 +-
 Documentation/technical/api-credentials.txt | 6 +++---
 Documentation/technical/api-merge.txt       | 2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9ad6a6a..d84d6f4 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -270,6 +270,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
 	technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
 	$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
 
+technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
 $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
 	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
@@ -323,6 +324,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
 
 WEBDOC_DEST = /pub/software/scm/git/docs
 
+howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	sed -e '1,/^$$/d' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index aea8627..6d06271 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -91,5 +91,5 @@ endif::doctype-manpage[]
 
 ifdef::backend-xhtml11[]
 [linkgit-inlinemacro]
-<a href="{target}.html">{target}{0?({0})}</a>
+<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
 endif::backend-xhtml11[]
diff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt
index bd4d8b8..edf8dfb 100644
--- a/Documentation/technical/api-config.txt
+++ b/Documentation/technical/api-config.txt
@@ -2,7 +2,7 @@ config API
 ==========
 
 The config API gives callers a way to access git configuration files
-(and files which have the same syntax). See linkgit:../git-config[1] for a
+(and files which have the same syntax). See linkgit:git-config[1] for a
 discussion of the config file syntax.
 
 General Usage
diff --git a/Documentation/technical/api-credentials.txt b/Documentation/technical/api-credentials.txt
index 199307c..4ef1db3 100644
--- a/Documentation/technical/api-credentials.txt
+++ b/Documentation/technical/api-credentials.txt
@@ -180,7 +180,7 @@ longer than a single git process; e.g., credentials may be stored
 in-memory for a few minutes, or indefinitely on disk).
 
 Each helper is specified by a single string in the configuration
-variable `credential.helper` (and others, see linkgit:../git-config[1]).
+variable `credential.helper` (and others, see linkgit:git-config[1]).
 The string is transformed by git into a command to be executed using
 these rules:
 
@@ -293,6 +293,6 @@ helpers will just ignore the new requests).
 See also
 --------
 
-linkgit:../gitcredentials[7]
+linkgit:gitcredentials[7]
 
-linkgit:../git-config[5] (See configuration variables `credential.*`)
+linkgit:git-config[5] (See configuration variables `credential.*`)
diff --git a/Documentation/technical/api-merge.txt b/Documentation/technical/api-merge.txt
index 25158b8..9dc1bed 100644
--- a/Documentation/technical/api-merge.txt
+++ b/Documentation/technical/api-merge.txt
@@ -36,7 +36,7 @@ the operation of a low-level (single file) merge.  Some options:
 	ancestors in a recursive merge.
 	If a helper program is specified by the
 	`[merge "<driver>"] recursive` configuration, it will
-	be used (see linkgit:../gitattributes[5]).
+	be used (see linkgit:gitattributes[5]).
 
 `variant`::
 	Resolve local conflicts automatically in favor
-- 
1.7.11.rc0.57.g84a04c7

             reply	other threads:[~2012-06-07 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 21:03 Matthieu Moy [this message]
2012-06-08  3:58 ` [PATCH] docs: fix cross-directory linkgit references Jeff King
2012-06-08 11:15   ` Matthieu Moy

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=1339103003-18447-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).