Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Created August 22, 2013 14:37
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ttscoff/6308043 to your computer and use it in GitHub Desktop.
Save ttscoff/6308043 to your computer and use it in GitHub Desktop.
Convert a Mindjet MindManager text outline export to Markdown
#!/usr/bin/env ruby
input = STDIN.read
input.gsub!(/^\=+\n ?(.*?)\n\=+/,"# \\1")
input.gsub!(/^-+\n\d+ (.*?)\n-+/,"## \\1")
input.gsub!(/^\d+\.\d+ (.*)/,"### \\1")
input.gsub!(/^\d+\.\d+\./,"@")
input.gsub!(/^@\d+ /,"- ")
input.gsub!(/^@\d+\.\d+ /,"\t- ")
input.gsub!(/^@\d+\.\d+\.\d+ /,"\t\t- ")
input.gsub!(/^@\d+\.\d+\.\d+\.\d+ /,"\t\t\t- ")
print input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment