Crate broken_md_links

Source
Expand description

A library and command-line tool for detecting broken links in Markdown files.

By default, this tool detects broken links like “foo” (target file does not exist) and broken header links like “foo” (target file exists but specific header does not exist)

§Command-line usage

Check a single file:

broken-md-links input.md

Check a whole directory:

broken-md-links dir/

§Output

There are several levels of verbosity:

  • -v silent: display nothing (exit code will be 0 if there was no broken link)
  • -v errors: display errors only
  • -v warn: display errors and warnings (the default)
  • -v info: display the list of analyzed files as well
  • -v verbose: display detailed informations
  • -v trace: display debug informations

Structs§

CheckerOptions
Broken links checker options
DetectedBrokenLink
Detected broken link

Enums§

CheckerError
Checker error

Functions§

check_broken_links
Check broken links in a Markdown file or directory
check_broken_links_in_dir
check_file_broken_links
generate_slugs
Get all headers of a Markdown file as slugs This function is used to check if the header specified in a link exists in the target file Returns an error message if the operation failed for any reason
slugify
Slugify a Markdown header This function is used to generate slugs from all headers of a Markdown file (see the ‘generate_slugs’ function)

Type Aliases§

FileLinksCache
Markdown file links cache