{"name":"markdown-contents","description":"Generate table of contents for a markdown document.","keywords":["table of contents","contents","toc","markdown"],"version":"1.0.5","main":"src/markdown-contents.js","author":{"name":"Gajus Kuizinas","email":"gk@anuary.com"},"repository":{"type":"git","url":"https://github.com/gajus/markdown-contents"},"license":"BSD-3-Clause","scrips":{"test":"gulp test"},"devDependencies":{"chai":"^1.9.2","gulp":"^3.8.9","gulp-jshint":"^1.8.6","gulp-mocha":"^1.1.1","require-new":"^1.0.2"},"dependencies":{"contents":"git://github.com/gajus/contents"},"gitHead":"83e8039a427b7c76649ac23e65d2bb92b49cf97b","bugs":{"url":"https://github.com/gajus/markdown-contents/issues"},"homepage":"https://github.com/gajus/markdown-contents","_id":"markdown-contents@1.0.5","scripts":{},"_shasum":"972dc9559ad102f5a97d8837dadcd5756699106a","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"gajus","email":"gk@anuary.com"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"dist":{"shasum":"972dc9559ad102f5a97d8837dadcd5756699106a","tarball":"http://registry-npm.ywwl.com/markdown-contents/download/markdown-contents-1.0.5.tgz","integrity":"sha512-CtobUIHlm93TnjqVyRsh2rjabQ7lPWkwV7SBl+9pCXd6Wz6bUq/dObR3BO+VHC8fcUXKB3qPlB+BjUBx1vR7fQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7niC3VfddOl2pOMbX7QDjRXo6Pqj4eGA8VDfjeyqBdAiEApeD3dEebVxw53ATug+JLtIExy7UDVykkPa7y/nKT8eo="}],"size":3302,"noattachment":false,"key":"/markdown-contents/-/markdown-contents-1.0.5.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":1416580460734,"_cnpm_publish_time":1416580460734,"dist-tags":{"latest":"1.0.11"}}