OSD600 - LAB 06
Gustavo Tavares
Posted on October 29, 2021
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
Code:
var md = require('markdown-it')();
var result = md.render('# markdown-it rulezz!');
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.
Posted on October 29, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
September 4, 2023