{"name":"markdown-contents","description":"Generate table of contents for a markdown document.","keywords":["table of contents","contents","toc","markdown"],"version":"1.0.4","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":"1dcf8d525eea4002492c9dd2e008ceee46627676","bugs":{"url":"https://github.com/gajus/markdown-contents/issues"},"homepage":"https://github.com/gajus/markdown-contents","_id":"markdown-contents@1.0.4","scripts":{},"_shasum":"b7d01863744abbd2dd47b5d98625a3ee52b6a4e0","_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":"b7d01863744abbd2dd47b5d98625a3ee52b6a4e0","tarball":"http://registry-npm.ywwl.com/markdown-contents/download/markdown-contents-1.0.4.tgz","integrity":"sha512-ko8j/fIFrK5vjjCkmt8ywhKDa5Xs5/zCW1z/WTHVkA9fEy1IksTzskhisYxEQ/sF+Gs7/niSTeFUF03aJlomjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzvM4ROkKU0LOmvKkRZY5P8Vm8+ZEohI4c/GIgaOl2PwIhAJzskjQIrcmnfplkevVu/t2Z2GrFNiA23LW5tf803G4O"}],"size":3238,"noattachment":false,"key":"/markdown-contents/-/markdown-contents-1.0.4.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":1416578937971,"_cnpm_publish_time":1416578937971,"dist-tags":{"latest":"1.0.11"}}