md2jsonml-core
TypeScript icon, indicating that this package has built-in type declarations

0.0.17 • Public • Published

md2jsonml-core

npm

Using mark-twain to convert markdown to jsonMl

Getting Started

npm i md2jsonml-core

Usage

const MT = require('md2jsonml-core');
const fs = require('fs');
const jsonML = MT(fs.readFileSync('readme.md','utf-8');

其返回值为 jsonMl

{
  // YAML will be parsed as meta data.
  meta: {
    title: 'Title',
    ...
  },

  // Others will be parsed as JsonML.
  content:  [
    "article",
    ["h1", "Here is a heading"],
    [
      "ol",
      [
        "li",
        [
          "p",
          "First"
        ]
      ],
      ...
    ],
    [
      "p",
      "This is a paragraph, including ",
      [
        "em",
        "EM"
      ],
      " and ",
      [
        "strong",
        "STRONG"
      ],
      ". Any question? Oh, I almost forget ",
      [
        "code",
        "inline code"
      ],
      "."
    ],
    ...
  ]
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i md2jsonml-core

Weekly Downloads

2

Version

0.0.17

License

ISC

Unpacked Size

3.28 kB

Total Files

6

Last publish

Collaborators

  • michaely