Format and lint markdown code blocks using your favorite language-specific tools.
mdsf is a command-line tool that formats and lints code snippets embedded in markdown files. It detects code block languages and applies appropriate external formatters or linters, ensuring documentation code examples adhere to project style guides. It solves the problem of inconsistent code formatting in markdown documentation by automating the process.
Developers and technical writers who maintain markdown documentation with code examples, especially those working in multi-language projects or teams with strict code style requirements.
Developers choose mdsf because it integrates seamlessly with their existing toolchain—using familiar formatters like black, prettier, or gofmt—without requiring new formatting rules. Its flexibility, performance, and extensive plugin ecosystem make it a universal solution for markdown code hygiene.
Format markdown code blocks using your favorite tools
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates with 347+ tools across languages like Python, JavaScript, and Go, ensuring broad compatibility for most code snippets in markdown.
Leverages existing formatters like black or prettier, so teams maintain code style consistency without adopting new rules.
Offers caching and multi-threading options to speed up formatting, making it efficient for large documentation sets.
Provides GitHub Action, VS Code extension, and pre-commit hooks, enabling easy adoption in various development workflows.
Allows custom commands, language aliases, and tool chaining via config files, catering to complex project needs.
Requires all formatters to be installed separately, adding setup overhead and potential version conflicts, as noted in the README: 'mdsf is not a package manager.'
The VS Code extension lacks auto-installation for mdsf, necessitating manual setup and reducing out-of-the-box usability for some developers.
Advanced features like custom tools and chaining can lead to intricate config files that are hard to maintain for simple use cases.
Relies entirely on external tools, so if a preferred formatter is missing or unsupported, users must define custom commands, increasing effort.