Convert Textile Markup to Markdown?

会有一股神秘感。 提交于 2019-12-03 09:06:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!