Skip to content

Commit

Permalink
Add a target to check broken external links in the Documentation
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
remyleone authored and Jonathan Corbet committed Feb 15, 2017
1 parent 72f8f67 commit 62924fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/DocBook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ installmandocs: mandocs
# no-op for the DocBook toolchain
epubdocs:
latexdocs:
linkcheckdocs:

###
#External programs used
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Makefile.sphinx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
htmldocs:
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))

linkcheckdocs:
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))

latexdocs:
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,latex,$(var),latex,$(var)))

Expand Down Expand Up @@ -117,6 +120,7 @@ dochelp:
@echo ' pdfdocs - PDF'
@echo ' epubdocs - EPUB'
@echo ' xmldocs - XML'
@echo ' linkcheckdocs - check for broken external links (will connect to external hosts)'
@echo ' cleandocs - clean all generated files'
@echo
@echo ' make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
Expand Down
1 change: 1 addition & 0 deletions Documentation/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ html: all
epub: all
xml: all
latex: $(IMGPDF) all
linkcheck:

clean:
-rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ $(help-board-dirs): help-%:

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

0 comments on commit 62924fd

Please sign in to comment.