Since Disco TOC is one of the theme components in the default list, I’m assuming this is an appropriate place to make a feature request.
It currently only works for the OP. I’d like to be able to add a TOC to a reply. Why?
When we do a webinar, we’ll announce it to the community with a post. After the webinar, we follow up with a reply in the same topic that contains the link to the recording and answers to all the questions that were asked during the webinar. We do this partly as a way to cover all the questions we couldn’t get to during the live session.
Those followup posts tend to get long and are typically sub-categorized by broad topic - perfect for a TOC (& actually the reason I installed the component).
Previously I’ve manually (and painfully) created a static TOC at the top of the reply post, but of course, once you’ve scrolled past it to the content, it’s no longer useful. Having the Disco TOC float alongside the content would be wonderful!
Interesting use case! I’ve done this in the past before too. Not sure if this will work in your case, but what we ended up doing is editing the first post to add the notes at the bottom, then replying to let everyone know about the edit. That way everything is neatly organized in the first post for posterity.
Yes, I totally get that. But it can be useful for the long term, and Discourse provides the edit history for those who want full transparency. Here’s an example of a topic that we rewrote after a webinar, back when I was working for Namati. We even changed the language to be past tense, so a summary of the webinar and no longer an announcement. And removed all the logistical details on how to join and so on, because no longer relevant.
Update: The changes in this fork have been merged upstream, please use the official theme components instead
For anyone who wants to apply DiscoTOC in their replies, I did this part of the work in my own fork!
Now it can apply TOC to any post and it works fine, just like it does on the OP.
It seems that the official team doesn’t think it’s necessary to apply DiscoTOC in the replies, so I won’t open a pull request. But you can use my modified version!
Lhcfl/DiscoTOC-edited throws the error «Uncaught TypeError: ((intermediate value) || this[e]) is not a function» on inserting a table of contents.
Discourse 3.2.0.beta4-dev.
Would you be open to revisiting this? It would be great to have it as part of the officially maintained repo. And it wouldn’t / shouldn’t add any issues or instability.
My use-case is meetings, where we use an Event as the OP, and the minutes go in a new post somewhere below it. It would be great to have TOC available to be applied to minutes.
I would not want it to apply to all posts - that would get unpleasantly busy very fast!!!
For those who care about applying TOC to replies - The ability to apply TOC to replies has been merged into the official component. It is a setting that is off by default.
After using the new functionality a bit (bravo by the way!), I was wrong about this - as you can specify how many headings before a TOC is activated, it simply isn’t a problem.
However, inserting the TOC code is quite a pain.
Would you be open to changing this so that with auto specified categories and tags reply TOCs are also turned on? Or making that an option?