campoy / embedmd

embedmd: embed code into markdown and keep everything in sync
Apache License 2.0
767 stars 62 forks source link

fix samples (again) #9

Closed campoy closed 8 years ago

campoy commented 8 years ago

Change-Id: Iebeed747e92b454542cf222fa58aa4f72b00aa4d

dmitshur commented 8 years ago

You could make CI run embedmd on all Markdown files in the repo, and fail if there any diffs generated.

I do something like that in markdownfmt repo, where the CI will fail if the README has formatting issues.

campoy commented 8 years ago

I'm planning on adding an embedmd -d function that will help me with this. Trying to decide if it should call the diff command as gofmt does, or if there's a good library for this.

dmitshur commented 8 years ago

Trying to decide if it should call the diff command as gofmt does, or if there's a good library for this.

Let me know what you find, because I'd love to replace mine with a pure Go alternative as well.

I've looked in the past, and did not find a complete replacement for diff -u file1 file2. There are Go diffing libraries (e.g., github.com/mb0/diff, github.com/sergi/go-diff/diffmatchpatch, etc.) that could be used as the basic building blocks though.