Skip to content

Instantly share code, notes, and snippets.

@njm2112
Forked from ttscoff/mmoutline2md.rb
Created January 18, 2017 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njm2112/4cea1aae5343fb6db0f14c7b9ebf9a1d to your computer and use it in GitHub Desktop.
Save njm2112/4cea1aae5343fb6db0f14c7b9ebf9a1d 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