The Dead Simple Markdown Guide to Code

Use backticks (`) to denote inline code in Markdown. For code blocks, indent each line by at least four spaces or one tab. Escape backticks within code by using double backticks (“).


This content originally appeared on HackerNoon and was authored by Typesetting

Code

To denote a word or phrase as code, enclose it in backticks (`).

\

| Markdown | HTML | Rendered Output | |----|----|----| | At the command prompt, type `nano`. | At the command prompt, type nano. | At the command prompt, type nano. |

Escaping Backticks

If the word or phrase you want to denote as code includes one or more backticks, you can escape it by enclosing the word or phrase in double backticks (``).

\

| Markdown | HTML | Rendered Output | |----|----|----| | ``Use `code` in your Markdown file.`` | Use `code` in your Markdown file. | Use `code` in your Markdown file. |

Code Blocks

To create code blocks, indent every line of the block by at least four spaces or one tab.

\

    <html>
      <head>
      </head>
    </html>

\ The rendered output looks like this:

\

<html>
  <head>
  </head>
</html>

\

:::info Note: To create code blocks without indenting lines, use fenced code blocks.

:::

\

:::info This guide is a Matt Cone project available on Markdown Guide under the CC BY-SA 4.0 license.

:::

\


This content originally appeared on HackerNoon and was authored by Typesetting


Print Share Comment Cite Upload Translate Updates
APA

Typesetting | Sciencx (2024-08-20T15:49:22+00:00) The Dead Simple Markdown Guide to Code. Retrieved from https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/

MLA
" » The Dead Simple Markdown Guide to Code." Typesetting | Sciencx - Tuesday August 20, 2024, https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/
HARVARD
Typesetting | Sciencx Tuesday August 20, 2024 » The Dead Simple Markdown Guide to Code., viewed ,<https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/>
VANCOUVER
Typesetting | Sciencx - » The Dead Simple Markdown Guide to Code. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/
CHICAGO
" » The Dead Simple Markdown Guide to Code." Typesetting | Sciencx - Accessed . https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/
IEEE
" » The Dead Simple Markdown Guide to Code." Typesetting | Sciencx [Online]. Available: https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/. [Accessed: ]
rf:citation
» The Dead Simple Markdown Guide to Code | Typesetting | Sciencx | https://www.scien.cx/2024/08/20/the-dead-simple-markdown-guide-to-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.