The Students

Web Resources

Course Curriculum

Latest

Embedding Gists

by Nathan White


Posted on 24 May 2014 Tags: gists


Quick code formating with the help of github gists.

Including code snippets for review or explaination is pretty easy with the help of gists.

Creating a Gist

Goto gist.github.com. You should see a text editor with an area to add a description on the top. Either write or copy and paste your code snippet into the textarea. Don’t forget to provide a name for the file along with the target language (will auto detect from file extensions).

Once your content is ready. Click the “Create Gist” button. This should generate a custom url (page) for your code snippet as seen here (https://gist.github.com/nw/bcc9ee1e5d22ab952778).

We are going to use a part of that to embed into our blog post. The username/gist-id.

{% gist nw/bcc9ee1e5d22ab952778 %}

and the result:


Comments

comments powered by Disqus