How to Create Beautiful Code Snippets for your Next Medium Article in Two Minutes

0xdavinchee
2 min readSep 7, 2019

--

You probably have wondered how people create these beautiful code snippets:

I’ve wondered myself before and initially used something like this for code snippets:

h1 {
color: #292727;
text-align: center;
}

I found out how to use gists and will show you how you can do it yourself in two minutes. So, let’s dive in!

1. Go to github.com.

2. Click on your profile icon on the top of the page and select “Your Gists.”

Click “Your gists”.

3. Click on the plus icon on the top right of the page.

You’ll be taken to the create gist page.

4. Enter in the name of the file, the code snippet and, if you like, a description. Then, click “Create secret gist” or “Create public gist.”

5.0: Change the clone URL option from Embed to Share.

5.1: Click the copy to clipboard icon.

6. Paste the code in the Medium article editor.

7. Hit enter and Voilà!

--

--

No responses yet