Skip to content

Commit 9af46f6

Browse files
authored
Merge pull request #4178 from hdiethelm/ci_htmltest
CI: Check html links for doc
2 parents 2220e2b + 3d4ef59 commit 9af46f6

7 files changed

Lines changed: 118 additions & 259 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ jobs:
179179
run: |
180180
#*.po and documentation.pot are modifyed by build. Ignore them for now.
181181
.github/scripts/verify-clean-repo.sh ':(exclude)docs/po/*.po' ':(exclude)docs/po/documentation.pot'
182+
- name: HTML checks
183+
run: |
184+
set -x
185+
#-w sets warn only, remove to generate a CI failure on error
186+
scripts/htmlcheck.sh -w
182187
- name: Tar linuxcnc-doc
183188
run: |
184189
set -x

docs/src/Submakefile

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
.PHONY: docs docclean checkref
1+
.PHONY: docs docclean
22
.PHONY: pdfdocs htmldocs install-doc install-doc-pdf install-doc-html
33

44
SHELL=/bin/bash
55

6-
# To make linuxcnc-checklink widely available
7-
export PATH:=$(BASEPWD)/../scripts:$(PATH)
8-
96
# Ruby (asciidoctor / asciidoctor-pdf) reads source files in the locale's
107
# default external encoding. Containerised builds often inherit POSIX/C,
118
# which makes Ruby treat every UTF-8 byte > 0x7f as an invalid sequence
@@ -573,7 +570,7 @@ $(DOC_OUT_HTML)/pdf/index.html: $(PDF_TARGETS) ../scripts/make-docs-pdf-index
573570
@mkdir -p $(dir $@)
574571
$(Q)../scripts/make-docs-pdf-index
575572

576-
htmldocs: svgs_made_from_dots .htmldoc-stamp checkref_en
573+
htmldocs: svgs_made_from_dots .htmldoc-stamp
577574

578575
# When translations are enabled, the .adoc files in $(L)/ are produced by
579576
# the translateddocs target (po4a). Teach make how to ask for them: the
@@ -590,8 +587,8 @@ endif
590587

591588
# Depend on the stamp files, not the phony copy_asciidoc_files /
592589
# gen_complist aliases: a phony prereq is always "newer", so naming them
593-
# re-touched .htmldoc-stamp every run, dragging checkref and the css copy
594-
# with it. The stamps fire only when their real inputs change.
590+
# re-touched .htmldoc-stamp every run, dragging the css copy
591+
# with it. The stamps fire only when their real inputs change.
595592
.htmldoc-stamp: .copy-asciidoc-stamp $(DOC_DIR)/.gen_complist-stamp $(HTML_TARGETS) .images-stamp .include-stamp $(DOC_OUT_HTML)/asciidoctor.css $(DOC_OUT_HTML)/rouge-github.css .lang-switcher-stamp
596593
touch $@
597594

@@ -681,43 +678,16 @@ $(DOC_OUT_HTML)/rouge-github.css: $(DOC_SRCDIR)/render-rouge-css.rb
681678
# gen_complist.py here after MAN_HTML_TARGETS would rewrite the file
682679
# with HTML-existence-dependent content (different miss_in_man set),
683680
# bumping mtime past .pot and re-triggering po4a on the next build.
684-
# Broken-link validation against generated HTML is checkref's job.
685681
# MAN_HTML_TARGETS is order-only: this stamp only needs the manpages built,
686682
# it does not read their content, and the post-processor rewrites them in
687683
# place later -- a normal prerequisite would then re-fire this stamp (and the
688-
# .htmldoc-stamp / checkref that depend on it) on every subsequent make.
684+
# .htmldoc-stamp that depend on it) on every subsequent make.
689685
$(DOC_DIR)/.gen_complist-stamp: $(DOC_OUT_ADOC)/en/hal/components_gen.adoc | $(MAN_HTML_TARGETS)
690686
mkdir -p $(DOC_OUT_HTML)/en/hal
691687
@touch $@
692688

693689
gen_complist: $(DOC_DIR)/.gen_complist-stamp
694690

695-
696-
CHECKREF_TARGETS := checkref_en $(foreach L,$(LANGUAGES),checkref_$(L))
697-
.PHONY: $(CHECKREF_TARGETS)
698-
checkref: $(CHECKREF_TARGETS)
699-
700-
# checkref_* stay phony aliases; the link check lives in stamp-gated rules
701-
# so it only re-runs when the HTML changes. .htmldoc-stamp is filtered out
702-
# of the args so the stamp file is not handed to the link checker.
703-
checkref_en: $(DOC_DIR)/.checkref-english-stamp
704-
# --warn-on-failure: link checking has been a silent no-op for a long time
705-
# (w3c-linkchecker disables file:// URIs), so the tree may carry accumulated
706-
# broken links. Report them without breaking the build for now; drop this
707-
# flag once the backlog is cleared so regressions fail the build again.
708-
$(DOC_DIR)/.checkref-english-stamp: $(DOC_TARGETS_HTML_EN) $(DOC_OUT_HTML)/en/index.html $(DOC_OUT_HTML)/en/gcode.html .htmldoc-stamp
709-
$(DOC_SRCDIR)/checkref --warn-on-failure English $(filter %.html,$^)
710-
@touch $@
711-
712-
# Pattern rule for all languages. Per-lang gcode.html is po4a-translated
713-
# from src/gcode.html and lands as a sibling to each lang's index.html.
714-
checkref_%: $(DOC_DIR)/.checkref-%-stamp ;
715-
$(DOC_DIR)/.checkref-%-stamp: $$(DOC_TARGETS_HTML_$$(call uc,$$*)) \
716-
$$(DOC_OUT_HTML)/%/gcode.html .htmldoc-stamp
717-
$(DOC_SRCDIR)/checkref --warn-on-failure $(call lang_name,$*) $(filter %.html,$$^)
718-
@touch $@
719-
720-
721691
MAN_SRCS_NOSO = $(patsubst $(DOC_MAN)/%,%, \
722692
$(shell grep -s -L '^\.so ' $(MAN_SRCS)))
723693

@@ -1324,7 +1294,6 @@ docclean:
13241294
-rm -f .include-stamp
13251295
-rm -f $(DOC_DIR)/.translateddocs-stamp
13261296
-rm -f $(DOC_DIR)/.gen_complist-stamp
1327-
-rm -f $(DOC_DIR)/.checkref-*-stamp
13281297
-rm -f $(OTHER_DOTFILES:.dot=.svg)
13291298

13301299

docs/src/checklinks.py

Lines changed: 0 additions & 127 deletions
This file was deleted.

docs/src/checkref

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)