Created
September 12, 2014 14:18
-
-
Save tylerball/0a443dd30826f20700a3 to your computer and use it in GitHub Desktop.
I had a bunch of jekyll posts written in textile with yaml frontmatter I needed to convert 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
require 'preamble' | |
require 'pandoc-ruby' | |
Dir.glob('*.textile').each do |file| | |
front = Preamble.load(file) | |
converter = PandocRuby.new(front.content, from: :textile, to: :markdown) | |
markdown = converter.convert | |
new_file = Preamble.new(front.metadata, markdown) | |
new_file.save(file.sub('textile', 'markdown')) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment