MultiMarkdown and OmniOutliner
Introduction
I used to use OmniOutliner for document authoring with Markdown, but have since moved on to a combination of TextMate and Scrivener as I further developed MultiMarkdown and wanted a bit more. OmniOutliner is a great program, but it just didn’t suit my needs. But it might work very well for you, and many people already have it installed on their mac. To learn more about my personal preferences, check out My MultiMarkdown Workflow.
So I created an Export plugin for OmniOutliner that allows you to save your outline as Markdown formatted text. The hierarchy of the outline becomes the structure of the document, allowing you to reorganize your paper very easily.
Where to Get It
Note: There are actually two versions of the export function included. In the text only version, images can be included, but must be handled manually. In the version with attachments, you can include images in your OmniOutliner document that will be exported. There is a single bundle with both versions.
How to use this
- Install the plugin (see the OmniOutliner directions), but I recommend placing in:
~/Library/Application Support/OmniOutliner 3/Plug-Ins
Create an outline
Export it as Markdown text
Special Features
The outline hierarchy is converted into headers of appropriate depths.
Notes are added as plain text after the header.
Metadata
In order to use the metadata feature of MultiMarkdown, the last top level item in the outline should be called Metadata, and each sub-item is the name of the key. The notes are the data for that key. In particular, the Title, and Format keys are of use. Set Format to complete if you want to have MultiMarkdown generate an entire HTML file, complete with header, etc.
Example:
First Item
Second Item
Sub-Item
Metadata
Title (with note containing your document's name)
Format (with note containing "complete")
Private Notes
You can use the outline to store notes that are NOT exported to the Markdown document by naming that section of the outline My Notes (not case sensitive).
One thing to remember is that Note sections ARE counted in the numbering scheme within OO, but are NOT counted (obviously) in the exported version. This could lead to numbering discrepancies between the original outline and the final version. To avoid this (if it matters to you), I recommend ensuring that the Private Note sections be included as the last (or only) children at any given level.
Images
It is possible to include images in your OmniOutliner document that are exported appropriately. If you export using the “Folder” version, you will end up with a folder that includes a Markdown text file, index.text file,`, as well as copies of all the attachments in your OmniOutliner document. If your image is included in an “active” part of the OO document, it will be automatically included in the Markdown output. Note, however, that this approach does not allow you to include a caption.
Instead, you could put the image in a My Notes section - the image will be exported, but not included in the text. You can then hand create a Markdown image reference, allowing a caption. For example, if you add an image named image-name.png, you can reference it in your document:

To Do
Toying with idea of using the status box to determine whether to export a section or not
It could be useful to write a script that would convert a Markdown text document to an OmniOutliner document, or at least a format that OO could import (I need to look into the XML import format for OO). OPML is not a great choice, because whitespace gets screwed up. This could allow you to take existing Markdown text documents, and convert them back into a more useful format (IMHO).
Bugs
I am sure there are bugs hiding around - the OmniOutliner XML format seems unnecessarily complicated (at least for a newbie to XSLT), and I’m sure I have misinterpreted a few things along the way. Additionally, I had to jump through some hoops as it doesn’t work the same way as the xsltproc tool that I had been using. If you find any unusual behaviors, please let me know. Even better would be an example of what you think the correct code should be. ;)
When Omni changed the XSLT processing engine, it screwed up the use of the last() function, which subsequently screws up certain things with this plugin. Specifically, if you have a section of your outline named Metadata it gets stripped out. I’ll try and work on this at some point, but mainly Apple needs to upgrade xsltproc to the latest version.
Version History
1.1r2 - I grudgingly hacked the plugin to make it work with the version of xsltproc that ships with Mac OS X, and does not properly support the
last()function…. Note: it should work properly with OmniOutliner 3.5b2 and beyond.1.1 - combine both formats into a single plug-in
1.0 - initial public release
Leave a comment