-
-
Save njm2112/4cea1aae5343fb6db0f14c7b9ebf9a1d to your computer and use it in GitHub Desktop.
Convert a Mindjet MindManager text outline export to Markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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