Markdown is a type of markup language. We can write more swiftly and effectively with the aid of Markdown. Markdown allows us to produce written content, paragraphs, and much more. We can also insert formatting to Markdown with a few symbols. It also allows us to add links, photos, and so on. In Markdown, we may additionally create some lists. We may insert numbered or ordered lists, unordered lists, bullet lists, nested lists, mixed lists, and much more.
Highlights
Here are some highlights of this tutorial which make it easy to know which type of lists will be covered here:
- Creation of an ordered\numbered list
- Creation of an unordered\bullet list
- Using asterisk “z*.”
- Using dash “-”
- Using plus “+”
- Creation of a Nested\Indented list
- Nested ordered list
- Nested unordered list
- Mixed list
Creation of an Ordered\Numbered List in Markdown
The ordered list is also said to be a numbered list. Both are the same. We are utilizing the “Visual Studio Code” here. We must enter the code into the text file to create an ordered or numbered list. We type the numbers and a point to create the numbered or ordered list. We type “1.” followed by “Jane”. Then, we type “2.” and “Peter” in the following line. Then, we type “3. William” and “4. John”. Finally, we add “5.” and type “Samuel”.
Remember that we type all the numbers with a point. The point (.) is essential when making the ordered or numbered list. The ordered or numbered list begins with “1” and ends at “5”. The code is also given here.
Code #1:
Markdown Numbered List
- Jane
- Peter
- William
- John
- Samuel
Output:
Look at this preview window and note what the previous code produces as the output. We can notice that the ordered or numbered list is displayed here as an output and it starts with “1”.
Example 1:
In this following code, we make another numbered list. However, we do not type the numbers in this ordered or numbered list in a sequence. We just append “3.” to all the items that are inserted into this ordered list. All of the items begin with “3.” in this list. We type “3. CPU” in the first line and then “3. Laptop”. After this, we have “3. Monitor” in this code. We might notice that this list contains only “3” as the sequence of the list of numbers. Examine the preview window now to see how it shows this ordered list containing all “3.” with each list’s item.
Code #2:
3. CPU
3. Laptop
3. Monitor
3. Mouse
3. Keyboard
Output:
Take note of the sequence of numbering on the list in this result. We put all “3.” to the previous code, but the numbers that are presented in the output differ. The numerals are “3, 4, 5, 6, and 7”. This is because when we type an identical number to the ordered list, it just validates the first number and then adds the rest of the list’s numbers in an order in the output. The first number that is displayed in the code is the initial item number which is “3” in this case, and all subsequent numbers are created automatically by adding “1” to the prior item number.
Example 2:
We begin the list using “42.” and type “Apple”. After that, we put “6.” and “Guava” The list’s numbers are then inserted sequentially. For this ordered list’s items, we put “7. Mango”, “8. Watermelon”, and “9. Grapes” here. After this, we alter this sequence again and type “16. Strawberry” instead of “10.”. We insert “42.” as the initial list’s item number, and then type the list’s item numbers beginning with “6” and going up. Also, we insert the “16.” list’s item number at the end. Now, look at the result and observe how it handles the numbers that we entered here.
Code #3:
42. Apple
6. Guava
7. Mango
8. Watermelon
9. Grapes
16. Strawberry
Output:
This result displays the ordered list, with the list’s item numbers beginning with “42” and increasing by “1” until the forthcoming item number on the list is displayed as “43”. Then, there are “42”, “43”, “44,” and so on. It validates the first item’s number and then automatically creates the rest by increasing the previous item number by “1”. As you can see, we inserted “42”, “6”, “7”, “8”, “9”, and 16” in the previous code. However, the result shows that the first item number remains unchanged, and the following numbers are modified.
Creation of an Unordered\Bullet List in Markdown
We may also create an unordered list. The unordered list is also said to be a bullet list. We can quickly generate an unordered or bullet list by utilizing some symbols. The symbols that aid in generating this type of list are “asterisk”, “dash”, or “plus”. Now, we utilize all these symbols separately in our codes and learn how these symbols aid in generating the unordered or bullet list in Markdown.
Example 1: Utilizing Asterisk “*” in Markdown
With the aid of an asterisk, the unordered or bullet list is generated. We place an asterisk here in our code where we wish to generate the unordered or bullet list. We type “*” and then write “Daffodils”. After this, we move to the next line and put an asterisk again in the second line.
After this, we type the second item of this list which is “Jasmine”. In this way, we add all the items to this list by placing an asterisk with all the items. The code is also given in the following:
Code #4:
* Daffodils
* Jasmine
* Rose
* Tulip
Output:
The output that is generated on the preview window is also shown. Here, we might notice that the bullets appear automatically in place of asterisks, and an unordered or bullet list is generated here. This is an unordered list because there are no numbers added to this list.
Example 2: Utilizing Dash “-” in Markdown
The unordered or bullet list can also be made with the help of a dash”-“. In our code, we put a dash where we want the unordered or bullet list to appear. We start with “-” and then write “French”. After that, we continue to the next line and place a dash in the second line again, or it may appear automatically after hitting “Enter”. We then type the second item on this list which is “German” in this case. In this manner, we add all of the items to the bullet list after the dash symbol. In this code, “Spanish”, “Japanese”, and “English” are added by pressing “Enter” after each word. The code is also included in the following:
Code #5:
- French
- German
- Spanish
- Japanese
- English
Output:
The output from the preview window is also displayed. We can see that the bullets emerge automatically in place of the dashes which results in an unordered or bullet list.
Example 3: Utilizing Plus “+” in Markdown
We now use “+” to generate the unordered or bullet list. We place the items on the list in the same manner as we did in our previous codes. But this time, we have to type the “+” symbol where we have to construct the list. We put plus “+” and then type “Hammer” after giving one space gap after the “+” symbol. Then, we hit “Enter”. Note that the “+” symbol appears on its own. We type the next item’s name which is “Pliers”.
Then, hit “Enter” again and type “Wrench” as the “+” symbols generate in this line automatically. So, we add all the items’ names one by one, and we had to hit “Enter” each time before typing the next item’s name to move to the next line.
Code #6:
+ Hammer
+ Pliers
+ Wrench
+ Screwdriver
+ Shovel
Output:
Creation of Nested\Indented List in Markdown
A nested list is a type of list in which a new list is added to the list element as the sub-list. We can say that it is another list in the list element. This is also called the indented list. We have two types of this nested list in Markdown, and we will construct both of them here. These are:
- Nested ordered list
- Nested unordered list
- Mixed list
Nested Ordered List in Markdown
In the nested ordered list, we have to put the new list inside the list’s element as its sub-list, and it contains the numbers. We construct the nested ordered list here. For this, we put “1.” and write “Mathematics”. Then, in the next line, “2.” is generated as we press “Enter”. We then place “General Science” repeatedly and hit “Enter”. The “3.” appears, so we type “Computer Science”.
After this, we have to generate the nested list here. After pressing “Enter”, we remove the “4.”, insert some space here, and type “1.” again. This generates the sub-list of the “Computer Science” list item, and we write “Information Technology” there.
Now, we type “Software Engineering” by hitting “Enter”. This “2.” of this nested list generates this time. After this, the sub-list items are completely entered, so when we hit “Enter”, it generates “3.” In this sub-list, we have to remove this “3.” and continue our main list’s numbering again by typing “4. English” and so on.
Code #7:
1. Mathematics
2. General Science
3. Computer Science
1. Information Technology
2. Software Engineering
4. English
5. General Knowledge
Output:
Here is the result of the previous code, and the nested ordered list is displayed. We have seen another list inside the main list. This is also said to be an indented list in Markdown.
Nested Unordered List in Markdown
Here, we build the nested unordered list. For this, we enter “+” and the word “Fruits”. After which, “+” appears on the next line when we hit the “Enter” key. Following that, we need to create a nested unordered list here. So, after pressing “Enter”, we remove the “+”, add some space, and put “-“. Once more, this creates a sub-list under the “Fruits” list item where we add “apple”.
After this, we add “mango, banana” by simply pressing “Enter” after each word, and the “-” sign appears automatically. Now, we have to continue our main list, remove the “-” and space from the next line, and put “+ Vegetables” again. We do the same steps again to generate the nested list here, but we use “*”this time. As displayed in the following, we generate three nested unordered lists here in this code.
Code #8:
+ Fruits
- apple
- mango
- banana
+ Vegetables
* carrot
* potato
* peas
+ Dry Fruits
+ almond
+ apricot
+ walnut
Output:
Mixed List in Markdown
A mixed list contains both the ordered and unordered lists inside the nested list. Now, we generate this mixed list in Markdown. We type “1.” and the word “Input Devices”. When we press the “Enter” key, “2.” appears on the following line.
After pressing “Enter”, we remove the “2.”, add some space, and then type “-” to construct a nested unordered list inside the ordered list. Again, this creates a sub-list beneath the “Input Devices” list item to which we add “Mouse”. We put “Keyboard, Microphone” in the next lines. After this, the “-” sign automatically appears after pressing “Enter” after each word. We now continue with our main list, so we delete the space and “-” from the subsequent line and add “2.” once more and then type “Output Devices”. After this, an unordered nested list is inserted here again.
Code #9:
1. Input Devices
- Mouse
- Keyboard
- Microphone
2. Output Devices
* Monitor
* Plotter
* Speaker
Output:
The mixed list is now created and displayed as the result of the previously generated code. This list contains both the ordered and unordered lists inside it.
Conclusion
In this tutorial, the “markdown lists” are discussed. We learned how adding distinct lists to Markdown is possible. The “Numbered list” is simple to include in the Markdown. We explained that to build a numbered list in Markdown, the number and dot must be added at the beginning of each item. We also showed that the unordered list has been added using three symbols or signs. We also studied the nested list in Markdown here. In this tutorial, we made a lot of lists with numbers or symbols as ordered, unordered, and nested lists.