What is Markdown?

Markdown is a lightweight markup language created by John Gruber that strives for maximum readability and ease of publication in both its input and output forms, drawing inspiration from many existing conventions for marking up email messages using plain text. It is distributed under the BSD license and is distributed as a plugin (or at least available) in different content management systems (CMS). Markdown converts marked up text into XHTML documents using html2text created by Aaron Swartz. Markdown was originally implemented in Perl by Gruber, but has since been translated into a multitude of programming languages, including PHP, Python, Ruby, Java, and Common Lisp.

Main uses of Markdown

Markdown is a lightweight markup language created by John Gruber that strives for maximum readability and ease of publication in both

  • WordPress
  • Trello
  • Notion
  • Telegram
  • Gmail
  • Hashnode
  • Github
  • Etc.....

Just to mention the above but there are more and more platforms that use Markdown for publications. But the main reason you should learn Markdown is for code documentation, I cite one of the examples that Github uses Markdown for its READEM.md file.

Markdown syntax

The best way to understand markdown is by looking at examples like the one below.

## Title ### Subtitle This is an example of text that gives input to a generic list of elements: - Element 1 - Element 2 - Element 3 This is an example of text that gives input to a numbered list: 1. Element 1 2. Element 2 3. Element 3 Text in Markdown can be formatted as **bold** or *italic* in a very simple way.

As you can see, one of the objectives for which Markdown was designed is perfectly fulfilled, and that is to make the publications as readable as possible. Another of the objectives of Markdown is that you can publish the documents “as they are”. It doesn't matter if the end result you need is HTML, a PDF or Rich Text Format (RTF); since you can always obtain these formats through a converter, or through applications compatible with Markdown.

Paragraph

To generate a new paragraph in Markdown simply separate the text by a blank line (pressing enter twice) Like HTML, Markdown doesn't support double blank lines, so if you try to render them they will be converted to a single line when rendered. To perform a line break and start a sentence on a subsequent line within the same paragraph, you will need to press the space bar twice before pressing enter once. For example, if you wanted to write a Haiku poem, it would look like this:

"Walking with his wet paws,
the Sparrow
by the wooden terrace»

Where each verse has two blank spaces at the end.

Lists

Unlike what happens in HTML, generating lists in Markdown is extremely simple. You can meet two types.

Unordered lists

To create unordered lists use *asterisks, - dashes, or + plus signs.

- List item 1 - List item 2 * List item 3 * List item 4 + List item 5 + List item 6

No matter which element you choose, you can even swap them. They will all look the same when rendered. Example

  • List item 1
  • List item 2
  • List item 3
  • List item 4
  • List item 5
  • List item 6

Ordered lists

To create ordered lists you must use the type syntax: "number." 1.. As with unordered lists, you can also nest or combine them.

1. List item 1 2. List item 2 3. List item 3 4. List item 4 5. List item 5 6. List item 6
Cite

Quotes will be generated using the greater than > character at the beginning of the text block.

> Your work is going to fill a large part of your life, the only way to be truly satisfied is to do what you think is great work and the only way to do it is to love what you do. If you haven't found it yet, keep looking. As with everything that has to do with the heart, you will know it when you have found it. -Steve Jobs Your work is going to fill a large part of your life, the only way to be truly satisfied is to do what you think is great work and the only way to do it is to love what you do. If you haven't found it yet, keep looking. As with everything that has to do with the heart, you will know it when you have found it. -Steve Jobs
Code block

If you want to create an entire block containing code. All you have to do is enclose said paragraph between two lines formed by three ~ tildes or with three ` grave accents.

``` Console.log("Hello World"); ```
Image

Inserting an image with Markdown is done almost identically to inserting links. Only in this case, you'll need to add a ! exclamation at the beginning and the link will be none other than the location of the image.

![Codign](https://images.pexels.com/photos/270348/pexels-photo-270348.jpeg?cs=srgb&dl=pexels-pixabay-270348.jpg&fm=jpg)

The alt text is what would be displayed if the image load failed. You can also add an alternate title by enclosing it at the end of the path. This would be the title displayed when you leave the mouse cursor over the image.

Skip Markdown

If you have come this far, you are probably wondering how I managed to write certain symbols such as * asterisks or _ underscores, without Markdown interpreting them to convert them to bold, italics... This is very simple, since in this language there is a star element to specify that everything you write next is not interpreted as Markdown. This is the backslash \. Writing it right in front of any of the elements that you will see below, they will not have an effect when they become bold, italics, links...

\ backslash ` reverse accent * asterisk _ underscore {} keys [] brackets () parentheses # pad + plus sign - screenplay . point ! exclamation
Reference

All the documentation in this page is taken from markdown.es