{"name":"markdown-contents","description":"Generate table of contents for a markdown document.","keywords":["table of contents","contents","toc","markdown"],"version":"1.0.6","main":"src/markdown-contents.js","author":{"name":"Gajus Kuizinas","email":"gk@anuary.com"},"repository":{"type":"git","url":"git+https://github.com/gajus/markdown-contents.git"},"license":"BSD-3-Clause","scrips":{"test":"gulp test"},"devDependencies":{"chai":"^3.2.0","gitdown":"^1.3.2","gulp":"^3.9.0","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","require-new":"^1.1.0"},"dependencies":{"contents":"^4.0.1"},"gitHead":"1ac6a3d469133c9d862e4a9131efd18c3aa8476b","bugs":{"url":"https://github.com/gajus/markdown-contents/issues"},"homepage":"https://github.com/gajus/markdown-contents#readme","_id":"markdown-contents@1.0.6","scripts":{},"_shasum":"f9a8e9f44cf71aa0b4af8ece1f5440904ac80b55","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"gajus","email":"gk@anuary.com"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"dist":{"shasum":"f9a8e9f44cf71aa0b4af8ece1f5440904ac80b55","tarball":"http://registry-npm.ywwl.com/markdown-contents/download/markdown-contents-1.0.6.tgz","integrity":"sha512-r/P6/6KL2gnHcHtHUXKItmfwM2M2lnQt4FR5W8Si19qsFvw72VogslhLBKFd7TeRi19pqW1/aw2fXrqdc3mUQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe4PK5t1+iizlE6x0fd4XXzwHkMCWSjgtGygcYuNpI1gIhAOJybZLEsKQ8pzOZxRhOYktcsQgj89DGFenidn+Lua9g"}],"size":3607,"noattachment":false,"key":"/markdown-contents/-/markdown-contents-1.0.6.tgz"},"directories":{},"readme":"## Markdown Contents\n\n[![Travis build status](http://img.shields.io/travis/gajus/markdown-contents/master.svg?style=flat-square)](https://travis-ci.org/gajus/markdown-contents)\n[![Coveralls](https://img.shields.io/coveralls/gajus/markdown-contents.svg?style=flat-square)](https://coveralls.io/github/gajus/markdown-contents)\n[![NPM version](http://img.shields.io/npm/v/markdown-contents.svg?style=flat-square)](https://www.npmjs.org/package/markdown-contents)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas)\n\nGenerate table of contents for a markdown document.\n\nThe underlying implementation is rendering markdown file into HTML and then use [Contents](https://github.com/gajus/contents).\n to generate the table of contents.\n\n## Usage\n\n```js\nimport MarkdownContents from 'markdown-contents';\n\nconst markdown = '';\nconst markdownContents = MarkdownContents(markdown);\n\n/**\n * Generate flat index of the headings.\n *\n * @return {Array}\n */\nmarkdownContents.articles();\n\n/**\n * Generates hierarchical index of the headings from a flat index.\n *\n * @return {Array}\n */\nmarkdownContents.tree();\n\n/**\n * Generate markdown for the table of contents.\n *\n * @return {string}\n */\nmarkdownContents.markdown();\n\n/**\n * Generate markdown contents for an array of contents object definition.\n *\n * @param {Array} tree [{id: '', name: '', descendants: []}]\n * @return {string} markdown\n */\nMarkdownContents.treeToMarkdown();\n\n/**\n * Makes hierarchical index of the articles from a flat index.\n *\n * @param {Array} articles Generated using Contents.articles.\n * @param {boolean} makeUniqueIDs\n * @param {Array} uniqueIDpool\n * @return {Array}\n */\nMarkdownContents.tree();\n\n```\n","publish_time":1441889726329,"_cnpm_publish_time":1441889726329,"dist-tags":{"latest":"1.0.11"}}