{"id":28522873,"url":"https://github.com/developer-zahid/dynamic-toc-generator","last_synced_at":"2026-01-30T11:25:32.943Z","repository":{"id":274597054,"uuid":"923415900","full_name":"Developer-Zahid/dynamic-toc-generator","owner":"Developer-Zahid","description":"Dynamic Table of Contents Generator. Live preview: https://developer-zahid.github.io/dynamic-toc-generator/","archived":false,"fork":false,"pushed_at":"2025-02-04T21:46:10.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T03:37:28.037Z","etag":null,"topics":["blog","table-of-contents","toc","webflow"],"latest_commit_sha":null,"homepage":"https://developer-zahid.github.io/dynamic-toc-generator/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Developer-Zahid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-28T07:44:44.000Z","updated_at":"2025-02-04T21:46:13.000Z","dependencies_parsed_at":"2025-07-06T03:32:13.660Z","dependency_job_id":"92cf71a0-e7bd-4f29-86e4-27571eb0ec40","html_url":"https://github.com/Developer-Zahid/dynamic-toc-generator","commit_stats":null,"previous_names":["developer-zahid/dynamic-toc-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Developer-Zahid/dynamic-toc-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-Zahid%2Fdynamic-toc-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-Zahid%2Fdynamic-toc-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-Zahid%2Fdynamic-toc-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-Zahid%2Fdynamic-toc-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Developer-Zahid","download_url":"https://codeload.github.com/Developer-Zahid/dynamic-toc-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-Zahid%2Fdynamic-toc-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","table-of-contents","toc","webflow"],"created_at":"2025-06-09T09:38:02.653Z","updated_at":"2026-01-30T11:25:32.928Z","avatar_url":"https://github.com/Developer-Zahid.png","language":"HTML","readme":"# Dynamic Table of Contents Generator\n\nA lightweight, jQuery-based Table of Contents generator that automatically creates a dynamic navigation menu from H2 headings in your content.\n[Demo Preview On Codepen](https://codepen.io/DeveloperZahid/full/VYZqgge)\n\n## Features\n\n- 🚀 Automatically generates TOC links from H2 headings\n- 📜 Smooth scrolling to sections\n- 🎯 Active section tracking during scrolling\n- 🔗 URL hash updates without page reload\n- 🎨 Customizable via data attributes\n- 📱 Responsive and mobile-friendly\n- ✨ Handles duplicate heading text\n- 🔄 Supports multiple TOC instances on one page\n\n\n## Installation\n\n1. Add the Dynamic Table of Contents Generator script to your project after jQuery script.\n```\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Developer-Zahid/dynamic-toc-generator@latest/assets/js/script.min.js\" defer\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Basic Structure\n\nYour HTML should follow this basic structure:\n\n```html\n\u003cdiv data-toc-element=\"wrapper\"\u003e\n    \u003cdiv data-toc-element=\"list\"\u003e\u003c/div\u003e\n    \u003cdiv data-toc-element=\"article\"\u003e\n        \u003ch2\u003eYour Heading 1\u003c/h2\u003e\n        \u003cp\u003eContent...\u003c/p\u003e\n        \u003ch2\u003eYour Heading 2\u003c/h2\u003e\n        \u003cp\u003eContent...\u003c/p\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Data Attributes\n\nCopy and use these data attributes to configure your Table of Contents:\n\n```html\n\u003c!-- Wrapper Element --\u003e\n\u003cdiv data-toc-element=\"wrapper\"\u003e\n\n\u003c!-- List Container --\u003e\n\u003cdiv data-toc-element=\"list\"\n     data-toc-link-class=\"your-link-class\"\n     data-toc-active-class=\"your-active-class\"\n     data-toc-scroll-top-offset=\"100\"\n     data-toc-scroll-duration=\"400\"\u003e\n\u003c/div\u003e\n\n\u003c!-- Content Container --\u003e\n\u003carticle data-toc-element=\"article\"\u003e\n```\n\n#### Available Data Attributes\n\n| Attribute | Description | Default |\n|-----------|-------------|---------|\n| `data-toc-element=\"wrapper\"` | Main wrapper element | Required |\n| `data-toc-element=\"list\"` | Container for TOC links | Required |\n| `data-toc-element=\"article\"` | Content container with H2 headings | Required |\n| `data-toc-link-class` | CSS class for TOC links | \"toc-link\" |\n| `data-toc-active-class` | CSS class for active TOC link | \"active\" |\n| `data-toc-scroll-top-offset` | Offset from top when scrolling (in pixels) | 0 |\n| `data-toc-scroll-duration` | Scroll animation duration (in milliseconds) | 400 |\n\n### Example with All Options\n\n```html\n\u003cmain data-toc-element=\"wrapper\"\u003e\n    \u003caside\u003e\n        \u003cdiv data-toc-element=\"list\"\n             data-toc-link-class=\"list_link\"\n             data-toc-active-class=\"cc-active\"\n             data-toc-scroll-top-offset=\"100\"\n             data-toc-scroll-duration=\"800\"\u003e\n        \u003c/div\u003e\n    \u003c/aside\u003e\n    \u003carticle data-toc-element=\"article\"\u003e\n        \u003c!-- Your content with H2 headings --\u003e\n        \u003ch2\u003eExample Heading 1\u003c/h2\u003e\n        \u003ch2\u003eExample Heading 2\u003c/h2\u003e\n    \u003c/article\u003e\n\u003c/main\u003e\n```\n\n### Generated Output\n\n```html\n\u003cmain data-toc-element=\"wrapper\"\u003e\n    \u003caside\u003e\n        \u003cdiv data-toc-element=\"list\"\n             data-toc-link-class=\"list_link\"\n             data-toc-active-class=\"cc-active\"\n             data-toc-scroll-top-offset=\"100\"\n             data-toc-scroll-duration=\"800\"\u003e\n            \u003cbutton type=\"button\" class=\"list_link cc-active\" data-href=\"#example-heading-1\"\u003eExample Heading 1\u003c/button\u003e\n            \u003cbutton type=\"button\" class=\"list_link\" data-href=\"#example-heading-2\"\u003eExample Heading 2\u003c/button\u003e\n        \u003c/div\u003e\n    \u003c/aside\u003e\n    \u003carticle data-toc-element=\"article\"\u003e\n        \u003c!-- Your content with H2 headings --\u003e\n        \u003ch2 id=\"#example-heading-1\" \u003eExample Heading 1\u003c/h2\u003e\n        \u003ch2 id=\"#example-heading-2\" \u003eExample Heading 2\u003c/h2\u003e\n    \u003c/article\u003e\n\u003c/main\u003e\n```\n\n## Browser Support\n\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Edge (latest)\n- IE11 and above\n\n## Dependencies\n\n- jQuery 3.x\n\n## Author\n\n[Developer-Zahid](https://github.com/Developer-Zahid)\n\n## License\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-zahid%2Fdynamic-toc-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper-zahid%2Fdynamic-toc-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-zahid%2Fdynamic-toc-generator/lists"}