{"name":"markdown-to-ast","description":"Parse Markdown to AST with location info.","version":"4.1.0-alpha.6a53d00c","homepage":"https://github.com/textlint/textlint/tree/master/packages/markdown-to-ast/","repository":{"type":"git","url":"git+https://github.com/textlint/textlint.git"},"main":"lib/markdown-parser.js","files":["lib/","src/"],"scripts":{"example:build":"browserify example/js/index.js -o example/app/app.js","test":"mocha test/","build":"cross-env NODE_ENV=production babel src --out-dir lib --source-maps","watch":"babel src --out-dir lib --watch --source-maps","prepublish":"npm run --if-present build"},"directories":{"test":"test/"},"author":{"name":"azu"},"license":"MIT","bugs":{"url":"https://github.com/textlint/textlint/issues"},"dependencies":{"@textlint/ast-node-types":"^1.2.0-alpha.6a53d00c","debug":"^2.1.3","remark":"^7.0.1","structured-source":"^3.0.2","traverse":"^0.6.6"},"devDependencies":{"babel-cli":"^6.24.1","babel-preset-env":"^1.4.0","babel-preset-jsdoc-to-assert":"^4.0.0","babel-preset-power-assert":"^1.0.0","babel-register":"^6.24.1","browserify":"^14.3.0","cross-env":"^4.0.0","mkdirp":"^0.5.1","mocha":"^3.3.0","power-assert":"^1.4.2","textlint-ast-test":"^1.1.3","txt-ast-traverse":"^1.2.1"},"_id":"markdown-to-ast@4.1.0-alpha.6a53d00c","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"azu","email":"azuciao@gmail.com"},"dist":{"integrity":"sha512-CuKr45d/OvbkssqwDkaUSfTra066OybfPDLHrt6cBYZXVtnL6oG/zTlvAOhkU/h4eG7tF1k1Ox5wcxazKQ/Dew==","shasum":"60bd9630d0b8842bfb06d8c421cdf8887a688679","tarball":"http://registry-npm.ywwl.com/markdown-to-ast/download/markdown-to-ast-4.1.0-alpha.6a53d00c.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO0TEW1qB88LAy34Cm4bh5tTozWnX0wew5RmLjQWJO+AIhAPTcyCYy8p8qXgJVZXg9N3+Pmfh8RPo6/RceV4Hy+zME"}],"size":7158,"noattachment":false,"key":"/markdown-to-ast/-/markdown-to-ast-4.1.0-alpha.6a53d00c.tgz"},"maintainers":[{"name":"azu","email":"azuciao@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/markdown-to-ast-4.1.0-alpha.6a53d00c.tgz_1508846494591_0.5228372327983379"},"readme":"# markdown-to-ast\n\nParse Markdown to AST with location info.\n\nThis library is not parser itself, it dependent on [wooorm/remark](https://github.com/wooorm/remark).\n\n> Markdown -> remark -> markdown-to-ast -> `TxtNode`s\n\nThe AST consists of `TxtNode`s.\nA `TxtNode` of the AST has following properties:\n\n- `loc` - Nodes have line and column-based location info.\n- `range` - Nodes have an index-based location range (array).\n- `raw` - Node have a `raw` text.\n- `value` - Node have a `value` of text.\n\nThe interface are defined in [textlint/txtnode.md](https://github.com/textlint/textlint/blob/master/docs/txtnode.md \"textlint/txtnode.md at master · textlint/textlint\")\n\nThis library is a part of [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n**If you need to markdown parser, please use [wooorm/remark](https://github.com/wooorm/remark) directly.**\n\n## DEMO\n\n[![screenshot](http://monosnap.com/image/0fqi1UF7yOv89nxJPaDWtvyqERaM49.png)](http://textlint.github.io/markdown-to-ast/example/)\n\n[Online Parsing Demo](http://textlint.github.io/markdown-to-ast/example/) provide markdown to AST on-the-fly.\n\n## Installation\n\n```\nnpm install markdown-to-ast\n```\n\n## Usage\n\n```sh\nvar parse = require(\"markdown-to-ast\").parse;\nvar markdown = \"It's a *text*\";\nvar AST = parse(markdown);\n/*\n{\n    \"type\": \"Document\",\n    \"children\": [\n        {\n            \"type\": \"Paragraph\",\n            \"children\": [\n                {\n                    \"type\": \"Str\",\n                    \"value\": \"It's a \",\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 0\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        }\n                    },\n                    \"range\": [\n                        0,\n                        7\n                    ],\n                    \"raw\": \"It's a \"\n                },\n                {\n                    \"type\": \"Emphasis\",\n                    \"children\": [\n                        {\n                            \"type\": \"Str\",\n                            \"value\": \"text\",\n                            \"loc\": {\n                                \"start\": {\n                                    \"line\": 1,\n                                    \"column\": 8\n                                },\n                                \"end\": {\n                                    \"line\": 1,\n                                    \"column\": 12\n                                }\n                            },\n                            \"range\": [\n                                8,\n                                12\n                            ],\n                            \"raw\": \"text\"\n                        }\n                    ],\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 13\n                        }\n                    },\n                    \"range\": [\n                        7,\n                        13\n                    ],\n                    \"raw\": \"*text*\"\n                }\n            ],\n            \"loc\": {\n                \"start\": {\n                    \"line\": 1,\n                    \"column\": 0\n                },\n                \"end\": {\n                    \"line\": 1,\n                    \"column\": 13\n                }\n            },\n            \"range\": [\n                0,\n                13\n            ],\n            \"raw\": \"It's a *text*\"\n        }\n    ],\n    \"loc\": {\n        \"start\": {\n            \"line\": 1,\n            \"column\": 0\n        },\n        \"end\": {\n            \"line\": 1,\n            \"column\": 13\n        }\n    },\n    \"range\": [\n        0,\n        13\n    ],\n    \"raw\": \"It's a *text*\"\n}\n*/\n```\n\nIf you want to know real use-case, please see [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n## Tests\n\n```\nnpm test\n```\n\n### Create fixtures\n\nSee [tools/](tools/) directory.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## License\n\nMIT\n","publish_time":1508846494907,"_cnpm_publish_time":1508846494907,"dist-tags":{"canary":"4.1.0-alpha.6a53d00c","latest":"6.0.3","next":"6.0.0-next.0"}}