20 | {% include footer.html %}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | # If you have OpenSSL installed, we recommend updating
2 | # the following line to use "https"
3 | source 'https://rubygems.org'
4 |
5 | group :development do
6 | gem 'jekyll', '~> 4.2.0'
7 | gem 'jekyll-sitemap'
8 | gem 'jekyll-last-modified-at'
9 | end
10 |
11 | group :test do
12 | gem 'rake'
13 | gem 'html-proofer'
14 | end
15 |
16 | gem "webrick", "~> 1.8"
17 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Matt Cone
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Markdown Guide
2 |
3 | *[The Markdown Guide](https://www.markdownguide.org)* is a comprehensive Markdown reference designed for both novices and experts. It was born out of frustration with existing Markdown references that are incomplete and inadequate.
4 |
5 | ## Contributing
6 |
7 | Contributions are welcome. Feel free to open a pull request with changes.
8 |
9 | ### Running it Locally
10 |
11 | It can be helpful to preview changes on your computer before opening a pull request. *The Markdown Guide* uses the [Jekyll static site generator](http://jekyllrb.com/). After forking or cloning the repository, perform the following steps to generate the site and preview it:
12 |
13 | - Make sure you have ruby installed on your computer. See https://www.ruby-lang.org/en/downloads/
14 | - `bundle install`
15 | - `bundle exec jekyll serve`
16 | - Point your browser at http://127.0.0.1:4000/
17 |
18 | ### Adding tools
19 |
20 | See [this page](https://github.com/mattcone/markdown-guide/wiki/Markdown-tool-directory) for information about adding applications to the [Markdown tools directory](https://www.markdownguide.org/tools/).
21 |
22 | ## License
23 |
24 | The content of this project itself is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/), and the underlying source code used to format and display that content is licensed under the [MIT license](LICENSE.txt).
25 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require 'html-proofer'
2 | # rake test
3 | desc "build and test website"
4 | task :test do
5 | sh "bundle exec jekyll build"
6 | options = {
7 | :checks => ['Links'],
8 | :check_internal_hash => false,
9 | :enforce_https => false,
10 | :only_4xx => true,
11 | :ignore_urls => ['https://emojipedia.org/',
12 | 'https://ghost.org/',
13 | 'https://ghost.org/faq/using-the-editor/#using-markdown',
14 | 'https://get.todoist.help/hc/en-us/articles/205195102',
15 | 'https://twitter.com/settermjd/status/1126099562345705472',
16 | 'https://twitter.com/datamorgan/status/1109518506125451264',
17 | 'https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-',
18 | %r{https://dpaste.com/*},
19 | %r{https://hedgedoc.org/*},
20 | %r{https://docs.hedgedoc.org/*},
21 | %r{https://www.reddit.com/*}],
22 | :url_swap => { %r{https://www.markdownguide.org} => '' },
23 | :typhoeus => {
24 | :ssl_verifypeer => false,
25 | :ssl_verifyhost => 0,
26 | },
27 | :verbose => true,
28 | }
29 | HTMLProofer.check_directory("./_site", options).run
30 | end
--------------------------------------------------------------------------------
/_basic-syntax/bold.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Bold
3 | syntax-id: bold
4 | syntax-summary: "**bold text**"
5 | description: "To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters."
6 | examples:
7 | - markdown: "I just love **bold text**."
8 | html: "I just love bold text."
9 | - markdown: "I just love __bold text__."
10 | html: "I just love bold text."
11 | - markdown: "Love**is**bold"
12 | html: "Loveisbold"
13 | ---
14 |
15 | To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.
16 |
17 |
18 |
19 |
20 |
Markdown
21 |
HTML
22 |
Rendered Output
23 |
24 |
25 |
26 |
27 |
I just love **bold text**.
28 |
I just love <strong>bold text</strong>.
29 |
I just love bold text.
30 |
31 |
32 |
I just love __bold text__.
33 |
I just love <strong>bold text</strong>.
34 |
I just love bold text.
35 |
36 |
37 |
Love**is**bold
Love<strong>is</strong>bold
38 |
Loveisbold
39 |
40 |
41 |
42 |
43 | #### Bold Best Practices
44 |
45 | Markdown applications don't agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to bold the middle of a word for emphasis.
46 |
47 |
48 |
49 |
50 |
✅ Do this
51 |
❌ Don't do this
52 |
53 |
54 |
55 |
56 |
57 |
58 | Love**is**bold
59 |
60 |
61 |
62 |
63 | Love__is__bold
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/_basic-syntax/escaping-characters.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Escaping Characters
3 | syntax-id: escaping-characters
4 | api: "no"
5 | ---
6 |
7 | To display a literal character that would otherwise be used to format text in a Markdown document, add a backslash (`\`) in front of the character.
8 |
9 | ```
10 | \* Without the backslash, this would be a bullet in an unordered list.
11 | ```
12 |
13 | The rendered output looks like this:
14 |
15 | \* Without the backslash, this would be a bullet in an unordered list.
16 |
17 | ### Characters You Can Escape
18 |
19 | You can use a backslash to escape the following characters.
20 |
21 |
87 |
--------------------------------------------------------------------------------
/_basic-syntax/horizontal-rules.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Horizontal Rules
3 | syntax-id: horizontal-rules
4 | syntax-summary: "---"
5 | description: "To create a horizontal rule, use three or more asterisks (`***`), dashes (`---`), or underscores (`___`) on a line by themselves."
6 | examples:
7 | - markdown: "***"
8 | html: ""
9 | - markdown: "---"
10 | html: ""
11 | - markdown: "_________________"
12 | html: ""
13 | ---
14 |
15 | To create a horizontal rule, use three or more asterisks (`***`), dashes (`---`), or underscores (`___`) on a line by themselves.
16 |
17 | ```
18 | ***
19 |
20 | ---
21 |
22 | _________________
23 | ```
24 |
25 | The rendered output of all three looks identical:
26 |
27 | ---
28 |
29 | ### Horizontal Rule Best Practices
30 |
31 | For compatibility, put blank lines before and after horizontal rules.
32 |
33 |
34 |
35 |
36 |
✅ Do this
37 |
❌ Don't do this
38 |
39 |
40 |
41 |
42 |
43 |
44 | Try to put a blank line before...
45 |
46 | ---
47 |
48 | ...and after a horizontal rule.
49 |
50 |
51 |
52 |
53 | Without blank lines, this would be a heading.
54 | ---
55 | Don't do this!
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/_basic-syntax/html.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: HTML
3 | syntax-id: html
4 | api: "no"
5 | ---
6 |
7 | Many Markdown applications allow you to use HTML tags in Markdown-formatted text. This is helpful if you prefer certain HTML tags to Markdown syntax. For example, some people find it easier to use HTML tags for images. Using HTML is also helpful when you need to change the attributes of an element, like specifying the [color of text](/hacks/#color) or changing the width of an image.
8 |
9 | To use HTML, place the tags in the text of your Markdown-formatted file.
10 |
11 | ```
12 | This **word** is bold. This word is italic.
13 | ```
14 |
15 | The rendered output looks like this:
16 |
17 | This **word** is bold. This word is italic.
18 |
19 | ### HTML Best Practices
20 |
21 | For security reasons, not all Markdown applications support HTML in Markdown documents. When in doubt, check your Markdown application's documentation. Some applications support only a subset of HTML tags.
22 |
23 | Use blank lines to separate block-level HTML elements like `
`, `
`, `
`, and `
` from the surrounding content. Try not to indent the tags with tabs or spaces — that can interfere with the formatting.
24 |
25 | You can't use Markdown syntax inside block-level HTML tags. For example, `
italic and **bold**
` won't work.
26 |
--------------------------------------------------------------------------------
/_basic-syntax/italic.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Italic
3 | syntax-id: italic
4 | syntax-summary: "*italicized text*"
5 | description: "To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters."
6 | examples:
7 | - markdown: "Italicized text is the *cat's meow*."
8 | html: "Italicized text is the cat's meow."
9 | - markdown: "Italicized text is the _cat's meow_."
10 | html: "Italicized text is the cat's meow."
11 | - markdown: "A*cat*meow"
12 | html: "Acatmeow"
13 | ---
14 |
15 | To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters.
16 |
17 |
18 |
19 |
20 |
Markdown
21 |
HTML
22 |
Rendered Output
23 |
24 |
25 |
26 |
27 |
Italicized text is the *cat's meow*.
28 |
Italicized text is the <em>cat's meow</em>.
29 |
Italicized text is the cat’s meow.
30 |
31 |
32 |
Italicized text is the _cat's meow_.
33 |
Italicized text is the <em>cat's meow</em>.
34 |
Italicized text is the cat’s meow.
35 |
36 |
37 |
A*cat*meow
38 |
A<em>cat</em>meow
39 |
Acatmeow
40 |
41 |
42 |
43 |
44 | #### Italic Best Practices
45 |
46 | Markdown applications don't agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to italicize the middle of a word for emphasis.
47 |
48 |
49 |
50 |
51 |
✅ Do this
52 |
❌ Don't do this
53 |
54 |
55 |
56 |
57 |
58 |
59 | A*cat*meow
60 |
61 |
62 |
63 |
64 | A_cat_meow
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/_basic-syntax/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Overview
3 | syntax-id: overview
4 | api: "no"
5 | ---
6 |
7 | Nearly all Markdown applications support the basic syntax outlined in the original Markdown design document. There are minor variations and discrepancies between Markdown processors — those are noted inline wherever possible.
8 |
--------------------------------------------------------------------------------
/_basic-syntax/paragraphs.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Paragraphs
3 | syntax-id: paragraphs
4 | description: "To create paragraphs, use a blank line to separate one or more lines of text. You should not indent paragraphs with spaces or tabs."
5 | examples:
6 | - markdown: |
7 | I really like using Markdown.
8 |
9 | I think I'll use it to format all of my documents from now on.
10 | html: "
I really like using Markdown.
I think I'll use it to format all of my documents from now on.
"
11 | ---
12 |
13 | To create paragraphs, use a blank line to separate one or more lines of text.
14 |
15 |
16 |
17 |
18 |
Markdown
19 |
HTML
20 |
Rendered Output
21 |
22 |
23 |
24 |
25 |
26 |
27 | I really like using Markdown.
28 |
29 | I think I'll use it to format all of my documents from now on.
30 |
31 |
32 |
33 | <p>I really like using Markdown.</p>
34 |
35 | <p>I think I'll use it to format all of my documents from now on.</p>
36 |
37 |
38 |
I really like using Markdown.
39 |
40 |
I think I'll use it to format all of my documents from now on.
41 |
42 |
43 |
44 |
45 |
46 | ### Paragraph Best Practices
47 |
48 | Unless the [paragraph is in a list](/basic-syntax/#paragraphs), don't indent paragraphs with spaces or tabs.
49 |
50 |
51 | Note: If you need to indent paragraphs in the output, see the section on how to indent (tab).
52 |
53 |
54 |
55 |
56 |
57 |
✅ Do this
58 |
❌ Don't do this
59 |
60 |
61 |
62 |
63 |
64 |
65 | Don't put tabs or spaces in front of your paragraphs.
66 |
67 | Keep lines left-aligned like this.
68 |
69 |
70 |
71 |
72 | This can result in unexpected
73 | formatting problems.
74 |
75 | Don't add tabs or spaces in front of paragraphs.
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | title: "Markdown Guide"
2 | url: https://www.markdownguide.org # site url
3 | baseurl: "" # apply repo name if use it under gh-pages branch
4 |
5 | repo: https://github.com/mattcone/markdown-guide
6 | comments: false
7 |
8 | plugins:
9 | - jekyll-last-modified-at
10 | - jekyll-sitemap
11 |
12 | collections:
13 | basic-syntax:
14 | extended-syntax:
15 | tools:
16 | output: true
17 | permalink: /tools/:title/
18 |
19 | defaults:
20 | - scope:
21 | type: tools
22 | values:
23 | layout: tool
24 |
25 | # Build settings
26 | permalink : /:year/:title/
27 | markdown : kramdown
28 | highlighter : rouge
29 |
30 | source: ./
31 | destination: ./_site
32 |
33 | # Author settings
34 | author:
35 | name : "Matt Cone"
36 |
37 | # social settings
38 | og_locale: "en_US"
39 |
40 | kramdown:
41 | syntax_highlighter: rouge
42 | input: GFM
43 | auto_ids: true
44 | toc_levels: 1..3
45 |
46 | exclude: ["vendor", "Gemfile", "Gemfile.lock", "README.md", "LICENSE.txt", "Rakefile", "netlify.toml", "deploy.sh", "redirects.conf"]
47 |
--------------------------------------------------------------------------------
/_data/status.yml:
--------------------------------------------------------------------------------
1 | # Possible availability statuses for Markdown features for tools:
2 |
3 | y:
4 | name: "Yes"
5 | class: table-success
6 |
7 | p:
8 | name: "Partial"
9 | class: table-warning
10 |
11 | n:
12 | name: "No"
13 | class: table-danger
14 |
15 | u:
16 | name: "Unknown"
17 | class: table-default
18 |
--------------------------------------------------------------------------------
/_data/tools.yml:
--------------------------------------------------------------------------------
1 | # Each tool has YAML front matter describing the tool's properties.
2 | # The fields are:
3 |
4 | headings:
5 | name: Headings
6 | link: /basic-syntax/#headings
7 |
8 | paragraphs:
9 | name: Paragraphs
10 | link: /basic-syntax/#paragraphs-1
11 |
12 | line-breaks:
13 | name: Line Breaks
14 | link: /basic-syntax/#line-breaks
15 |
16 | bold:
17 | name: Bold
18 | link: /basic-syntax/#bold
19 |
20 | italic:
21 | name: Italic
22 | link: /basic-syntax/#italic
23 |
24 | blockquotes:
25 | name: Blockquotes
26 | link: /basic-syntax/#blockquotes-1
27 |
28 | ordered-lists:
29 | name: Ordered Lists
30 | link: /basic-syntax/#ordered-lists
31 |
32 | unordered-lists:
33 | name: Unordered Lists
34 | link: /basic-syntax/#unordered-lists
35 |
36 | code:
37 | name: Code
38 | link: /basic-syntax/#code
39 |
40 | horizontal-rules:
41 | name: Horizontal Rules
42 | link: /basic-syntax/#horizontal-rules
43 |
44 | links:
45 | name: Links
46 | link: /basic-syntax/#links
47 |
48 | images:
49 | name: Images
50 | link: /basic-syntax/#images-1
51 |
52 | tables:
53 | name: Tables
54 | link: /extended-syntax/#tables
55 |
56 | fenced-code-blocks:
57 | name: Fenced Code Blocks
58 | link: /extended-syntax/#fenced-code-blocks
59 |
60 | syntax-highlighting:
61 | name: Syntax Highlighting
62 | link: /extended-syntax/#syntax-highlighting
63 |
64 | footnotes:
65 | name: Footnotes
66 | link: /extended-syntax/#footnotes
67 |
68 | heading-ids:
69 | name: Heading IDs
70 | link: /extended-syntax/#heading-ids
71 |
72 | definition-lists:
73 | name: Definition Lists
74 | link: /extended-syntax/#definition-lists
75 |
76 | strikethrough:
77 | name: Strikethrough
78 | link: /extended-syntax/#strikethrough
79 |
80 | task-lists:
81 | name: Task Lists
82 | link: /extended-syntax/#task-lists
83 |
84 | emoji-cp:
85 | name: Emoji (copy and paste)
86 | link: /extended-syntax/#copying-and-pasting-emoji
87 |
88 | emoji-sc:
89 | name: Emoji (shortcodes)
90 | link: /extended-syntax/#using-emoji-shortcodes
91 |
92 | highlight:
93 | name: Highlight
94 | link: /extended-syntax/#highlight
95 |
96 | subscript:
97 | name: Subscript
98 | link: /extended-syntax/#subscript
99 |
100 | superscript:
101 | name: Superscript
102 | link: /extended-syntax/#superscript
103 |
104 | auto-url-linking:
105 | name: Automatic URL Linking
106 | link: /extended-syntax/#automatic-url-linking
107 |
108 | disabling-auto-url:
109 | name: Disabling Automatic URL Linking
110 | link: /extended-syntax/#disabling-automatic-url-linking
111 |
112 | html:
113 | name: HTML
114 | link: /basic-syntax/#html
115 |
--------------------------------------------------------------------------------
/_extended-syntax/automatic-url-linking.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Automatic URL Linking
3 | syntax-id: automatic-url-linking
4 | ---
5 |
6 | Many Markdown processors automatically turn URLs into links. That means if you type http://www.example.com, your Markdown processor will automatically turn it into a link even though you haven’t [used brackets](/basic-syntax/#links).
7 |
8 | ```
9 | http://www.example.com
10 | ```
11 |
12 | The rendered output looks like this:
13 |
14 | [http://www.example.com](http://www.example.com)
15 |
16 | ## Disabling Automatic URL Linking
17 |
18 | If you don't want a URL to be automatically linked, you can remove the link by [denoting the URL as code](/basic-syntax/#code) with backticks.
19 |
20 | ```
21 | `http://www.example.com`
22 | ```
23 |
24 | The rendered output looks like this:
25 |
26 | `http://www.example.com`
27 |
--------------------------------------------------------------------------------
/_extended-syntax/availability.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Availability
3 | syntax-id: availability
4 | ---
5 |
6 | Not all Markdown applications support extended syntax elements. You'll need to check whether or not the lightweight markup language your application is using supports the extended syntax elements you want to use. If it doesn't, it may still be possible to enable extensions in your Markdown processor.
7 |
8 | ### Lightweight Markup Languages
9 |
10 | There are several lightweight markup languages that are *supersets* of Markdown. They include basic syntax and build upon it by adding additional elements like tables, code blocks, syntax highlighting, URL auto-linking, and footnotes. Many of the most popular Markdown applications use one of the following lightweight markup languages:
11 |
12 | - [CommonMark](https://commonmark.org)
13 | - [GitHub Flavored Markdown (GFM)](https://github.github.com/gfm/)
14 | - [Markdown Extra](https://michelf.ca/projects/php-markdown/extra/)
15 | - [MultiMarkdown](https://fletcherpenney.net/multimarkdown/)
16 | - [R Markdown](https://rmarkdown.rstudio.com/)
17 |
18 | ### Markdown Processors
19 |
20 | There are [dozens of Markdown processors](https://github.com/markdown/markdown.github.com/wiki/Implementations) available. Many of them allow you to add extensions that enable extended syntax elements. Check your processor's documentation for more information.
21 |
--------------------------------------------------------------------------------
/_extended-syntax/definition-lists.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Definition Lists
3 | syntax-id: definition-lists
4 | syntax-summary: |
5 | term
6 | : definition
7 | ---
8 |
9 | Some Markdown processors allow you to create *definition lists* of terms and their corresponding definitions. To create a definition list, type the term on the first line. On the next line, type a colon followed by a space and the definition.
10 |
11 | ```
12 | First Term
13 | : This is the definition of the first term.
14 |
15 | Second Term
16 | : This is one definition of the second term.
17 | : This is another definition of the second term.
18 | ```
19 |
20 | The HTML looks like this:
21 |
22 | ```html
23 |
24 |
First Term
25 |
This is the definition of the first term.
26 |
Second Term
27 |
This is one definition of the second term.
28 |
This is another definition of the second term.
29 |
30 | ```
31 |
32 | The rendered output looks like this:
33 |
34 | First Term
35 | : This is the definition of the first term.
36 |
37 | Second Term
38 | : This is one definition of the second term.
39 | : This is another definition of the second term.
40 |
--------------------------------------------------------------------------------
/_extended-syntax/emoji.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Emoji
3 | syntax-id: emoji
4 | ---
5 |
6 | There are two ways to add emoji to Markdown files: copy and paste the emoji into your Markdown-formatted text, or type *emoji shortcodes*.
7 |
8 | ### Copying and Pasting Emoji
9 |
10 | In most cases, you can simply copy an emoji from a source like [Emojipedia](https://emojipedia.org/) and paste it into your document. Many Markdown applications will automatically display the emoji in the Markdown-formatted text. The HTML and PDF files you export from your Markdown application should display the emoji.
11 |
12 |
15 |
16 | ### Using Emoji Shortcodes
17 |
18 | Some Markdown applications allow you to insert emoji by typing emoji shortcodes. These begin and end with a colon and include the name of an emoji.
19 |
20 | ```text
21 | Gone camping! :tent: Be back soon.
22 |
23 | That is so funny! :joy:
24 | ```
25 |
26 | The rendered output looks like this:
27 |
28 | Gone camping! ⛺ Be back soon.
29 |
30 | That is so funny! 😂
31 |
32 |
33 | Note: You can use this list of emoji shortcodes, but keep in mind that emoji shortcodes vary from application to application. Refer to your Markdown application's documentation for more information.
34 |
35 |
--------------------------------------------------------------------------------
/_extended-syntax/fenced-code-blocks.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Fenced Code Blocks
3 | syntax-id: fenced-code-blocks
4 | syntax-summary: |
5 | ```
6 | {
7 | "firstName": "John",
8 | "lastName": "Smith",
9 | "age": 25
10 | }
11 | ```
12 | ---
13 |
14 | The basic Markdown syntax allows you to create [code blocks](/basic-syntax/#code-blocks) by indenting lines by four spaces or one tab. If you find that inconvenient, try using fenced code blocks. Depending on your Markdown processor or editor, you'll use three backticks (```) or three tildes (`~~~`) on the lines before and after the code block. The best part? You don't have to indent any lines!
15 |
16 | ~~~~~~~~~
17 | ```
18 | {
19 | "firstName": "John",
20 | "lastName": "Smith",
21 | "age": 25
22 | }
23 | ```
24 | ~~~~~~~~~
25 |
26 | The rendered output looks like this:
27 |
28 | ```text
29 | {
30 | "firstName": "John",
31 | "lastName": "Smith",
32 | "age": 25
33 | }
34 | ```
35 |
36 |
37 | Tip: Need to display backticks inside a code block? See this section to learn how to escape them.
38 |
39 |
40 | ### Syntax Highlighting
41 |
42 | Many Markdown processors support syntax highlighting for fenced code blocks. This feature allows you to add color highlighting for whatever language your code was written in. To add syntax highlighting, specify a language next to the backticks before the fenced code block.
43 |
44 | ~~~~~~~~~
45 | ```json
46 | {
47 | "firstName": "John",
48 | "lastName": "Smith",
49 | "age": 25
50 | }
51 | ```
52 | ~~~~~~~~~
53 |
54 | The rendered output looks like this:
55 |
56 | ```json
57 | {
58 | "firstName": "John",
59 | "lastName": "Smith",
60 | "age": 25
61 | }
62 | ```
63 |
--------------------------------------------------------------------------------
/_extended-syntax/footnotes.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Footnotes
3 | syntax-id: footnotes
4 | syntax-summary: |
5 | Here's a sentence with a footnote. [^1]
6 |
7 | [^1]: This is the footnote.
8 | ---
9 |
10 | Footnotes allow you to add notes and references without cluttering the body of the document. When you create a footnote, a superscript number with a link appears where you added the footnote reference. Readers can click the link to jump to the content of the footnote at the bottom of the page.
11 |
12 | To create a footnote reference, add a caret and an identifier inside brackets (`[^1]`). Identifiers can be numbers or words, but they can't contain spaces or tabs. Identifiers only correlate the footnote reference with the footnote itself — in the output, footnotes are numbered sequentially.
13 |
14 | Add the footnote using another caret and number inside brackets with a colon and text (`[^1]: My footnote.`). You don't have to put footnotes at the end of the document. You can put them anywhere except inside other elements like lists, block quotes, and tables.
15 |
16 | ```
17 | Here's a simple footnote,[^1] and here's a longer one.[^bignote]
18 |
19 | [^1]: This is the first footnote.
20 |
21 | [^bignote]: Here's one with multiple paragraphs and code.
22 |
23 | Indent paragraphs to include them in the footnote.
24 |
25 | `{ my code }`
26 |
27 | Add as many paragraphs as you like.
28 | ```
29 |
30 | The rendered output looks like this:
31 |
32 | Here's a simple footnote,[^1] and here's a longer one.[^bignote]
33 |
34 | [^1]: This is the first footnote.
35 |
36 | [^bignote]: Here's one with multiple paragraphs and code.
37 |
38 | Indent paragraphs to include them in the footnote.
39 |
40 | `{ my code }`
41 |
42 | Add as many paragraphs as you like.
43 |
--------------------------------------------------------------------------------
/_extended-syntax/heading-ids.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Heading IDs
3 | syntax-id: heading-ids
4 | syntax-summary: "### My Great Heading {#custom-id}"
5 | ---
6 |
7 | Many Markdown processors support custom IDs for [headings](/basic-syntax/#headings) — some Markdown processors automatically add them. Adding custom IDs allows you to link directly to headings and modify them with CSS. To add a custom heading ID, enclose the custom ID in curly braces on the same line as the heading.
8 |
9 | ```text
10 | ### My Great Heading {#custom-id}
11 | ```
12 |
13 | The HTML looks like this:
14 |
15 | ```html
16 |
My Great Heading
17 | ```
18 |
19 | ### Linking to Heading IDs
20 |
21 | You can link to headings with custom IDs in the file by creating a [standard link](/basic-syntax/#links) with a number sign (`#`) followed by the custom heading ID. These are commonly referred to as *anchor links*.
22 |
23 |
39 |
40 | Other websites can link to the heading by adding the custom heading ID to the full URL of the webpage (e.g, `[Heading IDs](https://www.markdownguide.org/extended-syntax#heading-ids)`).
41 |
--------------------------------------------------------------------------------
/_extended-syntax/highlight.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Highlight
3 | syntax-id: highlight
4 | ---
5 |
6 | This isn't common, but some Markdown processors allow you to highlight text. The result looks like this. To highlight words, use two equal signs (`==`) before and after the words.
7 |
8 | ```text
9 | I need to highlight these ==very important words==.
10 | ```
11 |
12 | The rendered output looks like this:
13 |
14 | I need to highlight these very important words.
15 |
16 | Alternatively, if your Markdown application supports [HTML](/basic-syntax/#html), you can use the `mark` HTML tag.
17 |
18 | ```html
19 | I need to highlight these very important words.
20 | ```
--------------------------------------------------------------------------------
/_extended-syntax/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Overview
3 | syntax-id: overview
4 | ---
5 |
6 | The [basic syntax](/basic-syntax/) outlined in the original Markdown design document added many of the elements needed on a day-to-day basis, but it wasn't enough for some people. That's where extended syntax comes in.
7 |
8 | Several individuals and organizations took it upon themselves to extend the basic syntax by adding additional elements like tables, code blocks, syntax highlighting, URL auto-linking, and footnotes. These elements can be enabled by using a lightweight markup language that builds upon the basic Markdown syntax, or by adding an extension to a compatible Markdown processor.
9 |
--------------------------------------------------------------------------------
/_extended-syntax/strikethrough.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Strikethrough
3 | syntax-id: strikethrough
4 | syntax-summary: "~~The world is flat.~~"
5 | ---
6 |
7 | You can strikethrough words by putting a horizontal line through the center of them. The result looks ~~like this~~. This feature allows you to indicate that certain words are a mistake not meant for inclusion in the document. To strikethrough words, use two tilde symbols (`~~`) before and after the words.
8 |
9 | ```
10 | ~~The world is flat.~~ We now know that the world is round.
11 | ```
12 |
13 | The rendered output looks like this:
14 |
15 | ~~The world is flat.~~ We now know that the world is round.
16 |
--------------------------------------------------------------------------------
/_extended-syntax/subscript.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Subscript
3 | syntax-id: subscript
4 | ---
5 |
6 | This isn't common, but some Markdown processors allow you to use *subscript* to position one or more characters slightly below the normal line of type. To create a subscript, use one tilde symbol (`~`) before and after the characters.
7 |
8 | ```text
9 | H~2~O
10 | ```
11 |
12 | The rendered output looks like this:
13 |
14 | H2O
15 |
16 |
17 | Tip: Be sure to test this in your Markdown application before using it. Some Markdown applications use one tilde symbol before and after words not for subscript, but for strikethrough.
18 |
19 |
20 | Alternatively, if your Markdown application supports [HTML](/basic-syntax/#html), you can use the `sub` HTML tag.
21 |
22 | ```html
23 | H2O
24 | ```
--------------------------------------------------------------------------------
/_extended-syntax/superscript.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Superscript
3 | syntax-id: superscript
4 | ---
5 |
6 | This isn't common, but some Markdown processors allow you to use *superscript* to position one or more characters slightly above the normal line of type. To create a superscript, use one caret symbol (`^`) before and after the characters.
7 |
8 | ```text
9 | X^2^
10 | ```
11 |
12 | The rendered output looks like this:
13 |
14 | X2
15 |
16 | Alternatively, if your Markdown application supports [HTML](/basic-syntax/#html), you can use the `sup` HTML tag.
17 |
18 | ```html
19 | X2
20 | ```
--------------------------------------------------------------------------------
/_extended-syntax/task-lists.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Task Lists
3 | syntax-id: task-lists
4 | syntax-summary: |
5 | - [x] Write the press release
6 | - [ ] Update the website
7 | - [ ] Contact the media
8 | ---
9 |
10 | Task lists (also referred to as *checklists* and *todo* lists) allow you to create a list of items with checkboxes. In Markdown applications that support task lists, checkboxes will be displayed next to the content. To create a task list, add dashes (`-`) and brackets with a space (`[ ]`) in front of task list items. To select a checkbox, add an `x` in between the brackets (`[x]`).
11 |
12 | ```
13 | - [x] Write the press release
14 | - [ ] Update the website
15 | - [ ] Contact the media
16 | ```
17 |
18 | The rendered output looks like this:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/_getting-started/additional-resources.md:
--------------------------------------------------------------------------------
1 | ## Additional Resources
2 |
3 | There are lots of resources you can use to learn Markdown. Here are some other introductory resources:
4 |
5 | - [John Gruber's Markdown documentation](https://daringfireball.net/projects/markdown/). The original guide written by the creator of Markdown.
6 | - [Markdown Tutorial](https://www.markdowntutorial.com/). An open source website that allows you to try Markdown in your web browser.
7 | - [Awesome Markdown](https://github.com/mundimark/awesome-markdown). A list of Markdown tools and learning resources.
8 | - [Typesetting Markdown](https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1). A multi-part series that describes an ecosystem for typesetting Markdown documents using [pandoc](https://pandoc.org/) and [ConTeXt](https://www.contextgarden.net/).
9 |
--------------------------------------------------------------------------------
/_getting-started/flavors-of-markdown.md:
--------------------------------------------------------------------------------
1 | ## Flavors of Markdown
2 |
3 | One of the most confusing aspects of using Markdown is that practically every Markdown application implements a slightly different version of Markdown. These variants of Markdown are commonly referred to as *flavors*. It's your job to master whatever flavor of Markdown your application has implemented.
4 |
5 | To wrap your head around the concept of Markdown flavors, it might help to think of them as language dialects. People in New York City speak English just like the people in London, but there are substantial differences between the dialects used in both cities. The same is true for people using different Markdown applications. Using [Dillinger](/tools/dillinger/) to write with Markdown is a vastly different experience than using [Ulysses](/tools/ulysses/).
6 |
7 | Practically speaking, this means you never know exactly what a company means when they say they support "Markdown." Are they talking about only the [basic syntax elements](/basic-syntax/), or all of the basic and [extended syntax elements](/extended-syntax/) combined, or some arbitrary combination of syntax elements? You won't know until you read the documentation or start using the application.
8 |
9 | If you're just starting out, the best advice I can give you is to pick a Markdown application with good Markdown support. That'll go a long way towards maintaining the portability of your Markdown files. You might want to store and use your Markdown files in other applications, and to do that you need to start with an application that provides good support. You can use the [tool directory](/tools/) to find an application that fits the bill.
10 |
--------------------------------------------------------------------------------
/_getting-started/how-does-it-work.md:
--------------------------------------------------------------------------------
1 | ## How Does it Work?
2 |
3 | Dillinger makes writing in Markdown easy because it hides the stuff happening behind the scenes, but it's worth exploring how the process works in general.
4 |
5 | When you write in Markdown, the text is stored in a plaintext file that has an `.md` or `.markdown` extension. But then what? How is your Markdown-formatted file converted into HTML or a print-ready document?
6 |
7 | The short answer is that you need a *Markdown application* capable of processing the Markdown file. There are lots of applications available — everything from simple scripts to desktop applications that look like Microsoft Word. Despite their visual differences, all of the applications do the same thing. Like Dillinger, they all convert Markdown-formatted text to HTML so it can be displayed in web browsers.
8 |
9 | Markdown applications use something called a *Markdown processor* (also commonly referred to as a "parser" or an "implementation") to take the Markdown-formatted text and output it to HTML format. At that point, your document can be viewed in a web browser or combined with a style sheet and printed. You can see a visual representation of this process below.
10 |
11 |
12 | Note: The Markdown application and processor are two separate components. For the sake of brevity, I've combined them into one element ("Markdown app") in the figure below.
13 |
14 |
15 | {% include image.html file="/assets/images/markdown-flowchart.png" alt="The Markdown Process" lazy="yes" %}
16 |
17 | To summarize, this is a four-part process:
18 |
19 | 1. Create a Markdown file using a text editor or a dedicated Markdown application. The file should have an `.md` or `.markdown` extension.
20 | 2. Open the Markdown file in a Markdown application.
21 | 3. Use the Markdown application to convert the Markdown file to an HTML document.
22 | 4. View the HTML file in a web browser or use the Markdown application to convert it to another file format, like PDF.
23 |
24 | From your perspective, the process will vary somewhat depending on the application you use. For example, Dillinger essentially combines steps 1-3 into a single, seamless interface — all you have to do is type in the left pane and the rendered output magically appears in the right pane. But if you use other tools, like a text editor with a static website generator, you'll find that the process is much more visible.
25 |
--------------------------------------------------------------------------------
/_getting-started/kicking-the-tires.md:
--------------------------------------------------------------------------------
1 | ## Kicking the Tires
2 |
3 | The best way to get started with Markdown is to use it. That's easier than ever before thanks to a variety of free tools.
4 |
5 | You don't even need to download anything. There are several online Markdown editors that you can use to try writing in Markdown. [Dillinger](https://dillinger.io/) is one of the best online Markdown editors. Just open the site and start typing in the left pane. A preview of the rendered document appears in the right pane.
6 |
7 | {% include image.html file="/assets/images/dillinger.png" alt="Dillinger Markdown editor" lazy="yes" %}
8 |
9 | You'll probably want to keep the Dillinger website open as you read through this guide. That way you can try the syntax as you learn about it. After you've become familiar with Markdown, you may want to use a Markdown application that can be installed on your desktop computer or mobile device.
10 |
--------------------------------------------------------------------------------
/_getting-started/what-is-markdown.md:
--------------------------------------------------------------------------------
1 | ## What is Markdown?
2 |
3 | Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. Created by [John Gruber](https://daringfireball.net/projects/markdown/) in 2004, Markdown is now one of the world's most popular markup languages.
4 |
5 | Using Markdown is different than using a [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG) editor. In an application like Microsoft Word, you click buttons to format words and phrases, and the changes are visible immediately. Markdown isn't like that. When you create a Markdown-formatted file, you add Markdown syntax to the text to indicate which words and phrases should look different.
6 |
7 | For example, to denote a heading, you add a number sign before it (e.g., `# Heading One`). Or to make a phrase bold, you add two asterisks before and after it (e.g., `**this text is bold**`). It may take a while to get used to seeing Markdown syntax in your text, especially if you're accustomed to WYSIWYG applications. The screenshot below shows a Markdown file displayed in the [Visual Studio Code text editor](/tools/vscode/).
8 |
9 | {% include image.html file="/assets/images/vscode.png" alt="Markdown file in the Visual Studio Code text editor" %}
10 |
11 | You can add Markdown formatting elements to a plaintext file using a text editor application. Or you can use one of the many Markdown applications for macOS, Windows, Linux, iOS, and Android operating systems. There are also several web-based applications specifically designed for writing in Markdown.
12 |
13 | Depending on the application you use, you may not be able to preview the formatted document in real time. But that's okay. [According to Gruber](https://daringfireball.net/projects/markdown/), Markdown syntax is designed to be readable and unobtrusive, so the text in Markdown files can be read even if it isn't rendered.
14 |
15 | > The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.
16 |
--------------------------------------------------------------------------------
/_getting-started/why-use-markdown.md:
--------------------------------------------------------------------------------
1 | ## Why Use Markdown?
2 |
3 | You might be wondering why people use Markdown instead of a WYSIWYG editor. Why write with Markdown when you can press buttons in an interface to format your text? As it turns out, there are several reasons why people use Markdown instead of WYSIWYG editors.
4 |
5 | - Markdown can be used for everything. People use it to create [websites](#websites), [documents](#documents), [notes](#notes), [books](#books), [presentations](#presentations), [email messages](#email), and [technical documentation](#documentation).
6 |
7 | - Markdown is portable. Files containing Markdown-formatted text can be opened using virtually any application. If you decide you don't like the Markdown application you're currently using, you can import your Markdown files into another Markdown application. That's in stark contrast to word processing applications like Microsoft Word that lock your content into a proprietary file format.
8 |
9 | - Markdown is platform independent. You can create Markdown-formatted text on any device running any operating system.
10 |
11 | - Markdown is future proof. Even if the application you're using stops working at some point in the future, you'll still be able to read your Markdown-formatted text using a text editing application. This is an important consideration when it comes to books, university theses, and other milestone documents that need to be preserved indefinitely.
12 |
13 | - Markdown is everywhere. Websites like [Reddit](/tools/reddit/) and GitHub support Markdown, and lots of desktop and web-based applications support it.
14 |
--------------------------------------------------------------------------------
/_includes/footer.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
15 |
16 |
17 |
27 |
--------------------------------------------------------------------------------
/_includes/image.html:
--------------------------------------------------------------------------------
1 | {% if site.url == "https://www.markdownguide.org" and jekyll.environment == "production" %}
2 |
5 | {% else %}
6 |
7 | {% endif %}
--------------------------------------------------------------------------------
/_includes/mailing-list.html:
--------------------------------------------------------------------------------
1 |
Learn Markdown in 60 pages. Designed for both novices and experts, The Markdown Guide book is a comprehensive reference that has everything you need to get started and master Markdown syntax.