{"_id":"markdown-it-named-headers","_rev":"5-8586f97aa94cf096c90167310531b4b2","name":"markdown-it-named-headers","description":"Headers have name attributes for markdown-it.","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.2":{"name":"markdown-it-named-headers","version":"0.0.2","description":"Headers have name attributes for markdown-it.","keywords":["markdown-it-plugin"],"homepage":"https://github.com/leff/markdown-it-named-headers","license":{"type":"Unlicense","url":"http://unlicense.org/"},"author":{"name":"Jason Brackins"},"files":["README.md","UNLICENSE","index.js"],"repository":{"type":"git","url":"https://github.com/leff/markdown-it-named-headers"},"dependencies":{"string":"^3.0.1"},"devDependencies":{"markdown-it":"^4.0.1","mocha":"^2.2.1","test":">=0.0.1"},"scripts":{"test":"mocha test/all.js"},"gitHead":"95d902415a06c5c12607bf505f41a4f0fcf3983f","bugs":{"url":"https://github.com/leff/markdown-it-named-headers/issues"},"_id":"markdown-it-named-headers@0.0.2","_shasum":"726a87a5ad62624a65a80751fb209576556ba681","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"leff","email":"jason.brackins@gmail.com"},"maintainers":[{"name":"leff","email":"jason.brackins@gmail.com"}],"dist":{"shasum":"726a87a5ad62624a65a80751fb209576556ba681","tarball":"https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.2.tgz","integrity":"sha512-59VxPuXJM9h+/HgC8+CUdbPVsAA9r6012PXDKBi28U3gWxfDzAkw7/R9B8L3qjReaBxNJJB0Vobnc99Iz8kmmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZKaf0DzNOYficiUgbfSoNePpyVNQwpbjmHZO/c0cDrAiAt/eiEb8r5zRCOx2uBQnJedPM389j7NBnTMmgSC0/i4w=="}]}},"0.0.3":{"name":"markdown-it-named-headers","version":"0.0.3","description":"Headers have name attributes for markdown-it.","keywords":["markdown-it-plugin"],"homepage":"https://github.com/leff/markdown-it-named-headers","license":{"type":"Unlicense","url":"http://unlicense.org/"},"author":{"name":"Jason Brackins"},"files":["README.md","UNLICENSE","index.js"],"repository":{"type":"git","url":"https://github.com/leff/markdown-it-named-headers"},"dependencies":{"string":"^3.0.1"},"devDependencies":{"markdown-it":"^4.0.1","mocha":"^2.2.1","test":">=0.0.1"},"scripts":{"test":"mocha test/all.js"},"gitHead":"c8d818f15671b1f56172498ad4f5ba4bb607e310","bugs":{"url":"https://github.com/leff/markdown-it-named-headers/issues"},"_id":"markdown-it-named-headers@0.0.3","_shasum":"86cb026c1f1d74ccf4c6c7791ebe729c9324b907","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"leff","email":"jason.brackins@gmail.com"},"maintainers":[{"name":"leff","email":"jason.brackins@gmail.com"}],"dist":{"shasum":"86cb026c1f1d74ccf4c6c7791ebe729c9324b907","tarball":"https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.3.tgz","integrity":"sha512-wJJekazyGxh9q+QKJfCrFtjMXRuL5FDfk0NS9rVMhWr1v4HUVTYf138QklPVP1hIHXRJ9k1MOuwBQL2nCTLD0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMVWSzmDVsYh/yufxPav4fRHdZY9rAoiUlmvwsYmGslQIhAJu57Jqyb1rhyUWayXCNB9Yw7To8dyQ00iRvYixyMi3P"}]}},"0.0.4":{"name":"markdown-it-named-headers","version":"0.0.4","description":"Headers have name attributes for markdown-it.","keywords":["markdown-it-plugin"],"homepage":"https://github.com/leff/markdown-it-named-headers","license":{"type":"Unlicense","url":"http://unlicense.org/"},"author":{"name":"Jason Brackins"},"files":["README.md","UNLICENSE","index.js"],"repository":{"type":"git","url":"https://github.com/leff/markdown-it-named-headers"},"dependencies":{"string":"^3.0.1"},"devDependencies":{"markdown-it":"^4.0.1","mocha":"^2.2.1","test":">=0.0.1"},"scripts":{"test":"mocha test/all.js"},"gitHead":"34a70ce138ece361ea7c84b06122f0ffaa22c59e","bugs":{"url":"https://github.com/leff/markdown-it-named-headers/issues"},"_id":"markdown-it-named-headers@0.0.4","_shasum":"82efc28324240a6b1e77b9aae501771d5f351c1f","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"leff","email":"jason.brackins@gmail.com"},"maintainers":[{"name":"leff","email":"jason.brackins@gmail.com"}],"dist":{"shasum":"82efc28324240a6b1e77b9aae501771d5f351c1f","tarball":"https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.4.tgz","integrity":"sha512-2uuJ9urchbulz9F7q6VVQmeGxSXjxFeeGcb4ebKiz3+nuKOho1rLw8866a6zs1EeAe9xdSOKEpqeF5Dv22ZDxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPtQlS1sK/we2oUDmzKasvIftbYpJzLiCFL8ZLHWwO0AIhANjO5QaDpPyqdZA0KyQIXSkI9G9wJv9Y6Cuw7gtwvQH8"}]}}},"readme":"# Markdown-it Named Headers\r\n\r\nA plugin for [markdown-it](https://github.com/markdown-it/markdown-it). Makes header elments have identifer attributes.\r\n\r\n```\r\n# Example Header   -->   <h1 id=\"example-header\">Example</h1>\r\n```\r\n\r\nBy default, it uses [string.js](http://stringjs.com/)'s [slugify](http://stringjs.com/#methods/slugify) to translate header text into a url safe name. You can override this. See _Options_.\r\n\r\nCribbed heavily from https://github.com/valeriangalliat/markdown-it-anchor\r\n\r\n## Install\r\n\r\n```\r\nnpm install --save-dev markdown-it-named-headers\r\n```\r\n\r\n## Usage\r\n\r\nUse with plain old node:\r\n\r\n```js\r\nvar md   = require('markdown-it'),\r\n    mdnh = require('markdown-it-named-headers');\r\n\r\nmd.use(mdnh, options);\r\n```\r\n\r\nUse as part of a Gulp workflow: (Note: You don't need to require named-headers in your gulpfile. gulp-markdown-it takes care of that for you).\r\n\r\n```js\r\nvar gulp = require('gulp'),\r\n    md = require('gulp-markdown-it');\r\ngulp.task('md', [], function() {\r\n    return gulp.src( '**/*.md' )\r\n        .pipe(md({\r\n            plugins: ['markdown-it-named-headers']\r\n        }))\r\n        .pipe(gulp.dest('dist'));\r\n});\r\n```\r\n\r\n\r\n### Options\r\n\r\n\r\n#### Slugify\r\n\r\n```js\r\n{\r\n   slugify: my_slug_function\r\n}\r\n```\r\n\r\nIf string.js's slugify doesn't fit your needs, you can simply pass in your own slugify function. Basically, the API is: accept any string, return a string suitable for a name attribute. Example:\r\n\r\n```js\r\nfunction slugify(input_string) {\r\n    var output_string = my_transform_logic(input_string);\r\n    return output_string;\r\n}\r\n```\r\n\r\nSince we use IDs, we should avoid duplicating them. A second parameter is passed. It is an empty object that will persist across a single call to render. In other words, you can use it to maintain a hash of used_headers per page.\r\n\r\nThe default slugify method looks something like this:\r\n\r\n```js\r\nfunction slugify(input_string, used_headers) {\r\n  var slug = string(input_string).slugify().toString();\r\n  if( used_headers[slug] ) {\r\n    used_headers[slug]++;\r\n    slug += used_headers[slug];\r\n  } else {\r\n    used_headers[slug] += '-' + 1;\r\n  }\r\n  return slug;\r\n}\r\n```\r\n","maintainers":[{"name":"leff","email":"jason.brackins@gmail.com"}],"time":{"modified":"2022-06-19T16:08:58.361Z","created":"2015-03-26T17:29:28.249Z","0.0.2":"2015-03-26T17:29:28.249Z","0.0.3":"2015-03-29T22:56:39.069Z","0.0.4":"2015-11-29T21:50:56.477Z"},"homepage":"https://github.com/leff/markdown-it-named-headers","keywords":["markdown-it-plugin"],"repository":{"type":"git","url":"https://github.com/leff/markdown-it-named-headers"},"author":{"name":"Jason Brackins"},"bugs":{"url":"https://github.com/leff/markdown-it-named-headers/issues"},"license":{"type":"Unlicense","url":"http://unlicense.org/"},"readmeFilename":"README.md"}