Still interested in Markdown support in OmniOutliner

Stumbled across this thread, and figured I would add that MultiMarkdown does have an official MMD<->OPML “spec.”

In 2005 I wrote a plugin for OmniOutliner to export as Markdown/MultiMarkdown. The same conventions were further refined in MultiMarkdown version 6, which has built-in read/write support for OPML (as well as iThoughts’ ITMZ format). This newer spec allows safe “round-tripping” between plain text and OPML without losing information, assuming a “valid” document. I wanted OPML to become a “first class” document format for MMD, and this required a couple of “tricks”.

(NOTE: MultiMarkdown-6 supports OPML but does not currently support the native OmniOutliner file format directly. Assuming that format is still similar to the XML format it used to be, that would not be difficult to add. For my needs, the OPML format was more flexible, and allows support for users of Linux and Windows machines.)

An important requirement for this effort was to be able to take any plain text MultiMarkdown file, convert it to OPML, convert that OPML back to plain text, and end up with an identical file to what one started with.

The primary goal for this was to be able to simultaneously work on a single document in MultiMarkdown Composer (for text editing) and an outliner or mind mapping tool (for visualizing the structure of the document and being able to rearrange it quickly and easily). When writing more complex documents, it’s trivial for me to have the editor and mind-mapping windows side by side and see changes reflected immediately in both windows. A trivial example of this is shown here.

  1. Markdown headings (# Foo #) become levels in the outline. Older versions would strip “incorrect” levels (e.g. ### bar following # foo), but the newer version effectively corrects it to ## bar. (This is one instance where data would be lost, if that ### bar was important for some reason.) (NOTE: The MMD metadata base header level allows you to modify the #'s to <h>'s conversion. For example, setting it to 2 would mean that # means <h2> and ## becomes <h3>. This allows you to maintain the desired HTML while still having a valid outline structure that starts with a first level outline item.)

  2. Metadata is stored as a trailing metadata node at the end of the outline. The metadata itself is stored in the note attribute.

  3. Any text between headings is stored as the note for the preceding header. This includes whitespace, which allows preservation of your desired whitespace conventions (e.g. I like to have two blank lines after content and before the next heading, but others may prefer something different.)

  4. If there is content before the first heading in a document, this is stored as “Preamble” node, and the content is stored in the note attribute.

  5. No attempt is made to differentiate between Setext and ATX headers. Everything will end up as ATX when converting OPML back into plain text

To be clear – this is the official MultiMarkdown approach to converting MMD <-> OPML, but it doesn’t mean that others have to build compatible tools.

4 Likes