Starting with Cesium 1.21 on May 2, Sandcastle now integrates with the GitHub API for importing and exporting code examples.
There are two new buttons in the Sandcastle toolbar: Share and Import Gist.
To share code you’ve written in Sandcastle, just click the Share button and copy the link. When you click Share, the code is POSTed to an anonymous GitHub Gist.
When someone visits the link, Sandcastle loads and runs the code example, for example, visit:
You’ll notice the query parameter
gist, which is the ID to the actual GitHub Gist that is loaded into Sandcastle.
Existing Gists, like https://gist.github.com/TomPed/f028e4d7b79711a325ef077c53307472, can also be imported into Sandcastle. Just paste in the whole link of the Gist or just the Gist’s ID (like in the screenshot below) to import.
Be sure to use this feature for including a code example when submitting an issue to the Cesium GitHub repo.