Skip to content

Commit

Permalink
Add cross-file anchor link check (use lychee for markdown link checking)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Dec 18, 2024
1 parent 2bd940b commit ccfbad0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
10 changes: 10 additions & 0 deletions .lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include-fragments = true

exclude = [
# excluding links to pull requests and issues is done for performance
"^https://github.com/open-telemetry/opentelemetry-proto/pull/\\d+$",
"^https://github.com/open-telemetry/opentelemetry-proto/issue/\\d+$"
]

# better to be safe and avoid failures
max-retries = 6
22 changes: 0 additions & 22 deletions .markdown_link_check_config.json

This file was deleted.

12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -p

.PHONY: markdown-link-check
markdown-link-check:
@if ! npm ls markdown-link-check; then npm install; fi
@for f in $(ALL_DOCS); do \
npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json $$f \
|| exit 1; \
done
docker run --rm \
--mount 'type=bind,source=$(PWD),target=/home/repo' \
lycheeverse/lychee \
--config home/repo/.lychee.toml \
--root-dir /home/repo \
-v \
home/repo

.PHONY: markdownlint
markdownlint:
Expand Down

0 comments on commit ccfbad0

Please sign in to comment.