{"id":15989242,"url":"https://github.com/robot-inventor/astro-custom-toc","last_synced_at":"2026-01-17T01:19:46.210Z","repository":{"id":225605446,"uuid":"766397918","full_name":"Robot-Inventor/astro-custom-toc","owner":"Robot-Inventor","description":"Astro Integration to generate a customizable table of contents","archived":false,"fork":false,"pushed_at":"2025-03-07T23:03:44.000Z","size":1202,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T21:03:54.947Z","etag":null,"topics":["astro","astro-integration","astrojs","markdown","withastro"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robot-Inventor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-03T06:28:58.000Z","updated_at":"2025-03-04T15:53:52.000Z","dependencies_parsed_at":"2024-03-03T07:28:05.912Z","dependency_job_id":"3c878962-1a33-4b55-b4da-c339d75a5681","html_url":"https://github.com/Robot-Inventor/astro-custom-toc","commit_stats":{"total_commits":220,"total_committers":6,"mean_commits":"36.666666666666664","dds":"0.40454545454545454","last_synced_commit":"756f8e43c2691d80fc14a5808e13581e2950a4d6"},"previous_names":["robot-inventor/astro-custom-toc"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Fastro-custom-toc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Fastro-custom-toc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Fastro-custom-toc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Fastro-custom-toc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robot-Inventor","download_url":"https://codeload.github.com/Robot-Inventor/astro-custom-toc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243865576,"owners_count":20360468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["astro","astro-integration","astrojs","markdown","withastro"],"created_at":"2024-10-08T04:41:10.109Z","updated_at":"2026-01-17T01:19:46.203Z","avatar_url":"https://github.com/Robot-Inventor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# astro-custom-toc\n\nAstro Integration to generate a customizable table of contents. This is a convenient wrapper for [rehype-custom-toc](https://github.com/Robot-Inventor/rehype-custom-toc/). If you are not using Astro, you can directly use rehype-custom-toc instead.\n\n\u003e [!WARNING]\n\u003e This plugin uses [remark-comment](https://github.com/leebyron/remark-comment). It may break other plugins that use comments.\n\n## Installation\n\n```bash\nnpx astro add astro-custom-toc\n```\n\n### Manual Install\n\nInstall the package\n\n```bash\nnpm install astro-custom-toc\n```\n\nAdd the plugin to your `astro.config.mjs`. **This plugin must be inserted before the [mdx()](https://github.com/withastro/astro/tree/main/packages/integrations/mdx/) plugin if you are using it.**\n\n```javascript\nimport { defineConfig } from \"astro/config\";\nimport customToc from \"astro-custom-toc\";\n\n// https://astro.build/config\nexport default defineConfig({\n    // ... other config\n    integrations: [customToc(), mdx()]\n});\n```\n\n## Usage\n\nTo include a table of contents in your markdown file, add ``showToc: true`` to the frontmatter of the markdown file. The table of contents will be inserted at the location of the `\u003c!-- toc --\u003e` comment or at the beginning of the file if no comment is found.\n\n```markdown\n---\nshowToc: true\n---\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n\u003c!-- toc --\u003e\n\n## Section 1\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n### Subsection 1.1\n\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n```\n\n## Options\n\nAll options of rehype-custom-toc can be used in this plugin. Please refer to the [rehype-custom-toc documentation](https://github.com/Robot-Inventor/rehype-custom-toc/) for options.\n\n## Development\n\n```bash\nnpm install\n```\n\n### Build\n\n```bash\nnpm run build\n```\n\n### Format and Lint\n\n```bash\nnpm run format\nnpm run lint\n```\n\n### Pull Requests\n\nThis repository uses [Changesets](https://github.com/changesets/changesets) to manage versioning and releases. When creating a pull request, please run the Changesets CLI and commit the changeset file.\n\n```bash\nnpx changeset\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobot-inventor%2Fastro-custom-toc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobot-inventor%2Fastro-custom-toc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobot-inventor%2Fastro-custom-toc/lists"}