Skip to content

Instantly share code, notes, and snippets.

Last active February 16, 2017 17:25
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Prose-only Blocks
license: none

You can now create prose-only blocks on by creating a Gist with a single file: When your Gist is missing an index.html file, <> will hide the example iframe but continue to display everything else. And thus you can use your README as a quick and convenient way of posting text with less clutter than the default GitHub UI.

Funnily enough, I added this feature because the GitHub Gist API recently developed a bug: when listing a user’s gists, the files hash for each gist is empty. I previously filtered gists based on the presence of an index.html file. By removing the filter, is now immune to the bug, but I had to make a corresponding change to the Gist display page.

Oh, and you can still embed code in your prose, and it will be syntax-highlighted:

function shuffle(array) {
  var m = array.length, t, i;

  // While there remain elements to shuffle…
  while (m) {

    // Pick a remaining element…
    i = Math.floor(Math.random() * m--);

    // And swap it with the current element.
    t = array[m];
    array[m] = array[i];
    array[i] = t;

  return array;

You can also have additional files, and their source will be rendered as well. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment