# 我创建了一个书签脚本，用于生成论坛帖子目录

**URL:** <https://meta.discourse.org/t/i-created-a-bookmarklet-to-create-the-table-of-content-for-forum-posts/270961>\
**Category:** Development\
**Created:** [2023年七月8日 02:33 UTC](https://meta.discourse.org/t/i-created-a-bookmarklet-to-create-the-table-of-content-for-forum-posts/270961 "2023-07-08T02:33:56Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)\
**Post date:** [2023年七月10日 02:07 UTC](https://meta.discourse.org/t/i-created-a-bookmarklet-to-create-the-table-of-content-for-forum-posts/270961/13 "2023-07-10T02:07:43Z")

</div>

不幸的是，当标题超过几个词时，该插件完全无法使用，因为它会把事情搞得一团糟。如果标题是一两行长（例如 FAQ 页面），那么 Disco TOC 插件就会把页面搞得一团糟，这就是为什么我提出了这个关于内联 TOC（这个插件提供的）的请求，它非常适合这类页面

> [@Automatic TOC inline/top of post](https://meta.discourse.org/t/automatic-toc-inline-top-of-post/264641/):
>
> Is it possible to have the TOC within the post itself at the very top (kind of like what Word does with generating an automatic TOC). The issue is that it’s making the side look very cluttered because the heading are actually long sentences in our case and that’s making the whole page unreadable. Having it embedded within the topic itself at the very top would solve this issue and still allow us easy updates to the Wiki while having the plugin automatically update the TOC and not clutter the si…

鉴于构建 Discourse 的团队中拥有如此多的天才/才华，将此功能作为 DiscoTOC 的替代方案应该不难，这样可以大大扩展其使用范围。

---

_[View the full topic](https://meta.discourse.org/t/i-created-a-bookmarklet-to-create-the-table-of-content-for-forum-posts/270961)._
