Tender and Lighthouse, like many other apps these days, use Markdown everywhere: whether you are replying to a customer, editing a KB article or writing a ticket, you are in Markdown land. Markdown is a great language, it’s simple to use yet powerful, but sometimes, writing a lot of it in a textarea is a little hard. So today, I’d like to share with you one of the tricks I use to make my life easier. This is Mac only, but I’m sure there are similar solutions for Windows user.
Note: this is for advanced users, who are comfortable using the command line, git, etc..
Step 1: Install Mou
Mou is a great Markdown editor for Mac: it’s simple, light and effective. Install it.
Step 2: Browser extension
There are a few extensions that allow you to edit any textfield/textarea in your favorite editor: I use Edit With Emacs (there is also TextAid). For Firefox users, you can look at It’s All Text.
Once the extension is installed, you should see a little edit button on the bottom left of textareas:
You can configure how to launch it in the options:
All these extensions rely on an
edit-server: a little program that runs on your computer and listens for requests. You need this program because browser extensions are not allowed to open external programs directly. They can however make an HTTP request, so they call
edit-server which in turn launches your editor.
Step 3: Install edit-server
You can find an
edit-server server on Github. Let’s install it in your home directory :
cd ~/ && mkdir scripts && \
git clone https://github.com/gfxmonk/edit-server.git
You can now launch it. The last argument tells the server which editor to use, so we’ll use Mou:
cd ~/scripts/edit-server && \
You are now ready to use it: if you click the edit button in any textarea, it should launch Mou. Do all your editing in Mou, and when you are done, simply save and close, and the text gets copied back into the textarea.
Step 4: Auto-launching edit-server
Mac OS X comes with a great launching utility:
launchd. Unfortunately, using it and configuring it is not always very easy. Fortunately, LaunchControl can make it easier.
Let’s use LaunchControl to create a new service that will launch our
edit-server automatically. Create a new User Agent:
You will need to drag two options from the sidebar: KeepAlive and EnvironmentVariables.
Set the different fields:
- Label: I like to use
- Program to run:
- Environment Variables:
EDIT_SERVER_EDITOR="open -W -a /Applications/Mou.app"
- KeepAlive: Keep alive no matter what
Finally, save and load.
Step 5: Enjoy!
And you’re good! Now, every time you start your computer, the
edit-server will be started for you automatically, and you can use the extension without thinking about it.
This will make your Markdown editing in Tender and Lighthouse a lot more pleasant ;)