{"_id":"jquery.toc","_rev":"1-69d7abfb895549e6e2526df2fdb39eea","name":"jquery.toc","dist-tags":{"latest":"0.4.0"},"versions":{"0.4.0":{"name":"jquery.toc","version":"0.4.0","description":"A minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the page.","homepage":"https://github.com/ndabas/toc#readme","main":"jquery.toc.js","repository":{"type":"git","url":"git+https://github.com/ndabas/toc.git"},"author":{"name":"Nikhil Dabas"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"grunt":"^1.0.1","grunt-contrib-compress":"^1.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jshint":"^1.0.0","grunt-contrib-uglify":"^2.0.0"},"gitHead":"de1b9691847e9926527df3bdb68112895222bb58","bugs":{"url":"https://github.com/ndabas/toc/issues"},"_id":"jquery.toc@0.4.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Cx9z5zsSYnOX+nFRfgqKgcCnIZYMIP7oFxCq+IXCo6rtcNiSis2zmIUL/iG5o+eCYmeoJnmz/xlSqPDyJXps4Q==","shasum":"55e9f04700ba3d38065b358a0d3e2bdc7ba9eec7","tarball":"https://registry.npmjs.org/jquery.toc/-/jquery.toc-0.4.0.tgz","fileCount":4,"unpackedSize":19950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJddgV5CRA9TVsSAnZWagAANX8QAJLFrbhmPGvtkkJOfONk\nCPfvtm9bXMNIlP4/UjNy+EbJCBWqAQ51cGTx43gvFz+qunYIISXiEB4JJalY\nz5eOW8x/2InAX/h9h6zt2XULZ9NTmiDhNhLGdNWCNrKU5TAZXue4S8pb9VlZ\nVtyxfOf3V5jy0vZofI0fg2uGAIvswBqsU9Hy83qTrWzZzXN4HltT0z41ASp9\nVFYorYlpgyu3uvMSnL0X76XhMP1chVsdIFZPgdh/otZ7IXIIExuDm5if7ERX\nWbTn4lPPJFZMnuXQdpzs6vGJQO5mXGcfMG/eFOco/w2zyB85aI4TaaZxh7xo\nsMFeFpSwonYdOijD0SC2q511/9KU+0Iitcog8ntx8a+GluuhzhqyoXXWKSfg\nSVIYzawLnsov9VRCZuMCGCCGDjA0p6vPVhFuaT+SfJCanGsuR53tyXEe5KTs\n1819WMkX2gKe657sfa0LIOQCrKMSdWdRZyxcs7wTqoUEpP5triW1jmRfUyZ4\nA+AJLo1zZUd3K30WQ4YTDXbUq3V1VzTizjReyQIL6jTg3YpdrlnMxrgyeNUI\nprEq3Wc7lMmMAycOod1JurcliOtASWSYVpSuH6QN55+P6l3LImivIep0dwHG\nNGaPgeXEnR0TA9Gq9jmR5y5fUTkHyF0ErrlJfMAqd7ymQVZ5/Ez4RYDRbn/K\n/EiL\r\n=pqaZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgAjbCPYV/uHy9bsFrX+V77Ed9/FLURDSm2P3MNuAfywIgVf12ejcbNaqj+/l/PJ/5eAnOmW8McJFb18yneJ5wlDY="}]},"maintainers":[{"name":"ndabas","email":"ndabas@gmail.com"}],"_npmUser":{"name":"ndabas","email":"ndabas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jquery.toc_0.4.0_1568015737099_0.9812040720361641"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-09T07:55:37.099Z","0.4.0":"2019-09-09T07:55:37.197Z","modified":"2022-05-06T18:02:57.266Z"},"maintainers":[{"name":"ndabas","email":"ndabas@gmail.com"}],"description":"A minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the page.","homepage":"https://github.com/ndabas/toc#readme","repository":{"type":"git","url":"git+https://github.com/ndabas/toc.git"},"author":{"name":"Nikhil Dabas"},"bugs":{"url":"https://github.com/ndabas/toc/issues"},"license":"Apache-2.0","readme":"# Table of Contents jQuery Plugin - jquery.toc\n\nA minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the\npage.\n\nThe generated TOCs are semantic, nested lists (`ul` or `ol`) with hash-link anchors to the headings.\n\n## Usage\n\nYou can [download the latest release](http://ndabas.github.com/toc/assets/jquery.toc.zip), or\ninstall with [Bower](https://bower.io/): `bower install jquery.toc`.\n\nInclude jQuery (>= 1.6) and jquery.toc.js/jquery.toc.min.js on your page. The plugin can then be\nused either via HTML5 data attributes, or via the programmatic API. See below for the available\noptions.\n\n### Via data attributes\n\nMinimal example:\n\n    <ul data-toc></ul>\n\nWith options:\n\n    <ol data-toc=\"div.container\" data-toc-headings=\"h2,h3,h4\"></ol>\n\n### Via the JavaScript programmatic API\n\nMinimal example:\n\n    <ul id=\"toc\"></ul>\n    ...\n    <script type=\"text/javascript\">\n        $(\"#toc\").toc();\n    </script>\n\nWith options:\n\n    <ul id=\"toc\"></ul>\n    ...\n    <script type=\"text/javascript\">\n        $(\"#toc\").toc({content: \"div.container\", headings: \"h2,h3,h4\"});\n    </script>\n\n### Options\n\n    <ul data-toc=\"content\" data-toc-headings=\"headings\"></ul>\n\n    $(...).toc({content: \"body\", headings: \"h1,h2,h3\"});\n\nThe plugin has two options:\n\n* `content` is a selector where the plugin will look for headings to build up the TOC. The default\n  value is `\"body\"`.\n* `headings` is a string with a comma-separated list of selectors to be used as headings, in the\n  order which defines their relative hierarchy level. The default value of `\"h1,h2,h3\"` will select\n  all `h1`, `h2`, and `h3` elements to build the TOC, with `h1` being a level 1, `h2` a level 2, and\n  so on. You can use any valid list of jQuery selectors; for example, if you just want `h1` tags\n  with a specific class, and no `h3` tags, you could use `\"h1.title,h2\"` for this parameter.\n\nIn addition, the plugin will create nested lists of the same type (`ul` or `ol`) as the element that\nit is called on.\n\n### Automatic ID generation\n\nThe plugin generates hash-links to the headings on the page, to allow users to jump to the heading\nby clicking in the generated table of contents. This feature requires that the headings have IDs\nassigned; if they do not, the plugin will generate and assign IDs automatically.\n\nThe generated IDs are based on the text inside the headings, and uses two simple rules:\n\n* Space characters are converted to underscores. Multiple spaces are replaced with a single\n  underscore.\n* If the ID already exists, a suffix like \"_1\", \"_2\", etc. is tried till we get a unique ID.\n\nFor example, a heading like `<h2>Heading 2.1</h2>` will get the ID `Heading_2.1`.\n\n## Alternatives\n\nIf you're looking for a jQuery plugin that does more than just generate a minimal table of contents,\nthe project wiki [lists some more plugins](https://github.com/ndabas/toc/wiki/Alternatives).\n\n## License\n\nLicensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n## Credits\n\nCreated by [Nikhil Dabas](http://www.nikhildabas.com/).\n","readmeFilename":"README.md"}