Prerequisites:
To perform the steps that are demonstrated in this guide, the following components are required:
- A suitable Markdown editor. For example, VSCodium, Pulsar, or any online Markdown editor.
- (Optional) Basic understanding of Markdown.
Bullets in Markdown
Markdown is a lightweight markup language that can add the formatting elements to a plain text document. It supports elements like images, links, heading, footnotes, tables, and more. Besides the built-in syntax, Markdown also supports various HTML tags.
In Markdown, bullets are used to signify the unordered lists. Markdown allows the nested lists and it also applies to unordered lists. Alternatively, we can also achieve the same result using HTML.
Preparing the Editor
For the purpose of this guide, we will use the Pulsar editor. It’s a community-driven fork of the Atom editor (now discontinued) that continues to build upon the original Atom editor. It comes with a built-in Markdown preview feature. It’s available for all the major platforms (Windows, Linux, and macOS).
From the main window of Pulsar, create a new blank document using the “Ctrl + N” keyboard shortcut or go to File >> New File.
Now, launch the Markdown preview using the “Ctrl + Shift + M” keyboard shortcut or go to Packages >> Markdown Preview >> Toggle Preview.
To get the HTML output of the Markdown, right-click on the preview panel and select “Copy as HTML” or “Save as HTML”.
Creating Bullets in Markdown
To create a bullet point, there are 3 different syntaxes that are supported by the default Markdown:
- *
- +
- –
Using any of these symbols starts an unordered list in the output. Check out the following example:
* item 2
* item 3
It’s equivalent to the following HTML code:
If you’re using HTML, we can use CSS to change the style of the item marker:
There are 4 available styles for the item marker:
- disc: The default item marker.
- circle: A circle with blank space inside.
- square: A solid square.
- none: No item marker is used.
Creating Sub-Bullets in Markdown
When creating a nested unordered list, Markdown automatically generates the sub-bullets for the items. Check out the following example:
* item 2
+ item a
+ item b
- item x
- item y
- item z
Here:
- We create a three-layer nested unordered list.
- Markdown identifies and applies the sub-bullets to the items of the nested list.
If the unordered list is nested within an ordered list, Markdown also creates the sub-bullets. Check out the following example:
2. item 2
* sub-item 1
* sub-item 2
+ sub-item x
+ sub-item y
3. item 3
Here:
- We create a multi-layer nested list.
- The outermost layer is an ordered list.
- The nested unordered lists are marked as sub-bullets.
From the output so far, we can make the following conclusions:
- The disc is the primary item marker for the first tier of unordered list.
- Any subsequent nested unordered list uses circle and square as item markers, respectively.
What happens if you add more layers of unordered lists? Check out the following example:
2. item 2
* sub-item 1
* sub-item 2
+ sub-item x
+ sub-item y
- sub-item I
- sub-item II
- sub-item III
3. item 3
Note that the output is completely up to the implementation of the rendering engine. Since there are various implementations of Markdown, not all features may be compatible with the target platform. Thus, make sure that the output matches your expectation before putting the Markdown document in action.
Conclusion
We showcased how to create and use the bullets and sub-bullets in Markdown. Markdown uses bullets to indicate the items of unordered lists and sub-bullets to indicate the items of nested unordered lists. We also briefly demonstrated how to use HTML to specify the custom item markers for unordered lists.
Check out the Markdown sub-category to learn more about Markdown.