Michael-F-Bryan / mdbook-linkcheck

A backend for `mdbook` which will check your links for you.
https://michael-f-bryan.github.io/mdbook-linkcheck/
MIT License
141 stars 29 forks source link

Possible to check anchors? #52

Open kamulos opened 3 years ago

kamulos commented 3 years ago

Is it possible to check anchors for links inside the mdbook? I want to link to specific sections in my book, but the anchor names just depend on the heading name. It would really give me peace of mind if this could be checked automatically.

mhvelplund commented 1 year ago

I wish this renderer did it, but in the meantime I've used https://github.com/untitaker/hyperlink

eholk commented 1 year ago

A partial improvement would be for links like foo.md#my-section, just check that foo.md exists, without necessarily validating the anchor. Validating the anchor would be even better, but that's probably harder.

dae commented 1 year ago

@rumovz patched in support for local anchor checking - you can find it here: https://github.com/ankitects/mdbook-linkcheck/commits/anchors

It required adding a dependency on mdbook to the linkcheck crate, so may be difficult to contribute back upstream.