Languages
[Edit]
EN

Medium - how to embed code

0 points
Created by:
Dirask Community
5610

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
    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