Skip to content
/ mdjson Public
forked from yoshuawuyts/mdjson

Transform markdown to an object where headings are keys

License

Notifications You must be signed in to change notification settings

hughsk/mdjson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdjson

NPM version build status Test coverage Downloads js-standard-style

Transform markdown to an object where headings are keys.

Installation

$ npm install mdjson

Usage

const mdjson = require('mdjson')

mdjson(`
  ## my heading
  oh wow, amazing

  ## another heading
  gorgeous copy, stunning
`)
// => {
//  'my heading': {
//    raw: 'oh wow, amazing',
//    html: '<p>oh wow, amazing</p>'
//  },
//  'another heading': {
//    raw: 'gorgeous copy, stunning',
//    html: '<p>gorgeous copy, stunning</p>'
//  }
//}

Why?

Writing copy in markdown is more pleasant than writing it inline in html or JS. This module allows you to separate copy from markup on a page per page basis.

See Also

  • newspeak - Natural language localization
  • ndjson - newline delimited json parser, not to be confused with this markdown module

License

MIT

About

Transform markdown to an object where headings are keys

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%