Embed Highlighted Code into your Website using Github Gist

Github Gist is great way to share your work. You can share single files, parts of files, or full applications. Gist get more interesting by embedding code into your website. This helps us to get rid of using any third-party JavaScript library. Embedding Gist code is easier to embed and it renders much fast on the web page. That makes it two reasons why you should embed highlighted code into your website using Github Gist.

Gist: Example of embedded Github Gist snippet.

Steps to Embed Highlighted Code into your Website using Github Gist

This can be done using Github Gist account or being anonymous.

  • Open Gist Github 
  • Give Gist Description, Filename including extension & Code Snippets
    Githhub Gist Share code to Embed Highlighted Code into your Website using Github Gist
  • Click on “Create Public gist”
  • Copy URL from right to Embed box.
    Embeded Gist URL
Insert copied code into your website’s HTML source code between the <head> tags.
Code example:

Adding Gist into WordPress website

  • Select Text option present in WordPress Editor appears at right side of the screen.
  • Paste the copied URL, where you want to code to appear.
    Adding Github Gist in WordPress
  • And you are successfully embed code into your website using Github Gist.

Visit:- Quora – How to Find your Answers Smartly.