Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Feature request: consider supporting a 3rd level of sections #106

Open
atn832 opened this issue Jan 11, 2021 · 3 comments
Open

Feature request: consider supporting a 3rd level of sections #106

atn832 opened this issue Jan 11, 2021 · 3 comments

Comments

@atn832
Copy link

atn832 commented Jan 11, 2021

So that one could see h1's, h2's and h3's in their page. Or it could be made generic to support any depth of nested headings.

@jimmynotjim
Copy link
Owner

Hey there, sorry for the delay. Due to work and personal schedules, I haven't been able to work on scrollnav in a long time and stopped working on new features entirely. If you'd like to make the necessary changes and send a PR I'd be happy to look them over. Thank you for understanding.

@makrohard
Copy link

I think it's better to talk about 'implementing infinite level depth' instead of 'implementng a 3rd layer'. That leads to the question of the interface.

Currently, the 1st level is specified in 'sections' and the second level in 'subSections'.
I assume that the interface has to be kept stable, in order not to break existing installations when updating.

My proposal on that would be, that 'sections' will take an argument that consists of one or more space-separated html-tags. E.g: 'h1 h2 h3 h4 h5' or 'article section'.

Behaviour:

  • If none is present it default to h2 (current behaviour)
  • If exactly one is present, use it as first level, check subSections for second level
  • If more than one is present, use them in the given order as levels. Ignore subSection.

Any better ideas?

@jimmynotjim
Copy link
Owner

@makrohard that could make sense, but I'd prefer it to be in an array form so the plugin doesn't need to do much format checking. I'm open to a PR demonstrating this idea if you have the time to try it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants