Using Retext with Multi-Markdown

config (1)
Dmitry Shachnev tnanek christianurich

I prefer to use Multi-Markdown for my specific syntax. This is a guide for others who wish to set it up in a sane way without reinventing the wheel.

First off, proper credit. Multi-markdown is a project maintained by Fletcher Penny. This guide will be presuming you have his Multi-Markdown and accessory commands installed and functioning.

The syntax guide is on github.

Anyhow, first thing to do, once you have multimarkdown functioning for your system, is to create an Export Extension.

Create ~/.local/share/retext/export-extensions/multimarkdown.desktop file and put the following contents there:

[Desktop Entry]
Name=HTML (MultiMarkdown)
Exec=/usr/local/bin/multimarkdown -o %of %if
X-ReText-FileFilter=HTML Files (*.htm *.html)

However, in practice that will not overwrite a file already saved, dispite having to confirm it.

My solution was a simple bash script (I am using a Xubuntu machine). Below is the source of my script as well as the final export command.

Script (Saved at /usr/local/bin/retext-mmd2html):

# Remove the file should it already exist.
if [ -f $1 ]; then
  rm $1
# Create the file, using the absolute path to the multimarkdown command
/usr/local/bin/multimarkdown -o $1 $2

Contents of extension file when using this script:

[Desktop Entry]
Name=HTML (MultiMarkdown)
Exec=/usr/local/bin/retext-mmd2html %of %if
X-ReText-FileFilter=HTML Files (*.htm *.html)

If you want to make use of the other multi-markdown export options, just add the appropriate -t option to the script. Also, make sure to remember to chmod the script so you can execute it.


  • Dmitry Shachnev

    Dmitry Shachnev - 2012-03-11

    Thank you for this guide!

    [Export] section of configuration file is deprecated and support for it will be removed in the next major release. Please, use [Export Extensions] instead.

    Can I please update this page to mention the new way (or you will do it yourself)?



    Wiki: Export Extensions

  • Dmitry Shachnev

    Dmitry Shachnev - 2012-03-13


    A better way to combine commands will be using

    sh -c "command1; command2"

    but this doesn't work either… I will look at ways to fix it.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks