Markdown as Fast as Possible
Tags: beginners, tutorial, webdev, programming
Published: 2024-01-31 09:09:45

As a developer, in order for you to write a post on the DEV community, you need to know some markdown. Also, writing readme files on GitHub requires some markdown knowledge.

In this post, I'm going to be introducing the markdown language, and also show you how to use it.

## What is Markdown

What if I told you markdown is markup? Would you believe me? Well, you better do.

Both HTML and markdown are examples of the markup language. As well as LaTeX and XML.

HTML and markdown are so similar to the point that you can actually write HTML in a markdown file (I didn't know we could do that until recently).

So, if markdown is markup, what is markup?

## What is Markup

Markup refers to the set of symbols or codes inserted into a text document to specify how the document should be formatted or interpreted.

From the above definition, you can see that markdown, HTML, LaTeX, and XML fall under the category of markup as a language.

Markdown was created to be a simple markup language that could be easily converted into HTML while still being readable as plain text.

## Writing Markdown

To start writing markdown, you can open any text/code editor of your choice and create a file with `.md` extension. You can also use the `.markdown` extension, but the `.md` is commonly used.

After creating this file, you can begin writing markdown.

Alternatively, you can use an online markdown editor like [StackEdit](https://stackedit.io/) or [HackMD](https://hackmd.io/).

## Markdown Syntax Overview

Here's some of the most frequently used markdown syntax elements:


| Syntax | Explanation | Example |
| ------ | ----------- | ------- |
| `#`, `##`, `###`, etc. | Used for creating headings. Prefix with one to six `#` symbols for heading levels one to six. | `# Header 1`<br>`## Header 2`<br>`### Header 3` |
| `*`, `_`, `**`, `__` | Used for emphasizing text. Surround text with `*` or `_` for italics, `**` or `__` for bold. | `*Italic*`<br>`**Bold**` |
| `-`, `*`, `1.`, `2.`, etc. | Used for creating ordered and unordered lists. Use `-` or `*` for unordered lists and numbers for ordered lists. | `- Item 1`<br>`1. Item 1` |
| `[]`, `()` | Used for creating hyperlinks. Wrap link text in square brackets `[]` and the URL in parentheses `()`. | `[Link Text](URL)` |
| `![]`, `()` | Used for inserting images. Similar to links but with an exclamation mark `!` before the square brackets `[]`. | `![Alt Text](URL)` |
| `>` | Used for creating blockquotes. Prefixed with `>` at the beginning of a line. | `> This is a blockquote.` |
| `` ` `` | Used for displaying inline code. Enclose code within backticks `` ` ``. | `` `Inline Code` `` |

Here's a template for creating a table:
```
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text     | Text     | Text     |
```

Here's a template for creating a codeblock:

    ```python
    def greet():
       print("Hello, Markdown!")
    ```
    
The code blocks are created by enclosing any code within three backticks. Specifying the programming language after the opening backticks enables syntax highlighting.

## Conclusion
Markdown is an essential tool for all developers. It's a type of markup language that lets you easily format text (kind of like an alternative to HTML). In this post, I have introduced markdown, and also presented the most frequently used Markdown syntax elements.

Now you can start writing markdown from here. If there is something you don't know how to format, you can simply google how to do it. The answers are very easy to find online. With more practice, you get better!