In this article, we would like to show you how to embed code in Medium posts.
There are three types of code you can create:
- Inline code,
- Code block,
- Code block with syntax highlighting.
1. Inline code
To create inline code you need to press backtick and start typing.
2. Code block
To create code block u need to use a key combination depending on your operating system:
- Windows: Ctrl + Alt + 6
- MacOS: Command + Option + 6
- Linux: Ctrl + Alt + 6
3. Code block with syntax highlighting
Medium supports embedding GitHub Gists, so you need to create a gist, paste the link in the post on the medium and click enter.
You can find a detailed description in this article.