Gists are a great way to share your work. You can share single files, parts of files, or full applications. You can access gists at https://gist.github.com.
Every gist is a Git repository, which means that it can be forked and cloned.
There are two types of gists: public gists and secret gists. Additionally, if you are not logged into GitHub when you create your gist, it will be an anonymous gist.
If you are signed in to GitHub when you create a gist, the gist will be associated with your account and you will see it in your list of gists when you navigate to your gist home page.
- Sign in to GitHub.
- Navigate to your gist home page.
- Type an optional description and name for your gist.
- Type the text of your gist into the gist text box. Add as many files as you need.
- Do one of the following:
a. To create a public, searchable gist, click Create public gist.
b. Gist create buttonTo create a secret gist that is not searchable by other users, click Create secret Gist.
Bl.ocks (pronounced “Blocks”) is a simple viewer for sharing code examples hosted on GitHub Gist. For example, if your Gist URL is:
https://gist.github.com/mbostock/1353700
Replace “gist.github.com” with “bl.ocks.org” in the URL to view it:
https://bl.ocks.org/mbostock/1353700
The main source for your example is in index.html
. This file can contain relative links to other files in your Gist, such as images, scripts or stylesheets. And of course you can use absolute links, such as CDN-hosted D3, jQuery or Leaflet. To explain your example, add a README.md
written in Markdown.
For convenient access, install the browser extension for Chrome or Firefox!