Writing Your Medium Articles in Markdown

Markdown is wonderful language with plain-text formatting that allows the writer to convert their writing into several formats.

Alexander Jansing
2 min readMay 29, 2020
Self-referential cover photo.

As a programmer, I tend to write a lot of my code and non-code in VSCode or light-weight tools. And this extends to my Medium articles. Medium used to let you upload Markdown directly into their editor or import the story from a Markdown gist[1]. I believe I’ve found an acceptable alternative to importing Markdown that some developers may appreciate.

In VSCode if you install the Markdown All in One tool, you can get a preview of your Markdown as you type it.

Example

You can see things like:

  • unordered lists
  • … although I don’t think Medium supports sub-bullets
  1. or numbered lists with
  2. in-line code snippets or
code blocks
with multiple lines.
What my VSCode looks like while writing this article.

All you need to do from here is select-all from the preview and paste is into a new story and much of the Markdown formatting should persist!

You may need to read through your article and fix some formatting issues. Code blocks tend to have about two extra line tacked onto the end, but if you want to write for certain publications they will want you to use gists[2] anyway. If that is the case, you can just:

  1. copy and paste your code into a gist,
  2. grab the link,
  3. replace your code block with the link,
  4. and hit enter to populate with a pretty gists-style snippet.
The code block from above in gist form.

Conclusion

It requires a little bit of effort after the fact, but I’ve used this method a couple of times now and it really seems to help me out since I like to write Markdown and don’t particularly like the Medium editor. I hope this helps you or someone you know simplify their writing process!

P.S. I just look through the search tool or upload images after the fact. You can use something like ![text-here](path-to-image-here) if you want to have images within your Markdown locally, but it won't translate into Medium.

[1]A. McFee, How to import Markdown into Medium (2015), Medium

[2] Z. Shapiro, Write For Us (2020), Better Programming, Medium

--

--

Alexander Jansing

Data Scientist / Software Engineer Engineer with Five Years of Experience. I love getting lost in a good problem.