obsidian-automatic-table-of-contents

johansatgeMIT更新放缓

Obsidian 插件,能在笔记里自动生成目录,笔记内容一变目录就跟着更新,省去手动维护标题列表的麻烦。

💠 An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes

1.8.0发布于 2026-02-07 18:21 UTC284star18fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
在 Obsidian 设置 → 第三方插件中搜索 Automatic Table of Contents 安装;或 cd /path/to/your/vault/.obsidian/plugins && git clone [email protected]:johansatge/obsidian-automatic-table-of-contents.git
硬件要求按 README 说明

README 未说明,作为 Obsidian 插件随 Obsidian 客户端运行,桌面端和移动端均可使用

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Obsidian 插件,在笔记里插入随标题变化自动更新的目录

Obsidian 插件,能在笔记里自动生成目录,笔记内容一变目录就跟着更新,省去手动维护标题列表的麻烦。

核心能力

  • 用 table-of-contents 或 toc 代码块插入自动目录
  • 支持嵌套列表、有序列表和首层内联三种样式
  • 用 include/exclude 正则筛选要收录的标题
  • 可设置 minLevel/maxLevel 限制标题层级范围
  • 插件设置里配置全局默认值,可被单个代码块覆盖

容易踩的坑

目录基于代码块渲染而非真实 Markdown,导出、Obsidian Publish 和 PDF 中可能看不到或链接失效;标题层级不连续(如一级直接跳到三级)时目录可能生成不正确;includeLinks 为 true 时会剥离标题中的 HTML/Markdown,LaTeX 公式也无法正确渲染

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本1.8.0
  1. 1.8.0最新正式版2026-02-07 · 2026-02-07 18:21 UTC

    Introduce global settings (@stevedoyle) (fix #38, #83)

  2. 1.7.32025-05-25 · 2025-05-25 20:12 UTC
    查看更新说明

    Fix default include & exclude values (fix #73)

  3. 1.7.22025-05-03 · 2025-05-03 18:05 UTC
    查看更新说明

    Fix italic stripping (fix #43)

  4. 1.7.12025-05-02 · 2025-05-02 21:37 UTC
    查看更新说明

    Fix # in wikilinks (fix #64)

  5. 1.7.02025-04-27 · 2025-04-27 15:47 UTC
    查看更新说明

    Add include & exclude options (fix #46)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Obsidian Automatic Table Of Contents

    Downloads Version Test status codecov

    An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes


    demo

    Installation

    From Obsidian (easiest)

    Install the plugin from the Community plugins section in the app settings.

    From git

    Clone the plugin in your .obsidian/plugins directory:

    cd /path/to/your/vault/.obsidian/plugins
    git clone [email protected]:johansatge/obsidian-automatic-table-of-contents.git
    

    From source

    Download the latest release and unzip it in the .obsidian/plugins/automatic-table-of-contents directory.

    Usage and options

    Insert a codeblock with the table-of-contents (or its short version toc) syntax.

    ```table-of-contents
    option1: value1
    option2: value2
    ```
    

    Alternatively, two commands are available in the command palette:

    • Insert table of contents
    • Insert table of contents (with available options)

    Available options

    Most options can have a default value configured in the plugin settings (Settings → Community plugins → Automatic Table of Contents). These defaults will be used for all tables of contents in your vault, unless overridden in individual codeblocks.

    The following options are available:

    OptionDefault valueDescription
    titleNoneTitle to display before the table of contents (supports Markdown)
    stylenestedListTable of contents style (can be nestedList, nestedOrderedList or inlineFirstLevel)
    minLevel0Include headings from the specified level (0 for no limit)
    maxLevel0Include headings up to the specified level (0 for no limit)
    includeAllInclude headings with a regexp (example: /Some heading/i)
    excludeNoneExclude headings with a regexp (example: /Some heading/i)
    includeLinkstrueMake headings clickable
    hideWhenEmptyfalseHide TOC if no headings are found
    debugInConsolefalsePrint debug info in Obsidian console

    Limitations and known bugs

    • The table of contents may not be generated correctly if the document doesn't implement a correct titles hierarchy (level 1 title then level 3 without a level 2 in between, for instance)
    • HTML & markdown that may be in the document headings are stripped when includeLinks: true (see #24 & #27)
    • LaTeX equations are not rendered correctly when includeLinks: true (see #13)
    • Links might not behave correctly if the same title is present several times on the page (see #57)
    • Generated table of contents is not foldable (see #23)
    • The table of contents is based on a codeblock so it can be updated; it doesn't generate real Markdown in the document (see #10) so it won't be visible when exporting, or on Obsidian Publish (see #31) and links might not work in PDFs (see #12)

    Publish a new version

    • Build the plugin with npm run build (--watch during dev)
    • Push a commit with the new version number as message with:
      • The relevant changelog in README.md
      • The new version number in manifest.json
      • The updated main.js (with npm run build)
    • Tag the commit with the version number
    • Publish a new GitHub release with:
      • The version number as title
      • The changelog from README.md as description
      • main.js and manifest.json from as attachments
      • Set as the latest release checked

    Changelog

    This project uses semver.

    VersionDateNotes
    1.8.02026-02-07Introduce global settings (@stevedoyle) (fix #38, #83)
    1.7.32025-05-25Fix default include & exclude values (fix #73)
    1.7.22025-05-03Fix italic stripping (fix #43)
    1.7.12025-05-02Fix # in wikilinks (fix #64)
    1.7.02025-04-27Add include & exclude options (fix #46)
    1.6.12025-02-23Inline title when style:inlineFirstLevel (fix #59)
    1.6.02025-02-23Ignore empty headings (fix #60)
    1.5.12025-01-18Rename command for readability (fix #53)
    1.5.02024-11-24Add hideWhenEmpty option (fix #51)
    1.4.02024-05-19Add nestedOrderedList style (@bjtho08) (fix #41)
    1.3.32024-05-16Compute the right min level when style:inlineFirstLevel (fix #39)
    1.3.22024-02-18Harden headings stripping
    1.3.12024-02-18Strip headings for readability (fix #24, #27)
    1.3.02024-02-17Introduce title option (fix #5, #32)
    1.2.02024-01-19Introduce toc shorthand trigger (fix #19)
    1.1.02024-01-03Introduce minLevel option (@ras0q) (fix #11)
    1.0.62023-11-02Escape special characters (fix #3)
    1.0.52023-11-01Fix plugin activation on mobile (fix #17)
    1.0.42023-10-31Support pages with no first level headings (fix #6)
    1.0.32023-09-30Fix readme
    1.0.22023-09-25Fix output sometimes displaying undefined headings
    1.0.12023-09-09Fix reference to global App instance
    1.0.02023-08-27Initial version

    License

    This project is released under the MIT License.

    Contributing

    Bug reports and feature requests are welcome! More details in the contribution guidelines.