Creating markdown blog or docs generator with js (serverless).

Hey there everyone ,
If you’ve created blog on dev.to , you’re might be familiar with blog generator with md.
I’ll share how you can create that type of generator with only js.

libraries to use.

Showdown.js @showdownjs

Markdown.css by sin…

Hey there everyone ,
If you’ve created blog on dev.to , you’re might be familiar with blog generator with md.
I’ll share how you can create that type of generator with only js.



libraries to use.



showdown.js

showdownjs-image

Showdownjs is a library which converts markdown code into HTML code.
From

# header
**Bold**
_italic_

To

<h1>header</h1>
<strong>bold</strong>
<em>italic</em>



How to use showdown.js

You should visit to official docs for advanced level tools of library.
I’ll show you how you can convert the md into html with GitHub flavour of markdown.

var my_markdown_input = document.querySelector("#mdinput") , converter = new showdown.converter();
var converted_text = converter.makeHtml(my_markdown_input);
// converted_text will be variable having html code 



Markdown css

The style created by sindresorhus which looks like github markdown body.



How to use markdown css ?

The markdown css by sindresorhus is very simple to use. You just have to add classname “markdown-body” and it will convert html into GitHub like markdown styled html.

<div class="markdown-body"></div>

..Read More


Print Share Comment Cite Upload Translate
APA
Shubham | Sciencx (2024-03-28T10:41:35+00:00) » Creating markdown blog or docs generator with js (serverless).. Retrieved from https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/.
MLA
" » Creating markdown blog or docs generator with js (serverless).." Shubham | Sciencx - Wednesday December 15, 2021, https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/
HARVARD
Shubham | Sciencx Wednesday December 15, 2021 » Creating markdown blog or docs generator with js (serverless).., viewed 2024-03-28T10:41:35+00:00,<https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/>
VANCOUVER
Shubham | Sciencx - » Creating markdown blog or docs generator with js (serverless).. [Internet]. [Accessed 2024-03-28T10:41:35+00:00]. Available from: https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/
CHICAGO
" » Creating markdown blog or docs generator with js (serverless).." Shubham | Sciencx - Accessed 2024-03-28T10:41:35+00:00. https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/
IEEE
" » Creating markdown blog or docs generator with js (serverless).." Shubham | Sciencx [Online]. Available: https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/. [Accessed: 2024-03-28T10:41:35+00:00]
rf:citation
» Creating markdown blog or docs generator with js (serverless). | Shubham | Sciencx | https://www.scien.cx/2021/12/15/creating-markdown-blog-or-docs-generator-with-js-serverless/ | 2024-03-28T10:41:35+00:00
https://github.com/addpipe/simple-recorderjs-demo