Matteo Gavagnin

Blog

MacDown fork

I just forked MacDown, a popular open-source markdown editor for Mac as I have a few ideas to improve it to better suit my needs.

I’m looking to add some features that I wasn’t able to find in any other Mac editor to help me write blog posts. This blog like many others is powered by Jekyll, a ruby application capable to parse markdown formatted text files and generate a static website.

What I’m missing from MacDown is the ability to seamlessly write and preview my posts exactly1 as they will appear on the website. I’m currently able to do it with the combination of 7 apps:

  • Atom (or any other text editor like MacDown itself) to write the post and
  • Terminal, to run the command bundle exec guard that launches
  • Guard that tells
  • Jekyll to regenerate the pages as soon as the file is modified and saved to disk, and also run
  • guard-livereload that in combination with the
  • LiveReload Safari Extension can reload the page in
  • Safari as soon as a new version is available.

What I’m aiming for is to be able to reduce the amount of apps needed to obtain the same result. With just 40 added and 4 removed lines to the MacDown source code, I made a hack to remove from the workflow Atom, Guard, guard-livereload, the LiveReload Safari Extension and Safari itself reducing the needed apps to just three2.

  1. MacDown itself can live preview the document with a custom theme, or you can use Marked if you prefer to use a more capable external application. However using them you won’t be able to preview the page exactly as it will appear on your production website. 

  2. Full disclosure: I’ve also added Xcode as dependency because to change the file to preview I need to recompile the app, but that’s a rough hack, as I already said. 

Update all the things

I use this little script to keep my mac tools updated and clean. It works if you have Homebrew and ruby installed as standard user (I use rvm).

brew update
brew upgrade
brew cleanup
gem update
gem cleanup

 
twitter telegram github email
Leave this world a little better than you found it1