Languages
[Edit]
EN

Medium - how to embed code

0 points
Created by:
Brian-Tompset
491

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:

  1. Inline code,
  2. Code block,
  3. Code block with syntax highlighting.

1. Inline code 

To create inline code you need to press backtick and start typing.

Result:

Markdown - inline code example
Markdown - inline code example

    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

    Result:

    Medium - code block example
    Medium - code block example

    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.

    Note:

    You can find a detailed description in this article

    Result:

    Medium - embedded GitHub Gist example
    Medium - embedded GitHub Gist example

    Alternative titles

    1. Medium - how to display code
    Donate to Dirask
    Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
    Join to our subscribers to be up to date with content, news and offers.
    Native Advertising
    🚀
    Get your tech brand or product in front of software developers.
    For more information Contact us
    Dirask - we help you to
    solve coding problems.
    Ask question.

    ❤️💻 🙂

    Join