From 1eef207b51ddbb92c2bc4a02ae7b46929583355b Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Thu, 9 Nov 2023 10:39:46 -0600 Subject: Use mdbook-linkcheck to detect missing defs for ref-style links Suppose in raw markdown we have: ```markdown See [foo][barr]. [bar]: https://link-to-bar ``` The intent is to link the text "foo", but because of a typo it used the label barr instead of bar. The result is that the rendered html won't have a link at all. The text will be rendered literally as `[foo][barr]`. Since there's no link (not even a broken one), a link checker run over the rendered output won't spot the problem. The mdbook-linkcheck plugin correctly detects this issue. However, it doesn't understand links that go between our two mdbook projects since the relative paths in the source don't match the relative paths in the rendered output. Since checking whether the links are non-broken is already covered by `bin/check_links` (using linklint), we can disable checking the link destinations altogether. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06942af..ddd399d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,7 @@ build: script: - env - apt-get update && apt-get install -y git python3 python3-yaml - - ./bin/via-cargo-install-in-ci mdbook + - ./bin/via-cargo-install-in-ci mdbook mdbook-linkcheck - | if test "$MMDC" != "" ; then ./bin/mermaid-cli-in-ci @@ -46,7 +46,7 @@ link-check: - when: always script: - apt-get update && apt-get install -y git python3 python3-yaml linklint - - ./bin/via-cargo-install-in-ci mdbook + - ./bin/via-cargo-install-in-ci mdbook mdbook-linkcheck - ./bin/build_html - ./bin/check_links artifacts: -- cgit v1.2.3-54-g00ecf