GitXplorerGitXplorer
n

mddiff

public
15 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
8a21df54074804ba47220acb35dd2514f6c350d1

Add a command to rebuild a markdown from its AST

nnono committed 10 years ago
Unverified
d63a9036ae1bcb4f2d350cb66632e7a916ea4c0b

Add a mddiff command

nnono committed 10 years ago
Unverified
2ad3a0a228e2ab80ce90dbffad157d837a9fa8e3

Use VirtualDOM for building AST

nnono committed 10 years ago
Unverified
6d6822fa4717439cf1cfc5c57fa12e682aacf4c0

6to5 has been renamed to babel

nnono committed 10 years ago
Unverified
f9c6902ca8de572cfcb1536bb4b0454e150a8689

Update dependencies

nnono committed 10 years ago
Unverified
6bf05c6a8c05a4d77c423761d8858a7f643c9f93

Use the official commonmark package

nnono committed 10 years ago

README

The README file for this repository.

Markdown diff

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

Install iojs and run npm install -g mddiff.

Usage

Diff between two markdown files

mddiff file1.md file2.md

Show the abstract syntax tree of a markdown file

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

Rebuild the markdown from an AST

ast2md file.ast > file.md

Building from source

npm install --global gulp
npm install .
gulp
npm test

Credit

Copyright

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.