The Markdown syntax includes a small list of simple codes to represent the most popular and basic HTML tags.
Paragraphs
Paragraphs can be written without the need for any special representation. Simply by separating the line with a double line break, converting the markdown to HTML will use the
tag.
Headers …
Headings are placed with the # character and a blank space at the beginning of the paragraph. Depending on the amount of “#” the header to use will be taken.
# …indicates
## …indicates
… ######…indicates
unordered lists
unordered lists
Lists are placed with a hyphen at the beginning of the line. Then successive lines that are part of the same list are placed with a single line break and another line starting with a hyphen.
– Element – Other element – Other more
Ordered lists
Unordered lists are placed with the numerical index followed by a period. And then the text that you want to place on that element. Although the indices, the truth is that the number that is put is indifferent, since they will always start at 1 and will increase.
1. First element 2. Second element 3. Third element
italics and bold
Italics and bold are inline elements, so we can use them within a paragraph, a list element, or any other block element.
The bolds are placed with two starting and closing asterisks:
In this paragraph **this part is in bold**.
Italics use a single asterisk:
When someone says something *I can italicize it*.
If you want to italicize and bold at the same time, then you can use three asterisks:
In this paragraph ***I will place this text in italics and bold at the same time***.
Blockquotes or quotes
The paragraphs that are quotes can be put with the
tag, which in Markdown is expressed by the “>” character at the beginning of the line.
> This paragraph will be a quote and in HTML it will be displayed with the
tag.
Introduce source code blocks in Markdown
Markdown has an excellent treatment for code blocks or inline code (when in a paragraph you want to open and close inline code. We do it with the ` character (the backtick).
In this paragraph `this part would be code` and this part is not.
If it is a code block that includes one or more complete lines of code, we put three backtick characters followed by a newline, followed by as many lines of code as desired.
“` // This would be a code var x = 1; “`
links
Links are generated by brackets and then parentheses. First you indicate the text of the link in brackets and then the URL in parentheses.
This is a (https://www.)
If it’s just a URL that you want to turn into a link, you can put it inbut within less than and greater than characters.
The images
The image syntax is a bit strange. We can use an alt text and the image url with the following code.
!(http://example.com/image.jpg)