I am using DiscoTOC for a long time, and it works fine with Chinese headings until recent update.
If there are multiple Chinese headings (including no ascii characters) in the post, it will only navigate to the first heading of one level when the navigation item on the right side is clicked. I believe this is because the DiscoTOC generates navigation items with the same id (because the headings are all in Chinese). So, the query selector will only find the first heading.
As a try, I forked the GitHub repo and pushed a little commit as
It seems to work in my site. If it looks good to you team, I can raise a pull request, or this bug need to be fixed in another way.
First off, this is a super helpful theme component for long posts!
However, thereās an issue with this theme component on mobile devices (at least on iOS). When I open a large table of contents, scrolling through the TOC doesnāt work on mobile like it does on a desktop.
The list contains Headings A-H, but I canāt scroll through it
The list appears to be scrollable, but a touchstart event prevents the list from being scrolled. Disabling the touch start event listener for the d-toc element seems to solve the issue.
I canāt see the version of the theme component we have on our forum, nor can I test this on a local install (since I canāt load it on a phone). So, if there is a fix Iām not aware of or if thereās anything I should, please let me know.
@pmusaraj I guess itās possible that I havenāt set this correctly but I have installed the theme and the TOC I set up on a topic is not appearing on the discourse-docs version but it is appearing in the main topic
The next time you update DiscoTOC youāll probably notice that weāve added a button to toggle between the topic timeline and the table of contentsā¦ let us know if you encounter any issues or have feedback about this new feature!
Iāve just made a minor update to this theme that ignores the trust level requirement for staff accounts, this more closely follows how Discourseās settings behave.
this component works nicely for the first post, thanks for this nice oneā¦
wonder if possible to do the autoTOC for the posts below as wellā¦ that seems a common case when try to document something using one post and comments belowā¦
say, when browsing to the main post or replies below, if the post/reply has titles/subtitles defined, it auto shows its TOC, otherwise shows the default timeline thingā¦
I did not read this long thread, did a quick search, seems not discussedā¦
somehow, I donāt see the button to switch between content and TOC
the same using the official disco-toc or @Moin 's forked versionā¦
is there a setting for this? seems notā¦ hmmā¦
my system is on discourse 3.2.1
Yes, major versions have a much slower release schedule, so you may be waiting months for new features and security updates otherwise ā by default we recommend staying up to date with our beta releases. Some more info here: Why does Discourse always install "beta" versions by default?