Sunday, February 26, 2017

How to Post code snippets in Blogger

I had a lot of pain finding a easy way to post code snippets in blogger. After a lot of searching found a easy way. Here it is.
  1. Go to gist.github.com
  2. Write a description (Optional)
  3. Write a file name including extension. Without extension syntax will not be highlighted.
  4. Add your code, which you want to post in blogger.
  5. Now click "Create Public Gist" button.

  6. Then Copy the embed Script.
  7. Now back to blogger.
  8. Paste the script where you need to add the code snippet.
  9. Make sure to select the option “Interpret typed HTML” under Post Options -> Compose mode.
After following these steps here my code looks like.
Happy Coding 🌝

No comments:

Post a Comment