{"name":"markdown-contents","description":"Generate table of contents for a markdown document.","keywords":["table of contents","contents","toc","markdown"],"version":"1.0.9","main":"./src/markdown-contents.js","author":{"name":"Gajus Kuizinas","email":"gk@anuary.com","url":"http://gajus.com"},"repository":{"type":"git","url":"git+https://github.com/gajus/markdown-contents.git"},"license":"BSD-3-Clause","scripts":{"test":"gulp test"},"devDependencies":{"chai":"^3.5.0","gitdown":"^2.4.10","gulp":"^3.9.1","gulp-jshint":"^2.0.1","gulp-mocha":"^3.0.1","require-new":"^1.1.0"},"dependencies":{"contents":"^4.0.2"},"gitHead":"6f4dff78d7bda3e7ba097ca820aa2040ba974e7f","bugs":{"url":"https://github.com/gajus/markdown-contents/issues"},"homepage":"https://github.com/gajus/markdown-contents#readme","_id":"markdown-contents@1.0.9","_shasum":"31a7db5f412c07f05b86e46cc5db0e3d53a85a3c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"31a7db5f412c07f05b86e46cc5db0e3d53a85a3c","tarball":"http://registry-npm.ywwl.com/markdown-contents/download/markdown-contents-1.0.9.tgz","integrity":"sha512-U5NAVfWw6zOWz1zhu4TezsuS1/frmNUyN2ucSEYU4wpvb6HD2qUAwJdPXmPNXkcpI3T9jL0U5nHqABkPjOs8FQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGv3ozBE8HonPnFx+25XWRAyk5PNuRvMcKc5xpr6N13iAiEA0St7kG5M+GrTWombXR1yx+Bxu5gP2I2/Ex/qx7ZTRXE="}],"size":3587,"noattachment":false,"key":"/markdown-contents/-/markdown-contents-1.0.9.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/markdown-contents-1.0.9.tgz_1472595557388_0.6990387048572302"},"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":1472595559300,"_cnpm_publish_time":1472595559300,"dist-tags":{"latest":"1.0.11"}}