A while ago I worked on a bigger project, which is built around markdown. As it grew the limits of the language became obvious, so I decided to create my own syntax extensions to fit my use case. Today, I released the results as two separate JavaScript libraries.
But one thing at a time: Markdown is a markup language, basically a way to format text just like HTML, XML or Tex. Compared to its competitors, markdown is extremely easy to use, lightweight and readable. You can understand a markdown-formatted text without parsing it. A list looks like a list, a heading looks like a heading and a link… well, you can guess it is a link because there’s a URL following the text.
Markdown pretty much took the Internet by storm and now powers a lot of famous services: Github, many content management systems and of course this blog.
The functionality, however, is limited. Fancy formatting like setting the font color is not possible. That’s for a good reason though: for example the authors should not take control over the design of your website. A text highlight should appear the way the designer decided and not sparkle in all colors of the rainbow…
Yet some use cases could profit from an extended markdown syntax. Github for example has task lists to make tracking to-do lists easier by displaying little checkboxes next to the items. Luckily, some markdown parsers provide the possibility to enable plugins to create your own flavour of the language.
I did exactly that and here are the results: two plugins for the well-known parser markdown-it: markdown-it-collapsible and markdown-it-label. You can guess from the name, which functionality they add, can’t you? Well then, check them out on Github!
Written on April 9th, 2020 by Bioruebe