We use Markdown for our development documentation. One sticking point has long been the ability to conveniently insert diagrams and show them inline while editing the markdown file.
Here is the solution:
- Download the draw.io desktop app for offline usage.
- Create a diagram in draw.io, store it as editable PNG, yes, that’s right. The diagram source is embedded in the PNG file.
- Write your markdown document, include an image like so:
- If you are using SublimeText, install the Markdown Images package. Now you can see your editable PNGs right inside your markdown document in SublimeText.
- draw.io is a powerful and open-source drawing tool.
- It can export to editable! SVG and PNG images. So the rendered output is also the source diagram. If you save your diagrams along with your source documentation as editable PNGs, you can display them inline in your text editor. The diagrams are stored along with the markdown documents under version control.
- You can update your PNG diagrams at a later time using draw.io. This is a big deal: Your rendered output (PNG) is also your editable source file.