DiscoTOC - automatic table of contents

2.6.0.beta4

( 1946fa3c53 )

After the update, “DiscoTOC” sidebar lost its sticky feature. scrolls up with the page and disappears.

1 Like

I’ve also been thinking about this problem – many reference posts, by a single author, about the same topic, which if put together blow out the single-post character limit. When visiting the topic, you want to jump to a particular reply.

The details of your problem is slightly different from the above - you want to mark important events in the game, such as “Start Day 3 Voting”. Correct?

I think we need custom storage to really solve this problem, which means a plugin and not just a theme component.

1 Like

Can confirm, thanks for the report!

1 Like

Thanks for the quick update. DiscoTOC is working properly now but now there is a problem like the picture.

1 Like

Is that red box supposed to be filled with body text, or is the avatar out of place?

This is likely an issue with the theme you are using.

Noticed the issue, I have an example a little bit more clear : DiscourseConnect - Official Single-Sign-On for Discourse (sso)

The table of contents break the topic body with and there’s a line break between avatar and username/rank

I assume it is related to the new grid display on topics, we have less width available for the table of contents : https://github.com/discourse/discourse/commit/da5841de0b2b60ceaa2f2602d7231e7393a74e66

2 Likes

Continuing the discussion from Discourse New User Guide:

I couldn’t care but notice that on this post your profile picture seems to strangely be all over the place, any ideas why this could happen as I’ve also seen it happen on private communities that I was a part of.

2 Likes

I’ve made a minor update that fixes this — looks like the issue was that longer TOC items would cause the sidebar to be too wide.

https://github.com/discourse/DiscoTOC/commit/fb392bd5363e4fc3e63baf5b5e84dbe025c07065

4 Likes

Seems fixed, thanks for the quick fix!

4 Likes

Maybe I am misremembering, but I thought that this component used to move with the content after selecting a primary header it would expand to show the secondary headers but would also navigate to the content for the primary header you just clicked.

Now I am noticing if I click a primary header, it takes me to that content, but I lose the rest of the ToC and have to scroll back up to see the secondary headers. Here’s a quick screen recording. Am I going crazy or is this new behavior? :thinking:

3 Likes

Hey Heather,

That’s a known issue (since fixed) related to some changes with made to core Discourse. Let me kick off a deploy of your site to get the fix out.

@Heather_Phillips, deploy complete, this should be working now. Please let us know if not.

4 Likes

Thanks @jomaxro. It’s working now!

3 Likes

I am wondering how the TOC plugin is intended to function as I am finding its behaviour sort of odd. I have attached an animated gif below showing my observed behaviour. Is this intentional?

My personal thought/preference is that the TOC is just fully expanded from the start.

Thanks in advance!

1 Like

I am bumping this in hopes that someone will comment on the above functionality.

Is this functionality as intended? Am I doing something wrong? Is there a possibility to get the option to set the TOC to be fully expanded and static?

Thanks in advance!

1 Like

Is there a plan, that the TOC is also visible for published pages? Page publishing was a feature introduced in discourse 2.5? This would be a huge benefit of this theme component!

6 Likes

I checked it with non-Latin symbols like Cyrillic and it’s not working. When I copy the url of the subheader and try to follow the link - the TOC is not working (the page opens, but doesn’t move to the subheader). How can it be solved?

1 Like

Another question. I added extra div to the post. Now it looks like this:

<div data-theme-toc="true"> </div>
<div data-theme-profile="manual">
## Chapter 1
## Chapter 2
</div>

But the TOC is not visible in this case. How can it be fixed?

1 Like

In 2.7.0.beta6: Automatic Group Avatar Flair, Improved User Education Content, Bookmark Pinning, and more - feature / announcements - Discourse Meta Discourse added automatic generation of header links. How does that work with disco-toc generated headers? Can disco-toc use the discourse-generated links?

What about posts which have same header multiple times? (this bug already exists, and i reported it before here)

eg

Head1

Example

Head2

Example

This second ##### Example has the same url as the first example, from what i can see.

2 Likes

Hmm, @nbianca, any thoughts?

Hi, I noticed an odd interaction with DiscoTOC and Slack integration. Basically the header links don’t properly post.

See details here

2 Likes