5 Ways to Add Code Blocks to your Medium Article

My first few articles use screenshots of my code on an editor or the output of the console, but Im looking for a more elegant solution. In this article I’m going to test out different ways of writing code on Medium to see if we find a winner. Please comment your favourite at the end!

1. The Grey Box Method

let message = 'Hello Medium Readers';message += '!';console.log(message);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amy Hayes

Amy Hayes

All things software, math, and tech