Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

jarvanstack/marknum

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


MarkNum - 自动生成 markdown 标题序号

自动添加/更新 markdown 标题序号,支持多级标题。

1. 示例代码

输入

$ marknum -file test.md
[成功] 输出文件: test.md.marknum.md 

原始文件 test.md

# 一级标题

## 二级标题

### 三级标题

## 二级标题

### 三级标题

输出文件 test.md.marknum.md

#  一级标题

## 1. 二级标题

### 1.1. 三级标题

## 2. 二级标题

2. 安装

2.1. Go语言安装

go install github.com/jarvanstack/marknum@latest

2.2. 可执行文件

下载可执行文件: https://github.com/jarvanstack/marknum/releases

3. 使用

$ marknum -h
Usage of marknum:
  -cover
        是否覆盖原文件, 默认为 false, 新建 $filename.marknum.md 文件
  -dir string
        深度遍历目录下所有md文件(和 -file 二选一)
  -file string
        指定文件
  -max int
        最大标题级数, 范围[min,max), 默认为二级,三级,四级标题生成序号 (default 5)
  -min int
        最小标题级数, 范围[min,max), 默认为二级,三级,四级标题生成序号 (default 2)

4. 常用命令

# 将当前目录下所有 markdown 文件添加/更新序号, 覆盖源文件
marknum -dir ./ -cover ture

About

自动生成 markdown 标题序号

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.