Maintaining an open source project at the Guardian

Scribe is the most popular in-house open source project in the Guardian. Recently community developers have been making some major contributions to the project, confirming the value of open-source and the benefit of the Guardian of being open about our work.

Robert Rees

Published on Friday, 29 May 2015

Computing   Open source   Programming   Scribe  

Children sharing a snack
Children sharing a snack Photograph: Ben Grey/flickr

Over the 2015 Easter holiday the Scribe project received more than 3000 stars (a combination of bookmarking, liking and favouriting) on Github, making it easily one of the most popular open-source projects we have created at the Guardian.

In addition to that milestone we also celebrated the release to our internal production systems of a number of community-contributed changes to Scribe. Guardian journalists now benefit every day from participation in the open-source community!

With what Scribe’s achieved, it’s worth taking a look at the ups and downs of open-sourcing software and of the Scribe project itself.

What is Scribe?

Scribe is a polyfill (although sometimes it has a touch of the shim about it) for the Content Editable spec (MDN | HTMLDoctor). Content Editable allows blocks in a web page to become editable directly in the browser, and in some ways it is the culmination of Tim Berners-Lee’s vision of the read-write web.

As a polyfill Scribe exists to make the behaviour of Content Editable consistent across browsers. You can read more about Scribe in our original Developer Blog post about it.

Expanding Scribe with Plugins

When you add in its eco-system of plugins then Scribe is a powerful and complete web editor. The link above is just to the plugins that the Guardian development team maintains. A number of other developers have created their own plugins to meet the needs of their own users.

Ankit Ahuja from Coursera has written about how Scribe has been used to create course material. Even better, the Coursera plugins have been open-sourced, so if you want to add a table in Scribe you can simply load the existing plugin.

A combination of plugin configuration and the ability to fork an existing plugin means that it is possible to create bespoke behaviour easily.

Recent contributions

Plugins are not the only place that people are making contributions to Scribe. Recently we wanted to try and change our default undo manager – our users were frustrated by the default behaviour which was to undo one character at a time. A very safe choice but not suitable for journalists who wanted something a bit more dynamic. Enter Abdulrahman Alsaleh who submitted a PR that attempted to address our tentative issue on the subject whilst also scratching his own itch in classic open-source style. Getting the pull request into the code base involved effort from both ourselves and Abdulrahman but, when it finally landed, our users loved it and we had saved a lot of effort having to code it entirely by ourselves.

Another great recent contribution came from David Tobin who submitted a PR that allows Scribe instances to control what default plugins are loaded in a base Scribe instance. By default we choose a setup that matches what we want for the Guardian but we always realised that some of those baked-in rules ran contrary to other people’s expectations.

The configuration contribution was less user-facing and more aimed at the developer community that exists around Scribe. Making it easier for people to use and build on what we had already built and making it more valuable to the community. Such contributions help develop the software we collectively own rather than waiting for Guardian developers to find the time to address an issue that doesn’t directly affect our use of Scribe.

Both contributions show the immense value and potential of open-source software to organisations like the Guardian. It is great for an organisation to be able to open repositories as freely as we have done and it feels even better when that openness is rewarded with collaboration and contributions from the community.

To those people who make this possible: thank you.

Continue reading

Designing in the dark: How we created the Guardian App for Apple Watch Announcing the Guardian's digital networking event