/ _system / Cheat Sheets / Markdown Guide.md
Markdown Guide.md
  1  # Markdown Guide
  2  ## What the heck is markdown and why should I care?
  3  
  4  Learning Markdown and incorporating it into your daily routine through tools like Obsidian offers advantages such as simplicity, efficiency, portability, structured organization, and the development of a transferable skill. 
  5  
  6  Markdown's straightforward syntax enables quick formatting and content-focused writing, while Obsidian's features enhance note-taking, knowledge management, and productivity. Not to mention, its an easy and valuable skill to learn!
  7  
  8  **Now it’s time to learn how to write beautifully structured notes without taking your hands off the keyboard!**
  9  
 10  ---
 11  ## Paragraphs
 12  
 13  To create paragraphs, use a blank line to separate one or more lines of text.
 14  
 15  ```
 16  This is a paragraph.
 17  
 18  This is another paragraph.
 19  ```
 20  
 21  Multiple blank spaces
 22  
 23  ## Headings
 24  
 25  To create a heading, add up to six `#` symbols before your heading text. The number of `#` symbols determines the size of the heading.
 26  
 27  ```md
 28  # This is a heading 1
 29  ## This is a heading 2
 30  ### This is a heading 3
 31  #### This is a heading 4
 32  ##### This is a heading 5
 33  ###### This is a heading 6
 34  ```
 35  
 36  # This is a heading 1
 37  
 38  ## This is a heading 2
 39  
 40  ### This is a heading 3
 41  
 42  #### This is a heading 4
 43  
 44  ##### This is a heading 5
 45  
 46  ###### This is a heading 6
 47  
 48  ## Bold, italics, highlights
 49  
 50  Text formatting can also be applied using [Editing shortcuts](https://help.obsidian.md/Editing+and+formatting/Editing+shortcuts).
 51  
 52  |Style|Syntax|Example|Output|
 53  |---|---|---|---|
 54  |Bold|`** **` or `__ __`|`**Bold text**`|**Bold text**|
 55  |Italic|`* *` or `_ _`|`*Italic text*`|_Italic text_|
 56  |Strikethrough|`~~ ~~`|`~~Striked out text~~`|~~Striked out text~~|
 57  |Highlight|`== ==`|`==Highlighted text==`|==Highlighted text==|
 58  |Bold and nested italic|`** **` and `_ _`|`**Bold text and _nested italic_ text**`|**Bold text and _nested italic_ text**|
 59  |Bold and italic|`*** ***` or `___ ___`|`***Bold and italic text***`|**_Bold and italic text_**|
 60  
 61  ## Internal links
 62  
 63  Obsidian supports two formats for [internal links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) between notes:
 64  
 65  - Wikilink: `[[Three laws of motion]]`
 66  - Markdown: `[Three laws of motion](Three%20laws%20of%20motion.md)`
 67  
 68  ## External links
 69  
 70  If you want to link to an external URL, you can create an inline link by surrounding the link text in brackets (`[ ]`), and then the URL in parentheses (`( )`).
 71  
 72  ```md
 73  [Obsidian Help](https://help.obsidian.md)
 74  ```
 75  
 76  [Obsidian Help](https://help.obsidian.md/)
 77  
 78  You can also create external links to files in other vaults, by linking to an [Obsidian URI](https://help.obsidian.md/Extending+Obsidian/Obsidian+URI).
 79  
 80  ```md
 81  [Note](obsidian://open?vault=MainVault&file=Note.md)
 82  ```
 83  
 84  ### Escape blank spaces in links
 85  
 86  If your URL contains blank spaces, you must escape them by replacing them with `%20`.
 87  
 88  ```md
 89  [My Note](obsidian://open?vault=MainVault&file=My%20Note.md)
 90  ```
 91  
 92  You can also escape the URL by wrapping it with angled brackets (`< >`).
 93  
 94  ```md
 95  [My Note](<obsidian://open?vault=MainVault&file=My Note.md>)
 96  ```
 97  
 98  ## External images
 99  
100  You can add images with external URLs, by adding a `!` symbol before an [external link](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#External%20links).
101  
102  ```md
103  ![Engelbart](https://history-computer.com/ModernComputer/Basis/images/Engelbart.jpg)
104  ```
105  
106  ![Engelbart](https://history-computer.com/ModernComputer/Basis/images/Engelbart.jpg)
107  
108  You can change the image dimensions, by adding `|640x480` to the link destination, where 640 is the width and 480 is the height.
109  
110  ```md
111  ![Engelbart|100x145](https://history-computer.com/ModernComputer/Basis/images/Engelbart.jpg)
112  ```
113  
114  If you only specify the width, the image scales according to its original aspect ratio. For example:
115  
116  ```md
117  ![Engelbart|100](https://history-computer.com/ModernComputer/Basis/images/Engelbart.jpg)
118  ```
119  
120  >[!tip] Tip
121  >If you want to add an image from inside your vault, you can also [embed an image in a note](https://help.obsidian.md/Linking+notes+and+files/Embed+files#Embed%20an%20image%20in%20a%20note).
122  
123  ## Quotes
124  
125  You can quote text by adding a `>` symbols before the text.
126  
127  ```md
128  > Human beings face ever more complex and urgent problems, and their effectiveness in dealing with these problems is a matter that is critical to the stability and continued progress of society.
129  
130  \- Doug Engelbart, 1961
131  ```
132  
133  > Human beings face ever more complex and urgent problems, and their effectiveness in dealing with these problems is a matter that is critical to the stability and continued progress of society.
134  
135  - Doug Engelbart, 1961
136  
137  > [!Tip]
138  You can turn your quote into a [callout](https://help.obsidian.md/Editing+and+formatting/Callouts) by adding `[!info]` as the first line in a quote.
139  > - See [[Custom Callouts]] for a list
140  
141  ## Lists
142  
143  You can create an unordered list by adding a `-`, `*`, or `+` before the text.
144  
145  ```md
146  - First list item
147  - Second list item
148  - Third list item
149  ```
150  
151  - First list item
152  - Second list item
153  - Third list item
154  
155  To create an ordered list, start each line with a number followed by a `.` symbol.
156  
157  ```md
158  1. First list item
159  2. Second list item
160  3. Third list item
161  ```
162  
163  1. First list item
164  2. Second list item
165  3. Third list item
166  
167  ### Task lists
168  
169  To create a task list, start each list item with a hyphen and space followed by `[ ]`.
170  
171  ```md
172  - [x] This is a completed task.
173  - [ ] This is an incomplete task.
174  ```
175  
176  - [x] This is a completed task.
177  - [ ] This is an incomplete task.
178  
179  You can toggle a task in Reading view by selecting the checkbox.
180  
181  Tip
182  
183  You can use any character inside the brackets to mark it as complete.
184  
185  ```md
186  - [x] Milk
187  - [?] Eggs
188  - [-] Eggs
189  ```
190  
191  - [x] Milk
192  - [x] Eggs
193  - [x] Eggs
194  
195  ### Nesting lists
196  
197  All list types can be nested in Obsidian.
198  
199  To create a nested list, indent one or more list items:
200  
201  ```md
202  1. First list item
203     1. Ordered nested list item
204  2. Second list item
205     - Unordered nested list item
206  ```
207  
208  1. First list item
209      1. Ordered nested list item
210  2. Second list item
211      - Unordered nested list item
212  
213  Similarly, you can create a nested task list by indenting one or more list items:
214  
215  ```md
216  - [ ] Task item 1
217  	- [ ] Subtask 1
218  - [ ] Task item 2
219  	- [ ] Subtask 1
220  ```
221  
222  - [ ] Task item 1
223      - [ ] Subtask 1
224  - [ ] Task item 2
225      - [ ] Subtask 1
226  
227  Use `Tab` or `Shift+Tab` to indent or unindent one or more selected list items for easy organization.
228  
229  ## Horizontal rule
230  
231  You can use three or more stars `***`, hyphens `---`, or underscore `___` on its own line to add a horizontal bar. You can also separate symbols using spaces.
232  
233  ```md
234  ***
235  ****
236  * * *
237  ---
238  ----
239  - - -
240  ___
241  ____
242  _ _ _
243  ```
244  
245  ---
246  
247  ## Code
248  
249  You can format code both inline within a sentence, or in its own block.
250  
251  ### Inline code
252  
253  You can format code within a sentence using single backticks.
254  
255  ```md
256  Text inside `backticks` on a line will be formatted like code.
257  ```
258  
259  Text inside `backticks` on a line will be formatted like code.
260  
261  If you want to put backticks in an inline code block, surround it with double backticks like so: inline ``code with a backtick ` inside``.
262  
263  ### Code blocks
264  
265  To format a block of code, surround the code with triple backticks.
266  
267  ````
268  ```
269  cd ~/Desktop
270  ```
271  ````
272  
273  ```md
274  cd ~/Desktop
275  ```
276  
277  You can also create a code block by indenting the text using `Tab` or 4 blank spaces.
278  
279  ```md
280      cd ~/Desktop
281  ```
282  
283  You can add syntax highlighting to a code block, by adding a language code after the first set of backticks.
284  
285  ````md
286  ```js
287  function fancyAlert(arg) {
288    if(arg) {
289      $.facebox({div:'#foo'})
290    }
291  }
292  ```
293  ````
294  
295  ```js
296  function fancyAlert(arg) {
297    if(arg) {
298      $.facebox({div:'#foo'})
299    }
300  }
301  ```
302  
303  Obsidian uses Prism for syntax highlighting. For more information, refer to [Supported languages](https://prismjs.com/#supported-languages).
304  
305  Note
306  
307  [Source mode](https://help.obsidian.md/Editing+and+formatting/Edit+and+preview+Markdown#Source%20mode) and [Live Preview](https://help.obsidian.md/Editing+and+formatting/Edit+and+preview+Markdown#Live%20Preview) do not support PrismJS, and may render syntax highlighting differently.
308  
309  ## Footnotes
310  
311  You can add footnotes[[1]](https://publish.obsidian.md/#fn-1-6766dfd5e47944eb) to your notes using the following syntax:
312  
313  ```md
314  This is a simple footnote[^1].
315  
316  [^1]: This is the referenced text.
317  [^2]: Add 2 spaces at the start of each new line.
318    This lets you write footnotes that span multiple lines.
319  [^note]: Named footnotes still appear as numbers, but can make it easier to identify and link references.
320  ```
321  
322  You can also inline footnotes in a sentence. Note that the caret goes outside the brackets.
323  
324  ```md
325  You can also use inline footnotes. ^[This is an inline footnote.]
326  ```
327  
328  Note
329  
330  Inline footnotes only work in reading view, not in Live Preview.
331  
332  ## Comments
333  
334  You can add comments by wrapping text with `%%`. Comments are only visible in Editing view.
335  
336  ```md
337  This is an %%inline%% comment.
338  
339  %%
340  This is a block comment.
341  
342  Block comments can span multiple lines.
343  %%
344  ```
345  
346  ## Learn more
347  
348  To learn more advanced formatting syntax, such as tables, diagrams, and math expressions, refer to [Advanced formatting syntax](https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax).
349  
350  To learn more about how Obsidian parses Markdown, refer to [Obsidian Flavored Markdown](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown).
351  
352  
353  ---