{"id":13341964,"url":"https://github.com/droctothorpe/toco","last_synced_at":"2025-03-11T23:30:45.461Z","repository":{"id":48292620,"uuid":"355926794","full_name":"droctothorpe/toco","owner":"droctothorpe","description":"A CLI that automates TOC (table of contents) generation for GitHub wikis.","archived":false,"fork":false,"pushed_at":"2021-08-03T00:43:18.000Z","size":6980,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-24T10:08:43.395Z","etag":null,"topics":["github-wiki","github-wiki-sidebar","toc","wiki"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/droctothorpe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-08T13:52:48.000Z","updated_at":"2022-01-21T09:02:57.000Z","dependencies_parsed_at":"2022-09-26T19:53:14.650Z","dependency_job_id":null,"html_url":"https://github.com/droctothorpe/toco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droctothorpe%2Ftoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droctothorpe%2Ftoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droctothorpe%2Ftoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droctothorpe%2Ftoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/droctothorpe","download_url":"https://codeload.github.com/droctothorpe/toco/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243129601,"owners_count":20241041,"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":["github-wiki","github-wiki-sidebar","toc","wiki"],"created_at":"2024-07-29T19:27:12.421Z","updated_at":"2025-03-11T23:30:44.825Z","avatar_url":"https://github.com/droctothorpe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toco\n\n`toco` is a CLI that automates TOC (table of contents) generation for GitHub\nwikis. \n\nIt generates a TOC based on the files in your wiki and injects them into your\nhomepage (`Home.md`) and sidebar (`_Sidebar.md`). \n\nYou can see an example of what the resulting TOC looks like\n[here](https://github.com/droctothorpe/example-wiki/wiki).\n\nYou can set `toco` up as a client-side pre-commit hook or integrate it into your\nCI pipeline for even further automation.\n\n## Usage\n```\n ______   ______     ______     ______    \n/\\__  _\\ /\\  __ \\   /\\  ___\\   /\\  __ \\   \n\\/_/\\ \\/ \\ \\ \\/\\ \\  \\ \\ \\____  \\ \\ \\/\\ \\  \n   \\ \\_\\  \\ \\_____\\  \\ \\_____\\  \\ \\_____\\ \n    \\/_/   \\/_____/   \\/_____/   \\/_____/ \n                                          \nA CLI to automate TOC (table of contents) generation for GitHub wikis.\n\nUsage:\n  toco [command]\n\nAvailable Commands:\n  gen         Generate a table of contents and inject it into your wiki's homepage and sidebar\n  help        Help about any command\n  push        Consolidate git add, commit, and push\n  version     Print version data\n\nFlags:\n      --config string   config file (default is $HOME/.toco.yaml)\n  -d, --debug           verbose logging\n  -h, --help            help for toco\n```\n### Generate\n```bash\n❯ toco gen    \nGenerating table of contents.\nInjecting table of contents into [Home.md _Sidebar.md].\nInjection complete. Run 'toco push' to push your changes.\n```\n\nYou can then `toco push` to push changes to your remote GH wiki with a single\ncommand. This assumes you commit directly to master on your wiki. If not, just\nuse git directly.\n\n## Filename convention\nYour markdown files must adhere to the following naming convention in order for\ntoco to work:\n```\ncategory:title.md\n```\nFor example, the following files:\n```\nPipeline:CD.md\nPipeline:CI.md\nStandards:Development.md\n```\nwould generate the following TOC:\n\n- **Pipeline**  \n  - [CD](./Pipeline%3ACD)  \n  - [CI](./Pipeline%3ACI)  \n- **Standards**  \n  - [Development](./Standards%3ADevelopment)  \n\n## Installation\n\n### Go get\n```bash\ngo get github.com/droctothorpe/toco\n```\n\n### Makefile\n```bash\ngit clone https://github.com/droctothorpe/toco.git\nmake install\n```\n\n### Configure\n`toco` relies on the presence of the following block in your `Home.md` and\n`_Sidebar.md` files to know where to inject the generated TOC:\n```\n\u003c!--starttoc--\u003e\n\u003c!--endtoc--\u003e\n```\nIf it's not present, just add it before running `toco`.\n\n## To do\n- Auto-append toc tags if they're not present.\n- Make everything more configurable. \n- Automate cross-compiled binary builds. \n- Add pre-commit hook implementation documentation.\n- Implement unit tests.\n- Add target directory flag.\n\nContributions are welcome and appreciated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroctothorpe%2Ftoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdroctothorpe%2Ftoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroctothorpe%2Ftoco/lists"}