{"id":26780468,"url":"https://github.com/kaihendry/toc","last_synced_at":"2025-04-19T10:57:26.259Z","repository":{"id":57551086,"uuid":"60184159","full_name":"kaihendry/toc","owner":"kaihendry","description":"Creates a Table Of Contents","archived":false,"fork":false,"pushed_at":"2021-01-10T04:43:58.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T16:55:26.705Z","etag":null,"topics":["contents","document","faq","html","navigation","table","toc"],"latest_commit_sha":null,"homepage":"","language":"Go","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/kaihendry.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}},"created_at":"2016-06-01T14:29:33.000Z","updated_at":"2021-03-27T17:40:27.000Z","dependencies_parsed_at":"2022-09-10T09:21:47.959Z","dependency_job_id":null,"html_url":"https://github.com/kaihendry/toc","commit_stats":null,"previous_names":["kaihendry/gonav"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Ftoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Ftoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Ftoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Ftoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaihendry","download_url":"https://codeload.github.com/kaihendry/toc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249678881,"owners_count":21309839,"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":["contents","document","faq","html","navigation","table","toc"],"created_at":"2025-03-29T07:16:49.843Z","updated_at":"2025-04-19T10:57:26.241Z","avatar_url":"https://github.com/kaihendry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creates a table of contents from [h1, h2, h3, h4, h5, and h6 elements](https://html.spec.whatwg.org/multipage/semantics.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements)\n\n[![Build Status](https://travis-ci.org/kaihendry/toc.svg?branch=master)](https://travis-ci.org/kaihendry/toc)\n\n\u003cimg src=http://s.natalian.org/2016-06-05/toc.gif alt=\"Demo\"\u003e\n\nAn element with `data-fill-with=\"table-of-contents\"` is filled with an ordered list of the headers.\n\nThis allows users to hyperlink directly to answers.\n\n## Install\n\nTo install:\n\n\tgo install github.com/kaihendry/toc/cmd/toc\n\nTo keep upto date:\n\n\tgo get -u github.com/kaihendry/toc/cmd/toc\n\n## Example\n\n`foo.html` contains:\n\n\t\u003ch1\u003eFAQ\u003c/h1\u003e\n\t\u003cnav data-fill-with=\"table-of-contents\" id=\"toc\"\u003e\u003c/nav\u003e\n\t\u003ch3 id=\"how-do-i-create-a-faq\"\u003eHow do I create a FAQ?\u003c/h3\u003e\u003cp\u003eLike this!\u003c/p\u003e\n\nRun the tool over the HTML\n\n\t$ toc foo.html\n\nAnd something like the following should print to `/dev/stdout`\n\n\t\u003ch1\u003eFAQ\u003c/h1\u003e\n\t\u003cnav data-fill-with=table-of-contents id=toc\u003e\n\t\u003col\u003e\n\t\u003cli\u003e\u003ca href=#how-do-i-create-a-faq\u003eHow do I create a FAQ?\u003c/a\u003e\n\t\u003c/ol\u003e\n\t\u003c/nav\u003e\n\t\u003ch3 id=how-do-i-create-a-faq\u003eHow do I create a FAQ?\u003c/h3\u003e\n\t\u003cp\u003eLike this!\u003c/p\u003e\n\nAs used on:\n\n* \u003chttps://webconverger.com/faq/\u003e\n\n## Acknowledgements\n\nMany thanks to [tabatkins's bikeshed](https://github.com/tabatkins/bikeshed) for the inspiration \u0026 the most helpful [Golang programmer I know, Zoltan](https://github.com/zgiber).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaihendry%2Ftoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaihendry%2Ftoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaihendry%2Ftoc/lists"}