I’ve created a handy tool for copyediting my blog posts. Unfortunately, the models tend to extend my text into long lines and don’t properly word-wrap.
Enter mdformat
Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files. Mdformat is a Unix-style command-line tool as well as a Python library.
The features/opinions of the formatter include:
- Consistent indentation and whitespace across the board
- Always use ATX style headings
- Move all link references to the bottom of the document (sorted by label)
- Reformat indented code blocks as fenced code blocks
- Use 1. as the ordered list marker if possible, also for noninitial list items
Mdformat will not change word wrapping by default. The rationale for this is to support Semantic Line Breaks.
These two plugins, mdformat-footnote and mdformat-front-matters, have been useful. A long time ago, I picked up the Pandoc footnote style in Markdown. This year, I started using YAML front matter to align with my use of Quarto on another blog.
I actually started implementing this feature by hand without assistance from an agentic coder. Then I asked GitHub Copilot to review the PR. It found a few issues, including a couple of clear brainos by the human, and made some suggestions that were easy to adopt. The two of us delivered a better product.
GitHub Copilot feels like a vastly underappreciated entry into the agentic coding space.
P. S. This post was copyedited with my own copyediting tool.