Playing with Jekyll and the cloud 9 IDE
I have been trying to find the right system to work with jekyll and markup - which I use for this blog, along with the ODM Solutions and Orionrobots systems.
My requirements are that it runs on my laptop (which is natively windows), it supports markup, and that it plays well with Jekyll. Stuff like decent JS/HTML/CSS editing, browser preview windows, console windows all help.
Finding that Jekyll and windows is a bit tricky, I opted actually to work with a linux VM running in Hyper V (Windows 8.1 didn’t seem to play so well with virtualbox). I was using Jekyll on my old system, and via ssh, but I wanted something a bit more responsive.
Getting Jekyll running
Jekyll is a ruby tool. The first thing is DO NOT install the version in the OS. It will be extremely out of date, and will not be compatible with the version on Github (my target version). You can perform a completely local install of this so you won’t interfere with the OS.
First use apt-get to install ruby, rubygems, and build essential.
The do a gem –user-install jekyll. You will be advised on the user install help for gem to put some stuff in your bash profile - works a treat. Jekyll runs without a hitch.,
This was trickier with a bit of faff.
Cloud 9 is based on node, and needs installing with npm (node package management). However, yet again, the version of node and npm on the OS will be too out of date to be able to run cloud 9.
I found a number of tutorials on installing cloud 9 on previous versions of Ubuntu - but the one on the github readme for the project works best.
First use this method to install node: http://hostadvice.com/blog/how-to-install-node-js-on-an-ubuntu-15-10-or-14-04/
Then follow up with this:
You will also need to have installed the git and mercurial packages with apt. Other than the apt-get bits, I kept all of it installed in my user directory, and therefore did not need to sudo.
If you see errors, like I initially did - ensure you have installed mercurial.
If you have a git error actually getting cloud9 from github - you may want to add –depth=1 to the clone. I found oddly that everything up to depth=84 was fine, and something on the 85th breaks stuff. Since all the current tags and master are more recent, this is not a problem.
First I used git to clone my projects, then you start cloud9 - use the “-w” option to specify the projects workspace.
I pointed my browser at the running cloud9 instance and logged in.
I was then able to use the console to start jekyll with:
jekyll serve -w -H <ip>
You don’t need the last option, but since this displays the url with the IP in the console, you can click through to use the browser frame and see your site. Nice.
Now I need to do a couple of other things - configure the system to automatically start my cloud9 system, or a wrapper from the web to start different workspaces (like the online cloud9 setup), and a run configuration to start jekyll inside cloud 9 and show the url without doing the console bit. This would make for a really handy IDE.
Why not one running in windows directly?
Pycharm runs beautifully on windows, and makes for a reasonably decent markdown IDE. However, Jekyll runs a bit badly on windows, and specifically bits of jekyll functionality, like the auto-refresh in runserver, do not work without much hackery.
I already had a linux VM - although my laptop cannot be made to boot linux, it provides some of the services I need with a hyper V vm, and lets face it, for running servers and script based apps, or git integrated things, Windows is not really the go-to OS.
That and maybe I just like tinkering around with server side tools on Linux boxes…
If you are used to an IDE like Jetbrains, you will miss the really good scm integration. CLoud 9 just prefills a part command line with a git command in the console below, and doesn’t integrate the scm directly.
blog comments powered by Disqus