8

I want to convert text written in Markdown to Rich Text on Ubuntu 13.04. I could not find any solution on the web, except for one Mac OS X script.

How can I do that on Ubuntu 13.04? Preferably in the browser.

P.S. I don't need it the other way, the text gets always written in Markdown and needs to get transformed to rich text.

12

One alternative is http://johnmacfarlane.net/pandoc/ which is in the repos,

sudo apt-get install pandoc

Then you can take your markdown file and convert it to rtf, or a variety of other formats with,

pandoc -s -f markdown -t rtf -o file.rtf file.txt

The -s switch is for standalone, so that it doesn't just create an rtf fragment. There are also a variety of other useful switches such as -S for smart quotes. I use it all the time to create epub and pdf files.

It would also be a good idea to check out the documentation on their site, since the pandoc markdown format supports several extensions.

  • 2
    Pandoc is probably the best utility for this kind of work, good answer – Sabacon Jul 3 '13 at 18:50
  • Buggy tool. Randomly misses line breaks, item blocks and titles. – Luís de Sousa Dec 11 '17 at 7:55
0

You could try a two-step approach. Open your markdown file in ReText (available from the Software Center) and export in .odt format. Then open the .odt file in LibreOffice Writer which allows saving as rtf.

ReText is a text editor for Markdown and reStructuredText markup languages, written in Python.

Features:
* Full Markdown and reStructuredText support
* Markdown extensions support
* Supported export formats:
   - HTML
   - PDF
   - ODT (OpenDocument Text)
   - Webpages generation
* Tabs and Live preview
* CSS styles support
* Syntax highlighting
* Tags and symbols boxes for quick insert
* Page breaks support (for Markdown)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.