For those of us that write a lot of technical content, there's a somewhat standard problem:
How do you store all of your samples? Including them inline in Markdown is certainly an option, but it is not an option that helps discoverability too much. Inline examples are harder to search and extract, and a bit of a nightmare to reuse.
If there was a site.standard.code.sample it would make it easy to build a client-side search for a site's samples (just listRecords from a user).
This would also help establish copyright for creators - simply post your sample and the at protocol will timestamp it and shout it out to the world.
Last but not least, this sort of lexicon would make it easy to search samples and discover technical sites from multiple publications.
Suggested Lexicon Markdown#
site.standard.code.sample#
A code sample within a standard site.
| Property | Type | Description |
|---|---|---|
$type |
[string] |
The type of the object. Must be site.standard.code.sample. |
title |
[string] |
The title of the sample |
language |
[string] |
The programming language used in the sample |
code |
[string] |
The example code |
createdAt |
[datetime] |
The time the code sample was created |