{"_id":"markdown-to-react-components","_rev":"467854","name":"markdown-to-react-components","description":"Convert markdown into react components","dist-tags":{"latest":"0.2.4"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"time":{"modified":"2021-08-05T08:03:41.000Z","created":"2015-07-08T10:07:29.903Z","0.2.4":"2017-02-22T14:11:42.358Z","0.2.3":"2017-01-03T08:40:57.868Z","0.2.2":"2016-11-30T09:49:42.516Z","0.2.1":"2016-06-27T14:05:14.959Z","0.2.0":"2016-02-02T08:00:53.439Z","0.1.4":"2015-12-28T15:48:22.729Z","0.1.3":"2015-11-22T01:25:34.827Z","0.1.2":"2015-11-22T00:29:52.231Z","0.1.1":"2015-07-23T12:00:26.418Z","0.1.0":"2015-07-08T10:07:29.903Z"},"users":{},"author":{"name":"Christian Alfoni"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"versions":{"0.2.4":{"name":"markdown-to-react-components","version":"0.2.4","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","json-loader":"^0.5.2","node-libs-browser":"^0.5.2","react":"^0.14.7","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1"},"dependencies":{"he":"^1.1.0","marked":"^0.3.3"},"gitHead":"c76823dd0d0890d36f4fe9ad89679bd297e5e469","_id":"markdown-to-react-components@0.2.4","_shasum":"e2854edc4ff0fe9e360282e8b1c3e5637d57c3db","_from":".","_npmVersion":"4.0.5","_nodeVersion":"6.9.4","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"e2854edc4ff0fe9e360282e8b1c3e5637d57c3db","size":8720,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.2.4.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/markdown-to-react-components-0.2.4.tgz_1487772701632_0.63416069583036"},"directories":{},"publish_time":1487772702358,"_cnpm_publish_time":1487772702358,"_hasShrinkwrap":false},"0.2.3":{"name":"markdown-to-react-components","version":"0.2.3","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","json-loader":"^0.5.2","node-libs-browser":"^0.5.2","react":"^0.14.7","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1"},"dependencies":{"he":"^1.1.0","marked":"^0.3.3"},"gitHead":"08d9c9da8b497be01ac4d361cb4c0eae503a81fe","_id":"markdown-to-react-components@0.2.3","_shasum":"90a9c2286aa0cbd006bf127ae9f74b9d2176f103","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"90a9c2286aa0cbd006bf127ae9f74b9d2176f103","size":8589,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.2.3.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/markdown-to-react-components-0.2.3.tgz_1483432857258_0.7022332909982651"},"directories":{},"publish_time":1483432857868,"_cnpm_publish_time":1483432857868,"_hasShrinkwrap":false},"0.2.2":{"name":"markdown-to-react-components","version":"0.2.2","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","json-loader":"^0.5.2","node-libs-browser":"^0.5.2","react":"^0.14.7","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1"},"dependencies":{"he":"^1.1.0","marked":"^0.3.3"},"gitHead":"50265710eb895912f0276e992a33e20526be70b3","_id":"markdown-to-react-components@0.2.2","_shasum":"6ce830dd93f54a9df77eb3a355b32722c522e493","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"6ce830dd93f54a9df77eb3a355b32722c522e493","size":8571,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.2.2.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/markdown-to-react-components-0.2.2.tgz_1480499380587_0.1865844908170402"},"directories":{},"publish_time":1480499382516,"_cnpm_publish_time":1480499382516,"_hasShrinkwrap":false},"0.2.1":{"name":"markdown-to-react-components","version":"0.2.1","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","json-loader":"^0.5.2","node-libs-browser":"^0.5.2","react":"^0.14.7","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1"},"dependencies":{"he":"^1.1.0","marked":"^0.3.3"},"gitHead":"3ff48930488918dd73704a854b1dfa36e841e97d","_id":"markdown-to-react-components@0.2.1","_shasum":"3dee99f0cdbdb9764aae8bfabcf5d45815d7ed58","_from":".","_npmVersion":"3.7.2","_nodeVersion":"5.2.0","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"3dee99f0cdbdb9764aae8bfabcf5d45815d7ed58","size":8556,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.2.1.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/markdown-to-react-components-0.2.1.tgz_1467036312412_0.5309602527413517"},"directories":{},"publish_time":1467036314959,"_cnpm_publish_time":1467036314959,"_hasShrinkwrap":false},"0.2.0":{"name":"markdown-to-react-components","version":"0.2.0","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","marked":"^0.3.3"},"gitHead":"96a370901fc861aed9fe9bb85f18dbafeb94014f","_id":"markdown-to-react-components@0.2.0","_shasum":"1acbb151f9ff80b4e27e129ec7ecd7224e2dfd68","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"1acbb151f9ff80b4e27e129ec7ecd7224e2dfd68","size":8604,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.2.0.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"_npmOperationalInternal":{"host":"packages-8-eu.internal.npmjs.com","tmp":"tmp/markdown-to-react-components-0.2.0.tgz_1454400050430_0.09968139696866274"},"directories":{},"publish_time":1454400053439,"_cnpm_publish_time":1454400053439,"_hasShrinkwrap":false},"0.1.4":{"name":"markdown-to-react-components","version":"0.1.4","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","highlight.js":"^8.6.0","marked":"^0.3.3"},"gitHead":"5ab2d770b229b9c733e59dd434a4fdaafcedf136","_id":"markdown-to-react-components@0.1.4","_shasum":"1247aa1b37fbbb2fdf6368da96f27458290e5f16","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"1247aa1b37fbbb2fdf6368da96f27458290e5f16","size":4382,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.1.4.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"directories":{},"publish_time":1451317702729,"_cnpm_publish_time":1451317702729,"_hasShrinkwrap":false},"0.1.3":{"name":"markdown-to-react-components","version":"0.1.3","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","highlight.js":"^8.6.0","marked":"^0.3.3"},"gitHead":"8d49c85836a1340dfbf03c5944195cd6f0620a63","_id":"markdown-to-react-components@0.1.3","_shasum":"e2d9dfb5732af9a70deea284af2f06dd3bda3916","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"e2d9dfb5732af9a70deea284af2f06dd3bda3916","size":4377,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.1.3.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"directories":{},"publish_time":1448155534827,"_cnpm_publish_time":1448155534827,"_hasShrinkwrap":false},"0.1.2":{"name":"markdown-to-react-components","version":"0.1.2","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/christianalfoni/markdown-to-react-components.git"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","highlight.js":"^8.6.0","marked":"^0.3.3"},"gitHead":"9514e063b0955b58ad588ec4ceb7e216e40f9ba3","_id":"markdown-to-react-components@0.1.2","_shasum":"43c23c0f95e3ad294a5661f3992c6ef6b6d75d30","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"43c23c0f95e3ad294a5661f3992c6ef6b6d75d30","size":4375,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.1.2.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"directories":{},"publish_time":1448152192231,"_cnpm_publish_time":1448152192231,"_hasShrinkwrap":false},"0.1.1":{"name":"markdown-to-react-components","version":"0.1.1","description":"Convert markdown into react components","main":"src/index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/christianalfoni/markdown-to-react-components"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","peerDependencies":{"react":"^0.13.3"},"devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","highlight.js":"^8.6.0","marked":"^0.3.3"},"gitHead":"56958441677137945064de2687705ad7b6e69828","_id":"markdown-to-react-components@0.1.1","_shasum":"f2b186be51ce41ae58b7c97f3805ddecc638ae2e","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"f2b186be51ce41ae58b7c97f3805ddecc638ae2e","size":4430,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.1.1.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"directories":{},"publish_time":1437652826418,"_cnpm_publish_time":1437652826418,"_hasShrinkwrap":false},"0.1.0":{"name":"markdown-to-react-components","version":"0.1.0","description":"Convert markdown into react components","main":"index.js","scripts":{"start":"webpack-dev-server --devtool eval-source-map --progress --colors --content-base build","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/christianalfoni/markdown-to-react-components"},"keywords":["react","markdown","convert"],"author":{"name":"Christian Alfoni"},"license":"MIT","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","peerDependencies":{"react":"^0.13.3"},"devDependencies":{"css-loader":"^0.15.2","node-libs-browser":"^0.5.2","style-loader":"^0.12.3","webpack":"^1.10.0","webpack-dev-server":"^1.10.1","json-loader":"^0.5.2"},"dependencies":{"ent":"^2.2.0","highlight.js":"^8.6.0","marked":"^0.3.3"},"gitHead":"2d82b51ace3235ef35c63e5f8f388a4fcdbbbb80","_id":"markdown-to-react-components@0.1.0","_shasum":"9e7ae462b0ed6a72ff06c8817a9ad29b8b755699","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"christianalfoni","email":"christianalfoni@gmail.com"},"dist":{"shasum":"9e7ae462b0ed6a72ff06c8817a9ad29b8b755699","size":4422,"noattachment":false,"key":"/markdown-to-react-components/-/markdown-to-react-components-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/markdown-to-react-components/download/markdown-to-react-components-0.1.0.tgz"},"maintainers":[{"name":"christianalfoni","email":"christian.jorgensen@marcello.no"}],"directories":{},"publish_time":1436350049903,"_cnpm_publish_time":1436350049903,"_hasShrinkwrap":false}},"readme":"# markdown-to-react-components\nConvert markdown into react components\n\n## Whats different?\nThere are several projects that claims to convert markdown using React, but that is not exactly right. They produce one single React component with some plain markdown converted HTML in it. They do not produce React components of the markdown syntax. **But this project does!**\n\n## Features\n- Converts markdown syntax to React components. It is a lot more performant on live changes\n- Define your own components to be used as headers, lists etc.\n- Code highlighting using Prism.js\n- Also returns a TOC (Table Of Contents), based on headers used\n- TOC and Header ids match so that you can use anchor links (&lt;a href=\"#my-heading&gt;My heading&lt;/a&gt;)\n\n## Install\n`npm install markdown-to-react-components`\n\n## How to use\n```js\nimport React from 'react';\nimport MTRC from 'markdown-to-react-components';\n\nMTRC.configure({\n  h1: React.createClass({\n    render() {\n      return <h1 id={this.props.id} style={{color: 'red'}}>{this.props.children}</h1>\n    }\n  })\n});\n\nconst Editor = React.createClass({\n  getInitialState() {\n    return {\n      content: null\n    };\n  },\n  onTextareaChange(event) {\n    this.setState({\n      content: MTRC(event.target.value).tree\n    });\n  },\n  render() {\n    return (\n      <div>\n        <div>{this.state.content}</div>\n        <textarea onChange={this.onTextareaChange}/>\n      </div>\n    );\n  }\n});\n\nexport default Editor;\n```\n\n## Code highlight\nYou will have to include the [Prism.js](https://prismjs.com/) library and its css manually in your project. Look in the example app to see how this is done.\n\n```js\n\n    ```javascript\n    var foo = 'bar';\n    ```\n\n    ```html\n    <h1>Hello world!</h1>\n    ```\n\n```\nSupported languages can be found over at [prism.js](https://prismjs.com/).\n\n## API\n\n### Configure\nAllows you to configure custom elements for your markdown.\n\n```js\nMTRC.configure({\n  h1: React.createClass({\n    render() {\n      return <h1 style={{color: 'red'}}>{this.props.children}</h1>\n    }\n  })\n});\n```\n\n- **h1**: this.props.children, this.props.id\n- **h2**: this.props.children, this.props.id\n- **h3**: this.props.children, this.props.id\n- **h4**: this.props.children, this.props.id\n- **blockquote**: this.props.children\n- **hr**: -\n- **ol**: this.props.children\n- **ul**: this.props.children\n- **p**: this.props.children\n- **table**: this.props.children\n- **tr**: this.props.children\n- **th**: this.props.children\n- **td**: this.props.children\n- **td**: this.props.children\n- **a**: this.props.children, this.props.href, this.props.title, this.props.target\n- **strong**: this.props.children\n- **em**: this.props.children\n- **br**: -\n- **del**: this.props.children\n- **img**: this.props.src, this.props.alt\n- **code**: this.props.language, this.props.code\n- **codespan**: this.props.children\n\n### Convert\n```js\nMTRC('# Hello there').tree // React virtual dom tree\nMTRC('# Hello there').toc // [{children: [], level: 1, title: 'Hello there', id: 'hello-there'}]\n```\n\n## Run demo\n- `npm install`\n- `npm start`\n- Go to: `http://localhost:8080/webpack-dev-server/bundle`\n","_attachments":{},"homepage":"https://github.com/christianalfoni/markdown-to-react-components","bugs":{"url":"https://github.com/christianalfoni/markdown-to-react-components/issues"},"license":"MIT"}