How To Post Code In Medium Article.

Tharsini Karunanithy
Javarevisited
Published in
3 min readOct 27, 2021

In this article, I am going to discuss adding code to your medium article. It’s not a hard one but if we don’t know this simple one we can not add codes. So let’s see.

Method 1

If you want to add simple codes to medium then it’s press ctrl+alt+6 (windows). By clicking this you can add the simple codes.

ctrl+alt+6
Paste your code.

Method 2

If you want to add long codes then it’s better to add GitHub codes to your Medium articles.

  1. Open your GitHub account and select “New gist”.
Select “New gist”.

2. You can see this screen now.

3. Fill in the fields as to how you want. Set a Public gist and create it.

Create public gist.

4. After creating, select “Share” and get the link of the gist created.
Select “share” and copy the link.

5. Go to your article editing workplace and click the + sign and select “Add an embedded”.

Select “Add an embed”

6. It will ask for the link to be embedded.

7. Now copy the link which already you have copied, then press enter.

In the end, you can see this.

Hope this helps. Share your thoughts too!

--

--