Writing in Markdown with ReText

If you've been reading my site The Plain Text Project, you know that I'm a heavy user of Markdown. I do a lot of writing with it. In fact, just about all of my writing is done with a text editor and Markdown. Mainly articles and blog posts, but also book chapters and editions of my weekly letter.

To be honest, I'm not one to use a dedicated Markdown editor. While I use a text editor called Emacs for my writing, I've also tried several dedicated Markdown editors. Most left me feeling cold. A few I found useful and worth taking a second or third look at.

One of those editors is ReText. While it's not the prettiest editor out there, ReText is a solid and capable tool with some useful features.

Let's take a closer look at it.

Downloading and Installing ReText

The easiest way to install ReText is to install it using your distribution's package manager. If it's not available from the package manager, you're not out of luck.

You can also install ReText by running this command:

pip3 install ReText

If you want to go old school and install it by hand, then you'll first need to install these Python packages on your computer:

The first two are often standard kit in many Linux distributions, but check your package manager just to be safe.

Then head on over to the editor's download page and grab the latest version. That's 7.0.4 at the time I wrote this post. Once you've done that, extract the archive to a directory.

From there, pop open a terminal and navigate to the directory where you extracted the ReText archive. Type this command to install it:

sudo python setup.py

If all goes well, ReText should install. From there, launch the editor:

A new document in ReText

Getting to Work

That means typing. There are no toolbar buttons that let you automatically add Markdown formatting. You do that manually or using the Formatting dropdown list. There's also a list with which you can add some HTML entities.

If you have files formatted with Markdown, keep in mind that ReText only recognizes files with the extension .md. All of mine have the extension .text. Yes, I was momentarily a bit frustrated ...

You'll notice that ReText only has rudimentary syntax highlighting. I find highlighting very useful, no matter what markup language I'm working with. Here's hoping ReText's developers add more robust syntax highlighting to a future version.

Editing a document in ReText

ReText also has a live spelling checker, which puts a squiggly red line underneath words that you misspell. You can turn it on and off by selecting Edit > Spell Check > Enable. The spelling checker only highlights what it perceives as errors. You can't, for example, right click on a word to get suggested corrections.

Previewing Your Work

When you're using something like Markdown, your goal is to eventually convert your document to HTML. But if you want a peek at what it will look like without running a Markdown processor, you can do that in ReText.

How? Click the Preview button on the toolbar.

Previewing a document in ReText

You can also get a live preview, which updates as you type, by selecting Edit > Live Preview.

A live preview of a document in ReText

In both images, the document I'm editing is formatted using a CSS file that I use with my weekly letter. You can change the CSS file for the preview by selecting Edit > Preferences and then selecting the Stylesheet file.

If you don't have a CSS file handy, or if your CSS kung fu is rusty, you can grab one of these CSS files that you can edit to suit your needs.

Converting Your Files

When you're done writing, you can export your document to the following formats:

Just select File > Export then choose one of the options.

The results of the PDF conversion aren't too bad at all:

A PDF file exported from ReText

In case you're wondering, the ODT export looks much the same.

With PDF and ODT output, the look and feel of the final document changes depending on the CSS file you've pointed ReText to in its preferences. The example above uses a CSS file I use with my weekly letter.

Is That It?

No. ReText also has a few other features, which you can learn about here. I don't use those features, and probably never will. But just in case you're curious ...

As I mentioned at the start of this post, I don't use a dedicated Markdown editor. That said, I found ReText to a very useful tool. It can make writing with Markdown quite a bit easier.

Scott Nesbitt

#FOSS #opensource #writing #markdown