This is a rake task for Redmine that uses pandoc to convert database content from Textile to Markdown formatting. The conversion is tweaked to adapt to Redmine's special features.
Because Redmine's textile is different than pandoc's textile, and because of some limitation in pandoc, the result will not be perfect, but it should be good enough to get you started. Here are some known limitations:
- Numbered lists containing
<pre>
blocks will lose their numbering (restarting at 1 after the<pre>
). Some complex cases will lose their list layout entirely. - Tables without proper headers will be rendered with an empty header
- Some interlaced formatting of inline code and bold will be messed up
<!-- -->
may appear in final ouput in a few places because Redmine incorrectly does not support HTML in markdown
-
Backup your database
-
Install the task:
cd $REDMINE_ROOT_DIRECTORY wget -P lib/tasks/ https://github.com/Ecodev/redmine_convert_textile_to_markown/raw/master/convert_textile_to_markdown.rake
-
Run the task:
bundle exec rake convert_textile_to_markdown RAILS_ENV=production
This script was built upon @sigmike answer on Stack Overflow, later slightly modified by Hugues C. and finally significantly completed by us.