Member-only story

Adding Code to Medium Articles

It will make them better, promise

Steven Curtis
4 min readFeb 2, 2021
Photo by Eric Brehm on Unsplash

I’ve written one or two articles on Medium in my time, and most of them are based around creating a journal around my programming adventures, primarily coding in Swift.

Then I discovered that it is all too difficult to read

What is worse is that I made the same mistake multiple times, in different ways. You might think that isn’t possible, but I’m here to tell you that it is, in fact possible.

Code blocks

So what I started doing, in the beginning was to simply write code in one of Medium’s code blocks:

print ("Hello, World!")

It is all clear, understandable and easy.

I spent a lot of time copy-pasting this box into different articles. Yet there was always a shortcut that could have come to my rescue:

Mac: Command⌘ + Option + 6

Windows: Control + Alt + 6

Linux: Control + Alt + 6

or, you know what, you can write the backtick symbol three times (```) on a new line and you’ll jump into code block mode. This gives you a block like the following:

--

--

Responses (1)