This article is about how I configured UltraEdit to work with editing of Markdown text files. Many other editors could be configured to work similarly, but the details of setting it up would differ. Behind the scenes, this setup is also using the python programming language. So, the prerequisites for this particular setup are: Use UltraEdit, Markdown, and python.
There are some decent text editors out there that are specifically designed to work with Markdown. I have tried MarkdownPad and StackEdit which runs in your browser. My thinking has been, I already have a good editor so is there are way to integrate markdown into Ultraedit?
Markdown is a plain text formatting syntax designed so that it optionally can be converted to HTML using a tool by the same name. Markdown is popularly used to format readme files, for writing messages in online discussion forums or in text editors for the quick creation of rich text documents.
For further details about Markdown, check out WhatIsMarkdown.com. You just have to love Markdown.
UltraEdit is a text editor from IDM Computer Solutions, Inc. that I have been using since it was at version 13. It is currently sitting at version 21. I have a long history with this particular editor and recommend it if you do a lot of serious text editing. It has made tremendous strides forward in functionality in the last two releases that really takes it over the top. UltraEdit is not a free tool, but well worth the $80 price tag.
UltraEdit uses "wordfiles" to implement syntax highlighting within the editor. I did not find a wordfile for markdown within UE's "Extras" download area. But, searching their forums, there was a forum article about creating a wordfile for markdown. The forum topic contains a preliminary Markdown wordfile that I downloaded and installed.
UE has an article detailing adding a wordfile to the editor that is helpful.
Once the wordfile is installed, editing a file with a filename extension of .md will show the various components of markdown highlighted.
Python Markdown tool
There is a python module for working with Markdown text within python. So, the first thing you will want to do is grab the python markdown tool and install it using the instructions at Installing Python-Markdown.
Become familiar with the command line syntax that can be used with the tool. That is the key to integrating it within UltraEdit or another text editor.
The basic syntax you will use from the command line is:
python -m markdown INPUTFILE -f OUTPUTFILE
INPUTFILE = your markdown text file. OUTPUTFILE = the name of an HTML file.
UltraEdit Advanced Tool Configuration
UltraEdit has a Tool menu where you can add external tools.
In UltraEdit, on the Advanced menu, select Tool Configuration. Add a new configuration for markdown and set the command line to:
j:\python27\App\python.exe -m markdown "%f" -f "%P%N.html"
In Ultraedit for Linux, the command line is:
/usr/bin/python -m markdown "%f" -f "%P%N.html"
Adjust the path to your installation of python as is appropriate.
So, now whenever you choose Advanced: Markdown from the menu in UltraEdit, it will take the current markdown file in the editor and save it as .HTML in the same folder as your markdown file.
Display the converted file in your browser
Finally, I just added a new tool in the Advance Tool Configuration to launch the browser and load in the newly created .html file.
In linux the tool configuration command line to launch Chromium is:
It took a little work to get it configured, but I now have a usable system within UltraEdit for working with Markdown files.