I'll mention the Tree class of note organizer apps, just for a discussion point. You start in your tree, and type to your heart's content. The one I use lets you make new nodes with key commands, and when you are done the whole thing exports into a tree based web page. Later you can add/update your nodes, then push out the whole site again.
Unfortunately, I don't have an answer about the diagrams, but it covers the other two cases well enough for me.