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:
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
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.