Markdown is, in my opinion, just the best text-formatting language. It has a simple and intuitive syntax, making it easy to understand the text structure even as plain text, but also provides great results with just enough formatting for READMEs, notes, instructions, and cheatsheets, such as this one.
The compiler takes the text in .md
files and translates it to HTML, so you can even write HTML syntax inside Markdown and it will work!
For more information, please check Markdown Guide. Also, if you'd like to take notes using Markdown, check the Obsidian app.
Note that this guide is for CommonMark, the main Markdown flavour, but it is also compatible with GitHub Flavoured Markdown.
A good tool to preview GFM files is Grip.
Ways to modify the text itself. All of these can be combined between them.
- Headings -
#
,##
, ...: Creates a heading. The number of number signs indicate the level of the heading, as in HTML (<h1>
).
The bigger the number, the smaller the heading.- You can specify a heading ID with by adding
{#<id>}
at the end, but it creates them automatically.
- You can specify a heading ID with by adding
- Italics -
_ _
: Makes the text in italics. - Bold -
** **
: Makes the text in bold. - Strikethrough -
~~ ~~
: Makes the textstrikethrough. - Code -
` `
: Makes the text as is, escaping all formatting and giving it a cool*<{mono font}>*
.- To escape backticks, use double backticks on the code formatting:
`` `code` ``
.
Use three for escaping double backticks, and so on.
- To escape backticks, use double backticks on the code formatting:
- Equations -
$ $
: Uses LaTeX markup'smath
enviroment to print out equations. I recommend using the tool Codelog's Equation Editor.- use doubles for more complex ones (matrixes, etc)
You can also use regular HTML markings like <sub></sub>
, <super></super>
and <mark></mark>
.
The different ways of organizing text.
- Unordered lists -
-
: Create bullet point lists.- To create a sub-element, use a tab before the hyphen.
- Ordered lists -
1.
: Create numbered lists. The numbers must be put and ordered manually. Can also create sub-elements. - Code blocks -
```
: Create code blocks to write plaintext in (one at the top and one at the bottom).- You can specify a language in order to enable syntax highlighting by adding it next to the top backtics:
```lang
int main() { return 0; }
- You can specify a language in order to enable syntax highlighting by adding it next to the top backtics:
- Blockquotes -
>
: - Horizontal rules -
---
:
- Break line: In order to use a line break, use double space at the end of the line.
- Emojis: https://github.com/ikatyang/emoji-cheat-sheet/tree/master#symbols