百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mdbook-toc

> 编程语言
开源

一个用于 mdbook 的预处理器,可添加内联目录支持。

193 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个用于 mdbook 的预处理器,可添加内联目录支持。

mdbook-toc

A preprocessor for mdbook to add inline Table of Contents support.

It turns this marker:

markdown

into a Table of Contents based on headings of the chapter following the marker.

Installation

If you want to use only this preprocessor, install the tool:

bash
cargo install mdbook-toc

Add it as a preprocessor to your book.toml:

toml
[preprocessor.toc]
command = "mdbook-toc"
renderer = ["html"]

Finally, build your book as normal:

bash
mdbook path/to/book

Configuration

Custom TOC marker

The default marker is:

markdown

If you wish to use a different marker, such as the GitLab marker [[_TOC_]], you must add the following settings to your book.toml.

toml
[preprocessor.toc]
marker = "[[_TOC_]]"

You can also use multi-line markers such as the GitHub marker, which is:

markdown
* auto-gen TOC;
{:toc}

Configure the string with a newline:

toml
[preprocessor.toc]
marker = "* auto-gen TOC;\n{:toc}"

or with multi-line strings:

toml
[preprocessor.toc]
marker = """* auto-gen TOC;
{:toc}"""

Maximum header level

By default the ToC will include headings up to level 4 (####). This can be configured in your book.toml as follows:

toml
[preprocessor.toc]
max-level = 4

License

MPL. See LICENSE.
Copyright (c) 2018-2020 Jan-Erik Rediger

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言