{"thread":{"id":"30742","subject":"[PATCH] docs: fix cross-directory linkgit references","startedAt":"2012-06-07T21:03:23Z","lastAt":"2012-06-08T11:15:45Z","messageCount":3,"participants":["Matthieu Moy","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"193112","messageId":"1339103003-18447-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"30742","inReplyTo":null,"subject":"[PATCH] docs: fix cross-directory linkgit references","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2012-06-07T21:03:23Z","receivedAt":"2012-06-07T21:03:23Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"From: Jeff King <peff@peff.net>\n\nMost of our documentation is in a single directory, so using\nlinkgit:git-config[1] just generates a relative link in the\nsame directory. However, this is not the case with the API\ndocumentation in technical/*, which need to refer to\ngit-config from the parent directory.\n\nWe can fix this by passing a special prefix attribute when building\nin a subdirectory, and respecting that prefix in our linkgit\ndefinitions.\n\nWe only have to modify the html linkgit definition.  For\nmanpages, we can ignore this for two reasons:\n\n  1. we do not generate actual links to the file in\n     manpages, but instead just give the name and section of\n     the linked manpage\n\n  2. we do not currently build manpages for subdirectories,\n     only html\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nThis if Peff's patch, with\n\n* One missing -a in Makefile added\n\n* Rebased on 04ab6ae77657 (api-credentials.txt: add \"see also\"\n  section) in next to get recently added instances of linkgit:../ and\n  fix them.\n\n Documentation/Makefile                      | 2 ++\n Documentation/asciidoc.conf                 | 2 +-\n Documentation/technical/api-config.txt      | 2 +-\n Documentation/technical/api-credentials.txt | 6 +++---\n Documentation/technical/api-merge.txt       | 2 +-\n 5 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 9ad6a6a..d84d6f4 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -270,6 +270,7 @@ technical/api-index.txt: technical/api-index-skel.txt \\\n \ttechnical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))\n \t$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh\n \n+technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../\n $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt\n \t$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \\\n \t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt\n@@ -323,6 +324,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt\n \n WEBDOC_DEST = /pub/software/scm/git/docs\n \n+howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../\n $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n \tsed -e '1,/^$$/d' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \\\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex aea8627..6d06271 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -91,5 +91,5 @@ endif::doctype-manpage[]\n \n ifdef::backend-xhtml11[]\n [linkgit-inlinemacro]\n-<a href=\"{target}.html\">{target}{0?({0})}</a>\n+<a href=\"{git-relative-html-prefix}{target}.html\">{target}{0?({0})}</a>\n endif::backend-xhtml11[]\ndiff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt\nindex bd4d8b8..edf8dfb 100644\n--- a/Documentation/technical/api-config.txt\n+++ b/Documentation/technical/api-config.txt\n@@ -2,7 +2,7 @@ config API\n ==========\n \n The config API gives callers a way to access git configuration files\n-(and files which have the same syntax). See linkgit:../git-config[1] for a\n+(and files which have the same syntax). See linkgit:git-config[1] for a\n discussion of the config file syntax.\n \n General Usage\ndiff --git a/Documentation/technical/api-credentials.txt b/Documentation/technical/api-credentials.txt\nindex 199307c..4ef1db3 100644\n--- a/Documentation/technical/api-credentials.txt\n+++ b/Documentation/technical/api-credentials.txt\n@@ -180,7 +180,7 @@ longer than a single git process; e.g., credentials may be stored\n in-memory for a few minutes, or indefinitely on disk).\n \n Each helper is specified by a single string in the configuration\n-variable `credential.helper` (and others, see linkgit:../git-config[1]).\n+variable `credential.helper` (and others, see linkgit:git-config[1]).\n The string is transformed by git into a command to be executed using\n these rules:\n \n@@ -293,6 +293,6 @@ helpers will just ignore the new requests).\n See also\n --------\n \n-linkgit:../gitcredentials[7]\n+linkgit:gitcredentials[7]\n \n-linkgit:../git-config[5] (See configuration variables `credential.*`)\n+linkgit:git-config[5] (See configuration variables `credential.*`)\ndiff --git a/Documentation/technical/api-merge.txt b/Documentation/technical/api-merge.txt\nindex 25158b8..9dc1bed 100644\n--- a/Documentation/technical/api-merge.txt\n+++ b/Documentation/technical/api-merge.txt\n@@ -36,7 +36,7 @@ the operation of a low-level (single file) merge.  Some options:\n \tancestors in a recursive merge.\n \tIf a helper program is specified by the\n \t`[merge \"<driver>\"] recursive` configuration, it will\n-\tbe used (see linkgit:../gitattributes[5]).\n+\tbe used (see linkgit:gitattributes[5]).\n \n `variant`::\n \tResolve local conflicts automatically in favor\n-- \n1.7.11.rc0.57.g84a04c7\n"},{"id":"193124","messageId":"20120608035803.GA27438@sigill.intra.peff.net","threadId":"30742","inReplyTo":"1339103003-18447-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] docs: fix cross-directory linkgit references","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-08T03:58:04Z","receivedAt":"2012-06-08T03:58:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 07, 2012 at 11:03:23PM +0200, Matthieu Moy wrote:\n\n> This if Peff's patch, with\n> \n> * One missing -a in Makefile added\n> \n> * Rebased on 04ab6ae77657 (api-credentials.txt: add \"see also\"\n>   section) in next to get recently added instances of linkgit:../ and\n>   fix them.\n\nThanks. I noticed that your series was in next, so I planned to rebuild\nmy patch on top. This looks like exactly what I would have done.\n\n-Peff\n"},{"id":"193140","messageId":"vpqr4tqt5pa.fsf@bauges.imag.fr","threadId":"30742","inReplyTo":"20120608035803.GA27438@sigill.intra.peff.net","subject":"Re: [PATCH] docs: fix cross-directory linkgit references","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-06-08T11:15:45Z","receivedAt":"2012-06-08T11:15:45Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jeff King <peff@peff.net> writes:\n\n> Thanks. I noticed that your series was in next, so I planned to rebuild\n> my patch on top. This looks like exactly what I would have done.\n\nIt seems procrastination pays off these days ;-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}