Sitemap

Member-only story

How to Add Code into Your Medium Articles

Seen
5 min readDec 26, 2021

I’ve joined Medium recently and kept seeing all the cool ways in which the writers were adding code into their own articles. I could say “I wish I could do that” and keep writing the way I have been, but that’s not who I am. I was always the kid that asked “why?” and sometimes got in trouble for “talking back” when I was genuinely interested in the reasoning so that I could understand. And as you would suspect, I did the research on this so that you won’t have to.

I found the below various ways to add code into your medium article and embedded them into this one. Each of them has their own pros and cons so feel free to play with them to decide which one suits you the best.

Inline Code

This is inline code. It’s often used to highlight a keyword or an operator. To start an inline code, put a back tick character (the key to the left of your 1 key) and then start typing. To end the inline code, put in another back tick character or press enter to go to a new line. If you want the inline code to continue to the new line, hold the shift key before going to the new line.

This is a single line of inline code.

This is multiple lines of inline code. I pressed the shift key and then
the enter key to continue this block of inline code onto the new line.

*An alternative way to highlight the text directly in your medium article is to select the text and then hit the back tick key once. It will end up

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Seen

Written by Seen

Software Engineer // Normal Human

No responses yet

Write a response