magical markdown slides
1---
2theme: default
3author: Learn Markdown
4---
5
6<!-- markdownlint-disable MD034 MD035 -->
7
8# Markdown Basics
9
10A quick reference for Markdown syntax
11
12---
13
14## Headings
15
16Markdown supports multiple heading styles:
17
18```markdown
19# This is an h1
20## This is an h2
21### This is an h3
22#### This is an h4
23##### This is an h5
24###### This is an h6
25```
26
27Alternative syntax for h1 and h2:
28
29```markdown
30This is an h1
31=============
32
33This is an h2
34-------------
35```
36
37---
38
39## Text Formatting
40
41**Bold text:**
42
43```markdown
44**This text is in bold.**
45__And so is this text.__
46```
47
48*Italic text:*
49
50```markdown
51*This text is in italics.*
52_And so is this text._
53```
54
55Combined:
56
57```markdown
58***This text is in both.***
59**_As is this!_**
60*__And this!__*
61```
62
63Strikethrough:
64
65```markdown
66~~This text is rendered with strikethrough.~~
67```
68
69---
70
71## Paragraphs
72
73Paragraphs are separated by blank lines:
74
75```markdown
76This is a paragraph. I'm typing in a paragraph.
77
78Now I'm in paragraph 2.
79I'm still in paragraph 2 too!
80
81I'm in paragraph three!
82```
83
84Line breaks require two spaces at the end or `<br />`:
85
86```markdown
87I end with two spaces (highlight to see them).
88There's a <br /> above me!
89```
90
91---
92
93## Block Quotes
94
95Use `>` to create block quotes:
96
97```markdown
98> This is a block quote. You can either
99> manually wrap your lines and put a `>`
100> before every line or you can let your
101> lines get really long and wrap on their own.
102```
103
104Nested quotes:
105
106```markdown
107> You can also use more than one level
108>> of indentation?
109> How neat is that?
110```
111
112---
113
114## Lists
115
116**Unordered lists** use `*`, `+`, or `-`:
117
118```markdown
119* Item
120* Item
121* Another item
122
123- Item
124- Item
125- One last item
126```
127
128**Ordered lists** use numbers:
129
130```markdown
1311. Item one
1322. Item two
1333. Item three
134```
135
136Nested lists:
137
138```markdown
1391. Item one
1402. Item two
1413. Item three
142 * Sub-item
143 * Sub-item
1444. Item four
145```
146
147---
148
149## Task Lists
150
151Create checkboxes with `[ ]` and `[x]`:
152
153```markdown
154- [ ] First task to complete
155- [ ] Second task that needs done
156- [x] This task has been completed
157```
158
159> [!NOTE]
160> Task lists are a GitHub-flavored Markdown extension
161
162---
163
164## Code
165
166**Inline code** uses backticks:
167
168```markdown
169John didn't even know what the `go_to()` function did!
170```
171
172**Code blocks** use triple backticks or indentation:
173
174````markdown
175```rust
176fn main() {
177 println!("Hello, world!");
178}
179```
180
181 This is code
182 So is this
183````
184
185---
186
187## Horizontal Rules
188
189Create horizontal rules with three or more:
190
191```markdown
192***
193---
194- - -
195****************
196```
197
198All render as:
199
200***
201
202___
203
204- - -
205
206---
207
208## Links
209
210**Inline links:**
211
212```markdown
213[Click me!](http://test.com/)
214[Click me!](http://test.com/ "Link to Test.com")
215[Go to music](/music/)
216```
217
218**Reference links:**
219
220```markdown
221[Click this link][link1] for more info!
222[Also check out this link][foobar] if you want.
223
224[link1]: http://test.com/ "Cool!"
225[foobar]: http://foobar.biz/ "Alright!"
226```
227
228**Implicit reference:**
229
230```markdown
231[This][] is a link.
232
233[This]: http://thisisalink.com/
234```
235
236---
237
238## Internal Links
239
240Link to headings using slugified IDs:
241
242```markdown
243- [Heading](#heading)
244- [Another heading](#another-heading)
245- [Chapter](#chapter)
246 - [Subchapter <h3 />](#subchapter-h3-)
247```
248
249> [!TIP]
250> Heading IDs are created by lowercasing and replacing spaces with hyphens
251
252---
253
254## Images
255
256**Inline images:**
257
258```markdown
259
260```
261
262**Reference images:**
263
264```markdown
265![This is the alt-attribute.][myimage]
266
267[myimage]: relative/urls/cool/image.jpg "Optional title"
268```
269
270> [!NOTE]
271> Images use the same syntax as links, but with a `!` prefix
272
273---
274
275## Automatic Links
276
277URLs and email addresses can be auto-linked:
278
279```markdown
280<http://testwebsite.com/>
281<foo@bar.com>
282```
283
284These are equivalent to:
285
286```markdown
287[http://testwebsite.com/](http://testwebsite.com/)
288[foo@bar.com](mailto:foo@bar.com)
289```
290
291---
292
293## Escaping
294
295Use backslash to escape special characters:
296
297```markdown
298I want to type *this* but not in italics:
299\*this text surrounded by asterisks\*
300```
301
302Special characters you can escape:
303
304```markdown
305\ backslash
306` backtick
307* asterisk
308_ underscore
309{} curly braces
310[] square brackets
311() parentheses
312# hash mark
313+ plus sign
314- minus sign
315. dot
316! exclamation mark
317```
318
319---
320
321## HTML Elements
322
323You can use HTML in Markdown:
324
325```markdown
326Your computer crashed? Try sending a
327<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>
328```
329
330> [!WARNING]
331> You cannot use Markdown syntax within HTML element contents
332
333---
334
335## Tables
336
337Create tables with pipes and hyphens:
338
339```markdown
340| Col1 | Col2 | Col3 |
341| :----------- | :------: | ------------: |
342| Left-aligned | Centered | Right-aligned |
343| blah | blah | blah |
344```
345
346Compact syntax also works:
347
348```markdown
349Col 1 | Col2 | Col3
350:-- | :-: | --:
351Ugh this is ugly | make it | stop
352```
353
354Alignment is controlled by colons:
355
356- `:--` = left-aligned
357- `:-:` = centered
358- `--:` = right-aligned
359
360---
361
362## Admonitions
363
364> [!IMPORTANT]
365> Admonitions are NOT standard Markdown - they are an extension
366
367Common admonition types:
368
369```markdown
370> [!NOTE]
371> Useful information
372
373> [!TIP]
374> Helpful advice
375
376> [!IMPORTANT]
377> Critical information
378
379> [!WARNING]
380> Proceed with caution
381
382> [!CAUTION]
383> Potential risks ahead
384```
385
386---
387
388## Admonition Examples
389
390> [!NOTE]
391> This is a note admonition with helpful context
392
393> [!TIP]
394> Use Markdown for clear, readable documentation
395
396> [!WARNING]
397> Not all Markdown processors support the same features
398
399> [!IMPORTANT]
400> Always check your Markdown processor's documentation for supported features
401
402---
403
404## Comments
405
406HTML comments work in Markdown:
407
408```markdown
409<!-- This is a comment and won't be rendered -->
410```
411
412Comments are useful for:
413
414- Leaving notes for yourself or collaborators
415- Temporarily hiding content
416- Adding metadata that shouldn't display
417
418---
419
420## Summary
421
422Markdown provides:
423
424- **Simple syntax** for formatted text
425- **Readable source** that looks good even as plain text
426- **Portable format** supported by many tools
427- **Extensions** like tables, task lists, and admonitions
428
429> [!SUCCESS]
430> You now know the basics of Markdown!
431
432---
433
434## Resources
435
436**Learn more:**
437
438- Markdown Guide (https://www.markdownguide.org/)
439- GitHub Flavored Markdown (https://github.github.com/gfm/)
440- CommonMark Spec (https://commonmark.org/)
441
442**Practice:**
443
444- Markdown Tutorial (https://www.markdowntutorial.com/)
445- Dillinger (https://dillinger.io/) - Online Markdown editor
446
447---
448
449## Thank You
450
451Happy writing!