{"name":"markdown-contents","description":"Generate table of contents for a markdown document.","keywords":["table of contents","contents","toc","markdown"],"version":"1.0.8","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.3.0","gitdown":"^2.3.0","gulp":"^3.9.0","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","require-new":"^1.1.0"},"dependencies":{"contents":"^4.0.2"},"gitHead":"30822ea6ede15740a8a167b7a617017ee0e20cba","bugs":{"url":"https://github.com/gajus/markdown-contents/issues"},"homepage":"https://github.com/gajus/markdown-contents#readme","_id":"markdown-contents@1.0.8","_shasum":"b21affbe8f48412987f4e7417b27014d05b54e43","_from":".","_npmVersion":"3.3.3","_nodeVersion":"4.1.0","_npmUser":{"name":"gajus","email":"gk@anuary.com"},"dist":{"shasum":"b21affbe8f48412987f4e7417b27014d05b54e43","tarball":"http://registry-npm.ywwl.com/markdown-contents/download/markdown-contents-1.0.8.tgz","integrity":"sha512-5I2qosv0pXS0Fwl7kIGWW34me5GzE4VXsFco2jxZI/cic/byTcN+0w2Cqq63fX6qyqhvKgI1mV/I/V4quG+X+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM6oQ5xcVGkSSwYKJDegq+9fJj/Jjz/JwC7XmsV4GuqAIgAIF9BPLG/nJJS6Y3NkjlPfXCMU6xFatVJ9+tCl59SM8="}],"size":3603,"noattachment":false,"key":"/markdown-contents/-/markdown-contents-1.0.8.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"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":1443741753335,"_cnpm_publish_time":1443741753335,"dist-tags":{"latest":"1.0.11"}}