{"id":15048550,"url":"https://github.com/houbb/markdown-toc","last_synced_at":"2025-04-05T05:08:20.469Z","repository":{"id":57720088,"uuid":"119490510","full_name":"houbb/markdown-toc","owner":"houbb","description":"🎄Generate toc for github markdown file.（为 markdown 文件生成 toc 目录）","archived":false,"fork":false,"pushed_at":"2023-06-10T14:26:38.000Z","size":229,"stargazers_count":166,"open_issues_count":2,"forks_count":255,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T04:08:53.489Z","etag":null,"topics":["github","java","jdk","markdown","md","toc"],"latest_commit_sha":null,"homepage":"https://houbb.github.io/opensource/markdown-toc/","language":"Java","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/houbb.png","metadata":{"files":{"readme":"README-ENGLISH.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-01-30T06:05:55.000Z","updated_at":"2024-11-17T15:54:54.000Z","dependencies_parsed_at":"2025-01-05T01:11:09.806Z","dependency_job_id":"eb03eae4-799a-418f-bb57-b8b545c70133","html_url":"https://github.com/houbb/markdown-toc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fmarkdown-toc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fmarkdown-toc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fmarkdown-toc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fmarkdown-toc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houbb","download_url":"https://codeload.github.com/houbb/markdown-toc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289428,"owners_count":20914464,"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","java","jdk","markdown","md","toc"],"created_at":"2024-09-24T21:13:56.699Z","updated_at":"2025-04-05T05:08:20.448Z","avatar_url":"https://github.com/houbb.png","language":"Java","readme":"# Table of Contents\n\n* [markdown-toc](#markdown-toc)\n  * [The Features](#the-features)\n* [environmental dependence](#environmental-dependence)\n  * [the JDK](#the-jdk)\n  * [Maven](#maven)\n* [quick start](#quick-start)\n  * [maven introduced](#maven-introduced)\n  * [md file](#md-file)\n  * [quick start](#quick-start-1)\n* [attribute configuration](#attribute-configuration)\n  * [attribute description](#attribute-description)\n  * [return value description](#return-value-description)\n* [test cases](#test-cases)\n* [other](#other)\n\n\n# markdown-toc\n\n```\n  _ __ ___   __ _ _ __| | ____| | _____      ___ __       | |_ ___   ___ \n | '_ ` _ \\ / _` | '__| |/ / _` |/ _ \\ \\ /\\ / / '_ \\ _____| __/ _ \\ / __|\n | | | | | | (_| | |  |   \u003c (_| | (_) \\ V  V /| | | |_____| || (_) | (__ \n |_| |_| |_|\\__,_|_|  |_|\\_\\__,_|\\___/ \\_/\\_/ |_| |_|      \\__\\___/ \\___|\n \n```\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.houbb/markdown-toc/badge.svg)](http://mvnrepository.com/artifact/com.github.houbb/markdown-toc)\n[![Build Status](https://www.travis-ci.org/houbb/markdown-toc.svg?branch=release_1.0.2)](https://www.travis-ci.org/houbb/markdown-toc?branch=release_1.0.2)\n[![Coverage Status](https://coveralls.io/repos/github/houbb/markdown-toc/badge.svg?branch=release_1.0.2)](https://coveralls.io/github/houbb/markdown-toc?branch=release_1.0.2)\n\nMarkdown-to-toc can be used to generate a directory of the Markdown page for github page rendering.\n\n- README\n\n[中文说明](README.md) | [English Readme](README-ENGLISH.md)\n\n\u003e note\n\nFor the title, there are two kinds of md grammar [setext] (http://docutils.sourceforge.net/mirror/setext.html)\nAnd [atx] (http://www.aaronsw.com/2002/atx/) mode.\n\n**atx** form is only supported temporarily.\n\n## The Features\n\n- Github Markdown file one click to generate the directory\n\n- fluent and elegant writing is supported\n\n- support multiple generation\n\n- support the generation of duplicate titles\n\n- supports filtering of special characters\n\n- supports specifying different file codes\n\n- supports batch processing of files in folders (you can specify whether subfolder files are included)\n\n- supports writing to files, returns contents of the directory, and allows users to process by themselves\n\n- support multi-threads for directory files.\n\n- support i18n\n\n- support gen toc number\n\n# environmental dependence\n\n## the JDK\n\nJDK8+, make sure the JDK is set up correctly.\n\nNote: If you are use jdk7，download this code and compile by yourself.\n## Maven\n\nJars are managed uniformly using [Maven](http://maven.apache.org/).\n\nChange log\n\n\u003e [change log](doc/changelog/CHANGELOG-ENGLISH.MD)\n\n# quick start\n\n## maven introduced\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.houbb\u003c/groupId\u003e\n    \u003cartifactId\u003emarkdown-toc\u003c/artifactId\u003e\n    \u003cversion\u003e${maven-version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## md file\n\nThe project for the support of md file name suffix `.md` or `.markdown`\n\n## quick start\n\n- single file\n\n```Java\nAtxMarkdownToc.newInstance().genTocFile(path);\n```\n\nWhere path is the path of md file\n\n- specified folder\n\n```Java\nAtxMarkdownToc.newInstance().genTocFile(path);\n```\n\nWhere path is the parent class folder of the md file\n\n# attribute configuration\n\n- code examples\n\n```Java\nAtxMarkdownToc.newInstance()\n                .charset(\"UTF-8\")\n                .write(true)\n                .subTree(true);\n```\n\n## attribute description\n| 序号 | 属性 | 默认值 |  说明 |\n|:----|:----|:----|:----|\n| 1 | charset | `UTF-8` | file charset | \n| 2 | write | `true` | will toc written to the file (default write) | \n| 3 | subTree | `true` | does it include subfolders(default includes) | \n| 3 | order | `false` | does it gen toc order num(default false, since 1.0.5) | \n\n\n## return value description\n\n`genTocFile()` returns TocGen, `genTocDir()` returns List\u003cTocGen\u003e\n\n- TocGen attribute description\n\n| 序号 | 属性 |  类型 |  说明 |\n|:----|:----|:----| :----|\n| 1 | filePath | String | current md filePath |\n| 2 | tocLines | List\u003cString\u003e | current md file toc content |\n\n# test cases\n\n[a single file - directory to generate test cases](https://github.com/houbb/markdown-toc/blob/release_1.0.2/src/test/java/com/github/houbb/markdown/toc/core/impl/AtxMarkdownTocFileTest.java)\n\n[folder - directory to generate test cases](https://github.com/houbb/markdown-toc/blob/release_1.0.2/src/test/java/com/github/houbb/markdown/toc/core/impl/AtxMarkdownTocDirTest.java)\n\n# other\n\n\u003e [Issues \u0026 Bugs] (https://github.com/houbb/markdown-toc/issues)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoubb%2Fmarkdown-toc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoubb%2Fmarkdown-toc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoubb%2Fmarkdown-toc/lists"}