Tag Archives: Markdown

OPML to Markdown

I’ve started using mind maps for various things and wanted to use them for taking minutes in meetings. The issue is that we usually record minutes in a markdown text format so I needed to be able to convert from a mind map to markdown. A quick Google gave me an example Gist in python, but it didn’t work on my Mac. On top of that, once I’d fixed those issues, it wasn’t really outputting things in markdown, just plain text.

I fixed up the code so it now goes from OMPL to Markdown using the root node as the document title, and presents the rest of the nodes as a nested list.

For a given example map:

Example

We get the output:

# Example Map

* 1st Level Child
    * 2nd Level Sibling
    * Another 2nd Level Sibling
* Another 1st Level Child
    * Sibling on Level 2
        * Sibling on Level 3

I’ve actually gone one further locally by setting #!/usr/local/bin/python at the top, moving the script to /usr/local/bin/opml2md, setting chmod 755 and putting some basic argument checking in place. I’ll leave those changes as an exercise for the reader as some bits are specific to my OSX install.

Blogging with Markdown

I was introduced to Markdown by GitHub a couple of years ago and instantly found it to be a very friendly method of formatting a document. A veteran of a number of Wiki markup styles I’ve managed to whittle the list down to two: Confluence style which is used at work, and Markdown, which I try and use everywhere else. The exception was blog posts.

Although I have the WordPress app on my iDevices (which are able to connect to the internet via a mobile signal) I find myself writing most of my posts on my laptop on the train – good though the iOS keyboard is, it just cannot compete with a real keyboard. Being a geek I write the posts in plain text and just do the markup by hand. This is a bit of a pain. This morning, while drafting a post I found myself copying text formatted using Markdown and redoing the formatting in HTML. After the second line I stopped, Googled “markdown editors for WordPress” on my iPad and shortly after arriving in the office had Markdown on Save Improved installed. I can now draft posts offline in Markdown using TextMate which, I discovered to my great joy the other day, supports Markdown formatting and rendering.

Incidentally the reference method of creating links really helps when writing offline as you can sprinkle the anchors in your text as you write, jot an empty reference at the bottom of your text and then add the URLs when you have internet access.