登录 注册

github-markdown-toc

去点 Star
效率与办公工具开发者工具
3,307
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Shell
语言
创建时间
最近更新

项目能做什么

为 GitHub 的 README.md 轻松生成目录(TOC)的工具。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
gh-md-toc
=========

[![CI](https://github.com/ekalinin/github-markdown-toc/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/ekalinin/github-markdown-toc/actions/workflows/ci.yml)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/ekalinin/github-markdown-toc)

gh-md-toc — is for you if you **want to generate TOC** (Table Of Content) for a README.md or
a GitHub wiki page **without installing additional software**.

It's my try to fix a problem:

  * [github/issues/215](https://github.com/isaacs/github/issues/215)

gh-md-toc is able to process:

  * stdin
  * local files (markdown files in local file system)
  * remote files (html files on github.com)

gh-md-toc tested on Ubuntu, and macOS High Sierra (gh-md-toc release 0.4.9). If you want it on Windows, you
better to use a golang based implementation:

  * [github-markdown-toc.go](https://github.com/ekalinin/github-markdown-toc.go)

It's more solid, reliable and with ability of a parallel processing. And
absolutely without dependencies.

Table of contents
=================

<!--ts-->
   * [Installation](#installation)
   * [Usage](#usage)
      * [STDIN](#stdin)
      * [Local files](#local-files)
      * [Remote files](#remote-files)
      * [Multiple files](#multiple-files)
      * [Combo](#combo)
      * [Auto insert and update TOC](#auto-insert-and-update-toc)
      * [GitHub token](#github-token)
      * [TOC generation with Github Actions](#toc-generation-with-github-actions)
   * [Tests](#tests)
   * [Dependency](#dependency)
   * [Docker](#docker)
     * [Local](#local)
     * [Public](#public)
<!--te-->


Installation
============

Linux (manual installation)
```bash
$ wget https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc
$ chmod a+x gh-md-toc
```

MacOS (manual installation)
```bash
$ curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
$ chmod a+x gh-md-toc
```

Linux or MacOS (using [Basher](https://github.com/basherpm/basher))
```bash
$ basher install ekalinin/github-markdown-toc
# `gh-md-toc` will automatically be available in the PATH
```

Usage
=====


STDIN
-----

Here's an example of TOC creating for markdown from STDIN:

```bash
➥ cat ~/projects/Dockerfile.vim/README.md | ./gh-md-toc -
  * [Dockerfile.vim](#dockerfilevim)
  * [Screenshot](#screenshot)
  * [Installation](#installation)
        * [OR using Pathogen:](#or-using-pathogen)
        * [OR using Vundle:](#or-using-vundle)
  * [License](#license)
```

Local files
-----------

Here's an example of TOC creating for a local README.md:

```bash
➥ ./gh-md-toc ~/projects/Dockerfile.vim/README.md


Table of Contents
=================

  * [Dockerfile.vim](#dockerfilevim)
  * [Screenshot](#screenshot)
  * [Installation](#installation)
        * [OR using Pathogen:](#or-using-pathogen)
        * [OR using Vundle:](#or-using-vundle)
  * [License](#license)
```

To include only headings up to a given level, use 
阅读完整原文

商业机会分析 AI 生成

README 文档自动化体检与生成 SaaS (含 CI/CD 插件)

产品构想从单纯生成 TOC 扩展为全自动 README 增强工具,提供 TOC 生成、死链检测、徽章自动同步、多语言翻译与排版规范校验,以 GitHub App 或 CI Action 形式提供服务。
核心功能一键注入/更新 TOC、外部超链接有效性检测、自动更新开源指标徽章、README 规范评分与优化建议。
目标用户重视品牌与开源影响力的开发团队、企业级开源办公室 (OSPO)。
难度/周期低 · 2-4周 · 成本:极低(主要是轻量级后端 API 及 GitHub App 托管成本)
收费模式Freemium 模式:个人开源仓库免费,私有仓库及高级规则库订阅收费。
竞争风险开源社区白嫖心智极强,现有 VS Code 插件和现成免费 GitHub Actions 竞品过多导致转化极难。
依据 AI推测

开发者文档站点自动打包与发布工具

产品构想基于仓库中的 Markdown 文件,自动根据 TOC 和文档结构将其编译为美观的静态文档站点,并托管在独立域名下。
核心功能自动识别本地或远程 MD 结构、自动生成侧边栏与 TOC、一键绑定自定义域名、内置轻量搜索与访问统计。
目标用户没有精力搭建 Docusaurus/VitePress 的独立开发者及小型初创团队。
难度/周期中等 · 1-2个月 · 成本:低(静态托管分发与构建服务器成本)
收费模式高级功能收费:自定义域名 SSL、文档访问密码保护、团队多成员协作权限。
竞争风险Docusaurus、GitBook、GitHub Pages 等开源或成熟商业工具竞争极为激烈。
依据 尚需验证的假设

技术写作与长文排版排版助手浏览器插件

产品构想面向在 GitHub Issue、PR、Wiki 或 Markdown 网页编辑器中写作的用户,提供一键提取大纲、快速生成并插入符合规范锚点的 TOC 工具。
核心功能浏览器内一键扫描并生成当前页面 Markdown 大纲、自动修正标题层级、支持按深度和编号规则导出。
目标用户技术博主、频繁在 GitHub/GitLab 提交长篇 RFC 或技术方案的工程师。
难度/周期低 · 1-2周 · 成本:极低(仅客户端运行,几乎无服务器成本)
收费模式插件买断制(付费解锁多平台支持及定制模板)或赞助模式。
竞争风险功能过于轻量,属于 Feature 而非 Product,付费意愿极低。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
jonschlinkert/remarkable 中文介绍暂未生成
Markdown parser, done right. Commonmark support, extensions,
5,844 JavaScript
ekalinin/github-markdown-toc.go 中文介绍暂未生成
Easy TOC creation for GitHub README.md (in go)
526 Go
houbb/markdown-toc 中文介绍暂未生成
🎄Generate toc for github markdown file.(为 markdown 文件生成 toc
171 Java
derlin/bitdowntoc 中文介绍暂未生成
Online and command-line Markdown TOC generator, with built-i
107 Kotlin
alexander-lee/markdown-github-bear-toc 中文介绍暂未生成
Autogenerated Table of Contents for Github Markdown or Bear
96 Python
frnmst/md-toc 中文介绍暂未生成
Automatically generate and add an accurate table of contents
39 Python
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 ,最近推送 ,发布过 23 个 Release
社区活跃Star 3,307 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/ekalinin/github-markdown-toc.git
cd github-markdown-toc
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。