DEV Community

Gustavo Tavares
Gustavo Tavares

Posted on

OSD600 - LAB 06

For this lab our goal was to understand how to use the Docusaurus, pick a feature from it and start to implement it into our SSG.

The Feature

For my SSG, I decided to go with the Full Markdown support. Issue #16
The Full Markdown support consists in making the SSG able to parse all markdown into HTML.
As described in LAB 06, I could use a open source library to help me with that.

Markdown-it

Markdown-it was the library I have chosen to help me with the parsing task.
The library was really intuitive and easy to use.
The steps I had to take were:
Install:

npm install markdown-it --save
Enter fullscreen mode Exit fullscreen mode

Code:

var md = require('markdown-it')();
var result = md.render('# markdown-it rulezz!');
Enter fullscreen mode Exit fullscreen mode

So in My SSG I just had to remove my old MD parsing method for this new one.
The PR is here: PR #17

Finally

The markdown-it was really useful and saved me a lot of time, thanks to it I am able to think about implementing other features to my SSG.

Top comments (0)