Official README builder for the 30-seconds projects.
npm install --save markdown-builderUsing markdown-builder is quite easy:
constmarkdown=require('markdown-builder');const{ headers }=markdown;headers.hX(3,'3rd Header')// ### 3rd HeaderCheck out 30-seconds-of-code's READMEs, they are automatically generated using markdown-builder
Use the h1,h2,h3,h4,h5,h6 or hX to generate a markdown header. Calling hX with a level above 6 returns a h6 Header.
constmarkdown=require('markdown-builder')const{ headers }=markdownheaders.h1('1st Header')// # 1st Headerheaders.h2('2nd Header')// ## 2nd Headerheaders.h3('3rd Header')// ### 3rd Headerheaders.hX(5,'5th Header using hX')// ##### 5th Header using hXconstmarkdown=require('markdown-builder')const{ emphasis }=markdownemphasis.b('bold text')emphasis.i('italic text')emphasis.s('strikethrough text')constmarkdown=require('markdown-builder')const{ lists }=markdownleta=['Item 1','Item 2']// ordered listlists.ol(a)// 1. Item 1// 2. Item 2lists.ol(a,(item)=>item.toUpperCase())// use callbacks to alter each item// 1. ITEM 1// 2. ITEM 2// unordered Listlists.ul(a)lists.ul(a,(item)=>item.toUpperCase())constmarkdown=require('markdown-builder')const{ misc }=markdown// Imagesletalt='image of lights',url='https://www.w3schools.com/w3css/img_lights.jpg',title='lights'misc.image(alt,url)misc.image(alt,url,title)// Collapsible summary/details blockmisc.collapsible('Summary','content');// Github Anchormisc.anchor('A header with /*() special-characters!');// #a-header-with--special-characters// Linkmisc.link('Github','https://github.com/flxwu')// horizontal rulemisc.hr()Collapsible: