Porting Monokai colour scheme to WeBuilder 2014

WeBuilder 2014 beta 7 with the new Monokai theme
WeBuilder 2014 beta 7 with the new Monokai theme

I have been using Blumentals WeBuilder now since March 2006—nearly seven years. It’s a solid web code editor and IDE (integrated development environment) but over the last couple of years it has been creaking at the seams a little. Some features were quite slow, others weren’t keeping up with the astonishing rate of change that the web standards have been going through of late.

So, over the last year or so the Blumentals team have been rebuilding the application from scratch, moving to a more up-to-date code base (they code it in Delphi, I believe) making it much faster and preparing the way for future enhancements and improvements. And boy! does it show. The new version is looking great. But I’ll get to that in a minute.

While they were working on what will soon be released as WeBuilder 2014 I found myself—as I do every six months or so—looking around at competing web IDEs to see what they were up to. I tried the usual candidates: Aptana, CodeLobster, Notepad++, NetBeans, Komodo Edit, etc. but nothing grabbed me until I stumbled on Sublime Text 2.

Wow! Sublime Text 2 is fast. Lightning fast. And it’s packed with features, and what it does’t have there is usually an add-on for it — which is most easily installed via the Sublime Package Control. But I digress.

I found myself using Sublime Text 2 more and more, and one of the things that I loved most about it was one of the in-built colour schemes: Monokai (based on a TextMate theme by Wimer Hazenberg). I had never used a dark theme before on an editor, but this one I really liked, and it was much easier on my eyes than the glaring white themes I’ve been using in the past.

Porting Monokai to WeBuilder

When WeBuilder 2014 was released in beta, owner and developer Karlis Blumentals invited users to create and submit colour schemes for WeBuilder (a new feature in 2014). So I set about porting the Monokai theme to WeBuilder.

Every code editor highlights its code syntax slightly differently. The code highlighting in Sublime Text is pretty simple, defining the same colours for a number of elements regardless of the language. So, for example, all strings are #e6db74 (yellow), all keywords are #f92672 (dark pink), etc.

WeBuilder’s colour schemes are more granular: if you want HTML elements within a PHP document to look different to HTML elements within an HTML or ASP document then you can in WeBuilder.

Also, the way that code elements are broken up into different syntax colours is slightly different between editors. It’s more-or-less impossible to port one theme to another editor exactly colour-for-colour, element-for-element. I decided, then, to try to keep within the spirit of the theme.

I relalised fairly quickly, therefore, that I needed to keep things as consistent as I could across all languages. So all strings would be yellow (#e6db74), all numbers (integer or floating) purple (#ae81ff), all HTML tags or language reserved words would be dark pink (#f92672), etc.

I created a spreadsheet to plan things out and document what I was doing.

Spreadsheet of many colours
Spreadsheet of many colours

That really helped. Especially when I did something wrong and reset my entire colour scheme to system defaults. Having documented it as I went along it only took me about 45 minutes to retype it. (A back-up would have been useful, huh!)

I’m really pleased with how they turned out, to be honest. And it would appear that Blumentals Software are too.

Available now

I passed the file to Blumentals last week and it’s already been incorporated into beta 7, which is currently available for download. (The beta versions are free while errors are being addressed, the final version will be available to purchase.)

To say thank you for what I did I received this kind email from @blumentals the other day:

@garethjms - you have earned a free upgrade to v2014 by porting Monokai scheme for our editor
@garethjms – you have earned a free upgrade to v2014 by porting Monokai scheme for our editor

How wonderfully generous of them. I was so delighted by their generosity. I simply did it because I really like the colour scheme, and I wanted in a small way to say thank you to Blumentals for all that they’ve given to the web building community over the last 6+ years.

More themes…

I’m starting work on porting another couple of themes now: Twilight (also used in Sublime Text 2) and Tomorrow, which is a lovely collection of dark and light themes.

A retrospective on 2012

My bedside table
A view that I saw far too much of in 2012.

I’ve never been a massive fan of new year, even after my dad died shortly after 1998 began. I’ve always preferred Christmas Day. It’s the reason for the season, so they say. At least, it’s one of the reasons. I never really enjoyed sitting around while my mates got drunk, I never really got into the whole new year resolutions thing, and for me it was really just another day (albeit it one where the shops were closed, and we always ate steak pie).

Health

But twelve months ago, as 2011 rolled into 2012 I decided that this was going to be good year. I was determined that it would be a good year. “This is the year that I get fit,” I decided.

However, 2012 wasn’t the year that I got fit, and not for want of trying. In between periods of intense back pain in February/March and trapping two nerves (C6 and C7) when my twin boys, Reuben and Joshua, jumped onto my neck on the sofa in June, I managed to get out on my bike as much as I could and even lifted my dumbell weights a few times.

But I slowly realised that I was actually becoming afraid of doing any exercise. Whenever I did any kind of moderate exercise I would shortly after come down with a cold, or pull a muscle, or injure my back. It was incredibly frustrating. I even asked my renal consultant about it (I have polycystic kidney disease) but she wasn’t interested and told me quite clearly that that shouldn’t happen. “But it does,” I said. “But it shouldn’t…!” But it does, and it has continued to do so.

During 2012 I spent £420 on private physiotherapy. Having been diagnosed with trapped nerves by a stand-in GP who told me to take some time off work, see if things get better, and if they don’t improve within six weeks come back, I phoned the physio the following day, shortly after both my arms went completely numb.

I felt desperate. I didn’t want to have to wait the three months or so I had to when my lower back went in September 2011. I phoned, explained what was going on and the receptionist kindly said, “I’m really sorry, but I won’t be able to squeeze you in until tomorrow.”

“Tomorrow?! That’s brilliant.”

I saw a chap called Clayton Hardisty in St Andrews. He was excellent. I told him what I thought were the vaguest of symptoms and within minutes he had both diagnosed and confirmed what the problem was. And it all stemmed from my bad posture. I’m 6’4″ and for years I’ve apologised for my height. No longer. I now sit and stand tall, and what a difference it has made. I’ve not thought about my posture so much since I sang in the National Youth Choir of Great Britain.

I was signed off work for 60 work days in all, to give my body the chance to rest and recover. I returned to work on a phased return programme: two weeks half-time, two weeks three-quarters time, then back full-time.

Then the week after I was discharged by occupational health, I came down with the ‘flu. Like, proper ‘flu with all the symptoms, and a temperature of 39.8°C. And then a chest infection. And then a tummy bug. Rubbish!

Family

Clockwise from top: Joshua, Isaac and Reuben.
Clockwise from top: Joshua, Isaac and Reuben.

What has got me through this past year of one health frustration after another is my faith and my family.

Reuben and Joshua turned four in November, Isaac turns two later this month (late-January). While we have had our fair share of ups and downs with them (I imagine no more than the next family), particularly as they fight one another and jostle for attention, they remain my little delights. I have enjoyed nothing better this Christmas and new year holiday than cuddling up on the sofa with all three of them and watching films and silly children’s programmes.

And Jane has been amazing this year; I love her very much, and more so each year. As well as living with and trying to manage depression, she’s had to put up with me recovering at home, as well as refereeing children and escorting them from one engagement to the next; they have a far better social life than we do. She’s amazing.

So… 2013. Two-thousand and thirteen, that’s the year I get fit. Oh yes. And the year that I continue to try to be better at putting my family first. Here’s to a much better year.

What would also make it better, or at least neater, would be to always write the year as 0123.