{"id":23119384,"url":"https://github.com/xinlin-z/toc4github","last_synced_at":"2025-10-24T11:31:17.967Z","repository":{"id":108807981,"uuid":"313224954","full_name":"xinlin-z/toc4github","owner":"xinlin-z","description":"Generate Table of Contents (TOC) for Github Markdown file (like README.md) automatically","archived":false,"fork":false,"pushed_at":"2023-10-28T12:14:40.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T06:55:04.336Z","etag":null,"topics":["github","markdown","python","toc","toc-generator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xinlin-z.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,"governance":null}},"created_at":"2020-11-16T07:42:20.000Z","updated_at":"2023-05-12T02:56:24.000Z","dependencies_parsed_at":"2023-10-03T14:03:32.159Z","dependency_job_id":"51bdd36d-d015-4a63-94f1-b0afeb238ec2","html_url":"https://github.com/xinlin-z/toc4github","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinlin-z%2Ftoc4github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinlin-z%2Ftoc4github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinlin-z%2Ftoc4github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinlin-z%2Ftoc4github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xinlin-z","download_url":"https://codeload.github.com/xinlin-z/toc4github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237961254,"owners_count":19393789,"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","markdown","python","toc","toc-generator"],"created_at":"2024-12-17T05:34:10.847Z","updated_at":"2025-10-24T11:31:17.963Z","avatar_url":"https://github.com/xinlin-z.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toc4github\n\n* [Install](#Install)\n* [Usage](#Usage)\n* [Showcase](#Showcase)\n\nThe `toc4github` is a very tiny tool to automatically generate Table of\nContents (TOC) for Markdown file, especially for README.md in Github.com.\nIt might also be used for other markdown rendering system, but\nI never tested! :)\n\n## Install\n\n``` shell\n$ pip install toc4github\n$ python -m toc4github -h  # inline help\n```\n\n## Usage\n\nYou should insert a placeholder which is `{toc}` in README.md. The\nplaceholder ocuppies a whole line. Then:\n\n``` shell\n$ python -m toc4github [-d] [-t TITLE] \u003cpath/to/README.md\u003e\n```\n\nNow, the placeholder is replaced by TOC generated with an optional title,\nand your markdown file is updated.\n\nOr, you can call `make_toc` interface in your python code. It returns\nthe TOC as string in accordance with input, and you can do anything\nyou want with it.\n\n``` python\n# how to import\nfrom toc4github import make_toc\n# signature\nmake_toc(lines: Iterable[str]|str) -\u003e str\n```\n\n## Showcase\n\n![toc4github](/showcase.png)\n\nIn addition, All my repos' TOC are generated by toc4github.\nHave fun ... ^___^\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinlin-z%2Ftoc4github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxinlin-z%2Ftoc4github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinlin-z%2Ftoc4github/lists"}