Markdown

Markdown Checkbox

“Markdown is an excellent markup language for writing well-formatted and minimal documents. Markdown itself is a lightweight markup language developed by John Gruber and Aaron Swartz in 2004. It allows you to include formatting markup to plain text and process them into rendered HTML documents.

Markdown is heavily adopted in a lot of areas, including static site generators, code documentation, etc.

In this tutorial, we will look at one of the features of extended markdown, how to create task lists, checklists, or to-do lists.”

Task List/Checkbox

A task list or checkbox is simple formatting that allows you to create a list of items and include a checkbox. You can check set this value as checked or unchecked depending on the target status.

We can create checkboxes in markdown using a dash, a space, and a square bracket. Keep in mind that this is an extended feature and will depend on the Markdown application.

The syntax below shows how to create an unchecked checkbox in Markdown:

- []

For example:

# Popular Databases
- [ ] Oracle
- [ ] MySQL
- [ ] Microsoft SQL Server
- [ ] PostgreSQL
- [ ] Redis
- [ ] Elasticsearch
- [ ] SQLite
- [ ] MariaDB
- [ ] Solr
- [ ] Neo4j
- [ ] HBase
- [ ] Couchbase

The Markdown above should render output as shown:

You can also create a checkbox by adding an x to the pair of square brackets. The syntax is as shown:

- [x]

For example:

# Popular Databases
- [ ] Oracle
- [x] MySQL
- [x] Microsoft SQL Server
- [x] PostgreSQL
- [ ] Redis
- [ ] Elasticsearch
- [x] SQLite
- [x] MariaDB
- [ ] Solr
- [ ] Neo4j
- [ ] HBase
- [x] Couchbase

The above markdown code should return a rendered output as shown:

And with that, you have a way of creating checkboxes, checklists, or to-do lists in Markdown.

Conclusion

In this tutorial, we explored how to create checkboxes in Markdown, using the hyphen, a space, and square brackets syntax.

Thanks for reading & Happy documenting!!

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list