Highlight Diffs With Markdown
Today I learned about the 'diff' syntax, supported by many syntax highlighting libraries including those used by Github and Today I Learned.
Add diff
to your fenced code block, and this:
def example do
- :ok
+ {:ok, :more_stuff}
end
Becomes this:
def example do
- :ok
+ {:ok, :more_stuff}
end
A nice use case is a README or pull request description; show instead of tell the changes you made, or someone should make.
Tweet