问题
I'm merging legacy Systems and some components use Markdown and others use Textile formatting. This is extremely confusing to my users. Therefore I want to standardize on Markdown.
Is there a way to convert at least the Bulk of Textile formatting to markdown automatically?
回答1:
Because Markdown and Textile are both meant to produce HTML, consider converting all Texile to HTML first. There are a number of Markdown implementations which also support converting HTML back to Markdown. Pandoc being one example. Another possible solution would be using XSLT.
Because Textile is more verbose than Markdown, some elements (like tables) will stay marked up as HTML, which is perfectly fine with Markdown but may also be a source of confusion for your users.
回答2:
The forthcoming pandoc 1.8 (or the current github version) can convert Textile to Markdown directly. I don't know how much of Textile it handles, but
pandoc index.textile -o index.markdown
worked nicely here.
来源:https://stackoverflow.com/questions/2839304/convert-textile-markup-to-markdown