Re: [PATCH v2] Add a target to check broken external links in the Documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 14 Feb 2017, Remy Leone <remy.leone@xxxxxxxx> wrote:
> From: Rémy Léone <remy.leone@xxxxxxxxx>
>
> 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.
>
> Signed-off-by: Rémy Léone <remy.leone@xxxxxxxxx>
> ---
> Changes in v2:
>
> - Add a more descriptive commit message
> - Add message to make help output about connection to external host
> - Add no-op for:
>     - Documentation/DocBook/Makefile
>     - Documentation/media/Makefile
> - Remove sphinx.builders.linkcheck include
> - Change from linkcheck to linkcheckdocs
>
>  Documentation/DocBook/Makefile | 1 +
>  Documentation/Makefile.sphinx  | 4 ++++
>  Documentation/media/Makefile   | 1 +
>  Makefile                       | 2 +-
>  4 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
> index a6eb7dc..035a6dd 100644
> --- a/Documentation/DocBook/Makefile
> +++ b/Documentation/DocBook/Makefile
> @@ -71,6 +71,7 @@ installmandocs: mandocs
>  # no-op for the DocBook toolchain
>  epubdocs:
>  latexdocs:
> +linkcheckdocs:
>  
>  ###
>  #External programs used
> diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
> index 707c653..c320458 100644
> --- a/Documentation/Makefile.sphinx
> +++ b/Documentation/Makefile.sphinx
> @@ -68,6 +68,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)))
>  
> @@ -109,6 +112,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'
> diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
> index 3266360..d576ef1 100644
> --- a/Documentation/media/Makefile
> +++ b/Documentation/media/Makefile
> @@ -103,6 +103,7 @@ html: all
>  epub: all
>  xml: all
>  latex: $(IMGPDF) all
> +linkcheckdocs:

Argh, this makefile is called with the Sphinx builder as target,
i.e. linkcheck instead of linkcheckdocs, leading to

make[2]: *** No rule to make target 'linkcheck'.  Stop.

We do expect contributors to try to weed out things like this
themselves.

Please apply the below change on top, and this is

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>
Tested-by: Jani Nikula <jani.nikula@xxxxxxxxx>


BR,
Jani.


diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
index d576ef112b26..8df0cf01bcb2 100644
--- a/Documentation/media/Makefile
+++ b/Documentation/media/Makefile
@@ -103,7 +103,7 @@ html: all
 epub: all
 xml: all
 latex: $(IMGPDF) all
-linkcheckdocs:
+linkcheck:
 
 clean:
 	-rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null



>  
>  clean:
>  	-rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null
> diff --git a/Makefile b/Makefile
> index 96e2352..416849c0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux