mdcheckr/README.md

1.6 KiB

mdcheckr Build Status

mdcheckr is a testing tool to detect quality problems with your Markdown documentation. It is designed to act as a quality gate in your continuous integration pipeline.

  • Syntax errors in code blocks - Syntax-check code blocks that identify their language. Currently works for:
  • Code blocks- Detection of un-closed code blocks (example)
  • Broken links- Flag files that link to relative paths or URLs on the internet which can't be accessed (example, example).
  • Broken images- Detect broken embeds, local and remote (example, example).

This tool is not intended to enforce a code style, and will not critique aspects of your Markdown code which do not affect the output.

Dependencies

Requirements:

  • curl
  • xmllint
  • pandoc

Installation

curl https://raw.githubusercontent.com/mike42/mdcheckr/master/mdcheckr -o mdcheckr
chmod +x mdcheckr
sudo cp mdcheckr /usr/local/bin

Usage

mdcheckr [ -h | --help ] [ -v | --version ] FILE ..

Examples

Check a single markdown file:

mdcheckr README.md

Check all the markdown files in the current directory:

find . -name '*.md' -print0 | xargs -0 mdcheckr

Check all the markdown files in your Git repository:

git ls-files | grep '\.md$' | tr '\n' '\0' | xargs -0 mdcheckr