0.0.2 • Published 5 years ago

@juliuste/mdjson v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

@juliuste/mdjson

Transform markdown to an object with headings as keys. Originally forked from yoshuawuyts/mdjson.

npm version Build Status Greenkeeper badge license chat on gitter

Installation

npm install @juliuste/mdjson

Usage

const mdjson = require('@juliuste/mdjson')

const dictionary = mdjson(`
    text before any headings will be ignored

    # my heading
    oh wow, amazing
    newline means new paragraph

    another paragraph

    ### another heading
    gorgeous copy, stunning, [some other markdown](https://www.abc.de)

    ## headings without content will also be ignored
`)
// => {
//  'my heading': 'oh wow, amazing\n\nnewline means new paragraph\n\nanother paragraph',
//  'another heading': 'gorgeous copy, stunning, [some other markdown](https://www.abc.de)'
//}

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.