Publishing Articles Using Gists

  1. Not only does GitHub provide standard Git repositories, it also provides Gists: pasting text into an input box creates a file in a new Git repository, which can then be cloned and updated like any other repository, edited locally or in an online editor, with revision tracking. It's meant for small, self-contained items.

  2. Mike Bostock's bl.ocks.org is built on top of Gists. It takes the HTML, CSS and JS files from a Gist, displays the highlighted source code, and runs the code above it. It's meant for publishing visualisations built with D3 (and similar libraries).

  3. Inspired by bl.ocks.org, I realised it was possible to publish articles as XML in Gists. I created macrodocs.org (code in GitHub), which fetches a Gist, looks for a file called article.xml in the JATS/NLM XML format, converts it to HTML and displays the article.

Here's an example Gist and the corresponding HTML article.

Note: macrodocs.org needs some testing, so might not work in browsers other than Chrome - I think IE9 uses a different method for transforming XML documents.