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.
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.
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.
# Hashes are one of the methods used in Markdown to create headings. You must use them by adding one for each level.
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
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.
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
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
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");
```
Adding links to a publication, more than common, today is something almost mandatory. With Markdown you will have several ways to do it. Links or online links They are the links of a lifetime. As the name suggests, they are in line with the text. They are created by writing the linked word or text between [] brackets, and the link in question between () parentheses.
[Free Code Camp](https://www.freecodecamp.org/)
Links or links for reference The disadvantage of the previous method is that if you use links that are too complex or long, they can make it difficult for you to read your text. To solve it and create your content in a more orderly way you can generate referral links. This means that in your text you will link specific words or codes (made up of letters and/or numbers), which you will have defined as certain URLs in another more remote place in your document.
[Free Code Camp]:https://www.freecodecamp.org/
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.
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
All the documentation in this page is taken from markdown.es