By josh / May 1, 2014

So what does it take to write a top 100 Sublime Text plugin?

Before I knew any better, I used to write the HTML for my blog posts by hand. Yeah, I could have done the markup in the WordPress editor, but I did a lot of my blogging while sitting in a stifling hot bus, commuting to my former job in downtown Pittsburgh. So, no Internet. And besides, working with the WordPress WYSIWYG editor at the time was pure P.A.I.N.

I discovered Markdown right around the time I started using Sublime, and I fell in love with it instantly. Sublime and Markdown–what a great way to write! I use that pair for everything these days.

When you’re using Markdown, it’s great to be able to view your work as it’ll be rendered, and there are several Sublime plugins that allow you to open the file you’re editing in the browser for viewing.

One of the most popular of these is called simply Markdown Preview. It’s one of the top 100 most popular plugins for Sublime, and it’s been installed more than 86,000 times.

To find out what goes into making a top 100 plugin, I interviewed the creator of Markdown Preview, Julien Bouquillon.

Here’s what he had to say.


Tell me a bit about yourself (name, current job, blog, Twitter, etc.).

Hi there ๐Ÿ™‚ I’m Julien, an avid full-stack web developer sublime-text fan and open-source promoter based in Paris, France and you may know me as @revolunet on the interwebs. I often tweet on @revolunet and sometimes blog on http://blog.revolunet.com. After intense code rushs i love to let off steam by spending time with my family and do some english-style boxing. You should too ๐Ÿ™‚

Whatโ€™s the name of your plugin? What does it do? (If you have written several, pick your favorite.)

My most popular plugin is Markdown Preview; it’s a simple plugin that lets you edit and preview your markdown files in real time right from your favorite editor.

How did you get the idea for your plugin?

Thanks to GitHub, the Markdown syntax became quickly popular and there were no Markdown Preview plugin for Sublime at that time (early 2012). As every open source developer i got used to write more and more README.md files and documentations using that simple but effective syntax, and i was missing an integrated preview tool in my editor.

How much time did you spend writing the first version?

I’m a huge Python fan since a long time and it’s quite easy to implement a basic Sublime plugin so the first plugin implementation which was quite primitive, had only 19 lines of Python and was just a couple of hours work. Most of the time was spent into understanding the Sublime settings/packaging/commands system.

Did you think building a plugin would be difficult? Was it easier or harder than you thought it would be?

Implementing a basic plugin is really a piece of cake with Sublime Text; The plugin API is basic but covers every aspect you need. You can also easily inspect the others plugins source to learn from them, this is very informative.

What was the most challenging part of building your plugin?

The challenges grew with time : More and more features for and by the community, and the release of Sublime Text 3, with a different API, and a different Python version. Also, ST is a multi-OS application so you sometimes have to deal with OS-specific issues that are not easy to test and debug. Most of the headaches came from maintaining the same packaging and the plugin stability over the various OS, versions and configurations. Now the unit testing part is still a mystery for me in the Sublime Text context and i need to dig into a testing framework like https://github.com/guillermooo/AAAPT.

What was your favorite part of creating your plugin?

It’s always rewarding for a developer to have real users on a project, and have them smart enough to submit issues or pull requests on Github. It’s the first time i experienced the real power of open source, in which Github plays a big role. For this reason i now open source as much code as possible. Managing the open-source “flow” is time consuming and not easy but interesting and exciting; Having so much goodwill from anywhere in the world to give a hand to improve your work is simply amazing.

Did you learn anything along the way that you wish youโ€™d know when you were starting out?

I wish i knew Python 3 and read every single Sublime Text changelog to anticipate compatibility issues. A testing framework would also have been useful to prevent basic regression bugs.

Did your plugin grow or change as you built it? Did you have to modify your plans based on what the Sublime plugin APIs could do?

This plugin grew a lot in 2 years; We added the ability to choose the markdown parser and extensions, integrated the github flavoured markdown API, LiveReload for the browser, MathJax support, syntax highlighting, custom templates and CSS… And the Sublime API has never been limiting for this plugin. I only wish we had a common plugin API for ST2 and ST3, or at least a helper class that i started to work but never had time to release properly.

I really encourage you to learn Python which is an easy yet powerful language, and its useful for a LOT of applications. To start creating a ST plugin, choose a simple plugin example, clone it into your ST Packages folder, and code your own ๐Ÿ™‚ The ST console is your best friend !


Thanks, Julien!

If you have a plugin idea that you’ve been thinking about but you aren’t quite sure where to start, Writing Sublime Plugins can help speed you on your way. Pick up your copy today:

http://writingsublimeplugins.com

P.S. If you’re more interested in using plugins than writing them, go here instead:

http://sublimetexttips.com/newsletter

About the author

josh

Click here to add a comment

Leave a comment: