Skip to content

Commit 8922506

Browse files
pks-tgitster
authored andcommitted
Documentation: refactor "howto-index.sh" for out-of-tree builds
The "howto-index.sh" is used to generate an index of our how-to docs. It receives as input the paths to these documents, which would typically be relative to the "Documentation/" directory in Makefile-based builds. In an out-of-tree build though it will get relative that may be rooted somewhere else entirely. The file paths do end up in the generated index, and the expectation is that they should always start with "howto/". But for out-of-tree builds we would populate it with the paths relative to the build directory, which is wrong. Fix the issue by using `$(basename "$file")` to generate the path. While at it, move the script into "howto/" to align it with the location of the comparable "api-index.sh" script. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88e08b9 commit 8922506

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ gitman.info: gitman.texi
411411
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
412412
$(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@
413413

414-
howto-index.txt: howto-index.sh $(HOWTO_TXT)
415-
$(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@
414+
howto-index.txt: howto/howto-index.sh $(HOWTO_TXT)
415+
$(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto/howto-index.sh $(sort $(HOWTO_TXT)) >$@
416416

417417
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt $(ASCIIDOC_DEPS)
418418
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt

Documentation/howto-index.sh renamed to Documentation/howto/howto-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ do
4848
file="$txt"
4949
fi
5050

51-
echo "* link:$file[$title] $from
51+
echo "* link:howto/$(basename "$file")[$title] $from
5252
$abstract
5353
5454
"

0 commit comments

Comments
 (0)