pub fn check_broken_links(
    path: &Path,
    options: CheckerOptions,
    links_cache: &mut FileLinksCache
) -> Result<(), CheckerError>
Expand description

Check broken links in a Markdown file or directory

The input path will be checked recursively as a directory if dir is set to true, else as a single file.

By default, when a header points to a specific header (e.g. other_file.md#some-header), the target file will be opened and the function will check if it contains the said header. As this feature may slow down the whole process, it’s possible to disable it by settings ignore_header_links to true.

In order to improve performances when looking at header-specific links, when a file’s list of headers is made, it is stored inside a cache This cache is shared recursively through the links_cache argument. As it uses a specific format, it’s recommanded to just pass a mutable reference to an empty HashMap to this function, and not build your own one which may cause detection problems.

The function returns an error is something goes wrong, or else the number of broken and invalid (without target) links.