Save a GitHub gist, keep the code
Summary
Readability is the library behind Firefox's reader view, and it's the extractor Readplace builds on to find the article in a page. On a GitHub gist, it was finding the buttons.
The failed-articles canary raised it first: a gist save ending unreadable, with nothing worth serving in the copy. The gists that had saved without complaint looked worse. Some of those stored copies held the Star and Fork links, the clone box and "You must be signed in to star a gist", and none of the code the link was saved for.
A failed save at least says so.
The quieter failure was the gist marked ready whose copy held the chrome: the card looked fine in the readlist, and the first sign of trouble came at reading time, with the code missing and buttons in its place.
The buttons outscored the code
A gist page keeps each file in the same line-numbered table as any GitHub code view. Every line sits in its own table cell, beside the cell holding its number.
Readability scores the blocks of a page by how much they look like prose. A block earns points for its paragraph tags, its commas and the sheer length of its text. A table of short code lines does badly on all of it, and the header above, with its author line and its sign-in tooltips, reads closer to sentences than the code does.
A long file still comes out ahead on volume alone. Gists are rarely long files. The snippet a thread passes around runs 2 lines, or 10, or one config block, and at that size the chrome weighs more than the content.
A detector built for prose reads a short gist's page and keeps the part that sounds like sentences.
The page is rebuilt before any scoring
A rule for gist.github.com now takes the page apart ahead of Readability. The gist's description becomes the heading, and a gist with no description is titled by its file. Each file follows under its own name. A Markdown file stays rendered, with its headings and lists. Any other file becomes a single code block, its lines joined in the order they were written, line numbers dropped.
The warning GitHub prints over some files, about bidirectional Unicode characters, goes too. So do Star, Fork, the embed box and the invitation to sign up and comment. What remains is what the author wrote, and that's the page Readability is handed.
A gist address that answers with no files, a deleted gist or a mistyped link, skips the rule and goes to the regular parser, so an error page comes through as what it is.
One limit sits in plain view: the rebuilt code is plain text. GitHub's syntax colouring is markup laid over the lines, and the rebuild keeps the lines.
Where the snippets come from
Gists travel in the margins of other reading. A newsletter links one under "here's the config". An answer in a thread is sometimes nothing but a gist link. Saved from there, those links used to sit in a readlist as cards that opened on sign-in prompts, while the code they stood for lived only at GitHub.
The stored copy now reads in the same reader as any saved article. It joins a saved pull request, which comes back as its discussion, and a saved Stack Overflow question, which keeps every answer: pages about code, stored as the part worth reading.
GitHub keeps its buttons. A gist link handed to readplace.com keeps its code: the description as the title, each file under its name, and the lines themselves.