Skip to content

Commit

Permalink
Add cross-file anchor link check (use lychee for markdown link checki…
Browse files Browse the repository at this point in the history
…ng) (#614)

* Add cross-file anchor link check (use lychee for markdown link checking)
  • Loading branch information
trask authored Jan 8, 2025
1 parent 2bd940b commit c4214b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
9 changes: 9 additions & 0 deletions .lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include_fragments = true

exclude = [
# excluding links to pull requests and issues is done for performance
"^https://github.com/open-telemetry/opentelemetry-proto/(pull|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 c4214b8

Please sign in to comment.