Skip to content

Commit 62924fd

Browse files
remyleoneJonathan Corbet
authored andcommitted
Add a target to check broken external links in the Documentation
Documentation shouldn't have broken links. sphinx linkcheck builder scans all documents for external links, tries to open them with urllib2, and writes an overview which ones are broken and redirected to standard output and to output.txt in the output directory. Reviewed-by: Jani Nikula <[email protected]> Tested-by: Jani Nikula <[email protected]> Signed-off-by: Rémy Léone <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 72f8f67 commit 62924fd

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

Documentation/DocBook/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ installmandocs: mandocs
7171
# no-op for the DocBook toolchain
7272
epubdocs:
7373
latexdocs:
74+
linkcheckdocs:
7475

7576
###
7677
#External programs used

Documentation/Makefile.sphinx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
6969
htmldocs:
7070
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
7171

72+
linkcheckdocs:
73+
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
74+
7275
latexdocs:
7376
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,latex,$(var),latex,$(var)))
7477

@@ -117,6 +120,7 @@ dochelp:
117120
@echo ' pdfdocs - PDF'
118121
@echo ' epubdocs - EPUB'
119122
@echo ' xmldocs - XML'
123+
@echo ' linkcheckdocs - check for broken external links (will connect to external hosts)'
120124
@echo ' cleandocs - clean all generated files'
121125
@echo
122126
@echo ' make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'

Documentation/media/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ html: all
103103
epub: all
104104
xml: all
105105
latex: $(IMGPDF) all
106+
linkcheck:
106107

107108
clean:
108109
-rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ $(help-board-dirs): help-%:
14441444

14451445
# Documentation targets
14461446
# ---------------------------------------------------------------------------
1447-
DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs
1447+
DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs linkcheckdocs
14481448
PHONY += $(DOC_TARGETS)
14491449
$(DOC_TARGETS): scripts_basic FORCE
14501450
$(Q)$(MAKE) $(build)=scripts build_docproc build_check-lc_ctype

0 commit comments

Comments
 (0)