Use Github as a Syntax Highlighter for Blog or Website

By July 11, 2020August 7th, 2020Tip and Trick for blogs
Export AD sites details in CSV

Step by Step Using Github as a Syntax Highlighter for Blog or Website

Step 1: Create a Gist

  1. Log in to Github
  2. Click the Gist link at the top of the screen (or go to gist.github.com)
  3. Fill out the file name (description is optional)
  4. Enter your code
  5. Click Create Public Gist
  6. Optional: You can also click Add File at the bottom to split your code snippet up into several different files if you need to.

Note: The syntax highlighting is auto-detected based on the extension of the file name that you enter, so be sure you add the appropriate level of detail.

Step 2: Embed your Gist

Once you create your Gist, you will be presented with a confirmation page. Click the show embed link and copy/paste the script tag on to your website.

Now, when your page is loaded, your code will be pulled in from Github and automatically formatted.

 

Its look like below

other way, which give download link,

  1. create github repository as public
  2. Copy your script
  3. Open script
  4. Click on RAW
  5. Copy the complete link and create hyperlink like below.

ADSites.ps1

Share this post via

Leave a Reply