Warning: this is experimental, not ready for production!
Markdown diff, or mddiff, is a tool to diff two markdown files. It constructs an AST for both files and then compute the diff on those trees.
Install iojs and run npm install -g mddiff
.
mddiff file1.md file2.md
mdast file.md
If you have graphviz installed, you can visualize the AST as an image:
mdast --dot file.md | dot -Tpng -o file.md.png
linux $ xdg-open file.md.png
osx $ open file.md.png
mdast --dot --dark -f 'Droid sans' -s 16 file.md | dot -Tsvg -o file.md.svg
browser file.md.svg
ast2md file.ast > file.md
npm install --global gulp
npm install .
gulp
npm test
- John Gruber, for Markdown
- John MacFarlane and the CommonMark crew, for CommonMark
- Matt Esch, for Virtual-DOM
The code is licensed as MIT. See the MIT-LICENSE file for the full license.
♡2015 by Bruno Michel. Copying is an act of love. Please copy and share.