What is Markdown, and how do I use it? ✨


(Ross) #1

#Markdown Primer
##What is Markdown?
A lightweight markup language used to produce documents in many formats.

##Why do I care?
It is used in this forum, and it is used everywhere. Using Markdown, one can create complex html documents using just a few strings. Any document created using the Markdown notation can be processed to create valid HTML.

##Example Markdown

#Getting started
##First Category
###Clothing
 - Shoes*
 - **Hat**
 - Pants
**Must be hiking*

##Output


#Getting started
##First Category
###Clothing

  • Shoes*
  • Hat
  • Pants
    *Must be hiking

##Code Blocks
One can easily make their pasted code or output look pretty by:

  • Highlighting a block of text and pressing Ctrl + k or using the button from the gui.
  • Placing 4 spaces in front of each line
  • Syntax Highlighting of code can be done by placing ``` around the block of text to be highlighted

Make sure to place a carriage return before the code (or lists) to apply the markup.

Examples

Code block preceded by 4 spaces.

int main(int argc, char** argv) {
    std::cout << "A source example!\n";
}

Using ```:

```
int main(int argc, char** argv) {
    std::cout << "A source example!\n";
}
```

Results in:

int main(int argc, char** argv) {
    std::cout << "A source example!\n";
}

And of course, see the next post in this topic for the raw plaintext of this post, which includes some useful examples of how to embed html tags and escape characters in code blocks.

##More Information


Welcome to the Arduboy Community!
(Ross) #2
#Markdown Primer
##What is [Markdown][1]?
A lightweight markup language used to produce documents in many formats.

##Why do I care?
It is used in this forum, and it is used everywhere. Using Markdown, one can create complex html documents using just a few strings. Any document created using the Markdown notation can be processed to create valid HTML.

##Example Markdown

    #Getting started
    ##First Category
    ###Clothing
     - Shoes*
     - **Hat**
     - Pants
    **Must be hiking*

##**Output**


----------
#Getting started
##First Category
###Clothing
 - Shoes*
 - **Hat**
 - Pants
**Must be hiking*
---

##Code Blocks
One can easily make their pasted code or output look pretty by:

- Highlighting a block of text and pressing <kbd>Ctrl</kbd> + <kbd>k</kbd> or using the button from the gui.
- Placing 4 spaces in front of each line
- **Syntax Highlighting** of code can be done by placing <code>\`\`\`</code> around the block of text to be highlighted

Make sure to place a carriage return before the code (or lists) to apply the markup.
### Examples
Code block preceded by 4 spaces.

    int main(int argc, char** argv) {
        std::cout << "A source example!\n";
    }
Using <code>\`\`\`</code>:

    ```
    int main(int argc, char** argv) {
        std::cout << "A source example!\n";
    }
    ```
Results in:
```
int main(int argc, char** argv) {
    std::cout << "A source example!\n";
}
```
And of course, see the next post in this topic for the raw plaintext of this post, which includes some useful examples of how to embed html tags and escape characters in code blocks.

##More Information
 - **Markdown**
  - [Project Page][5]
  - [Syntax Documentation][2]

 - **What does Discourse use?**
Discourse won't use every markdown convention you've ever seen, for example you won't be able to do tables, as you can do with [Github Flavored Markdown][4]; at least not without using HTML tags. I suspect you may see tables added in the future, as Discourse may adopt a new Markdown interpreter.
  - Current Interpreter: https://github.com/evilstreak/markdown-js
  - Future interpreter: https://github.com/markdown-it/markdown-it (With tables)

  [1]: http://en.wikipedia.org/wiki/Markdown
  [2]: http://daringfireball.net/projects/markdown/syntax
  [3]: https://github.com/markdown-it/markdown-it
  [4]: https://help.github.com/articles/github-flavored-markdown/
  [5]: http://daringfireball.net/projects/markdown/

(Ross) #3

I have also enabled tables, so it is possible to tables using conventional HTML tags, such that a table is created like so…

<table>
  <tr>
    <td> </td>
  </tr>
</table>

(Ross) #4