I encountered a similar problem with https://github.com/gfranko/jquery.tocify.js/issues/36. More specifically, I am adding TOCs to a bunch of jupyter notebooks whose headers are inside cells and have a structure like
cell -> h2
cell -> h3
cell -> h3
cell -> h2
tocify.js could not get the h3s because they are not children of h2. I checked the source code and find that this restriction is not really necessary so I modified the code to display all headers regardless if they are siblings or children.
The patch works but perhaps not using the best algorithm, but I would first like to know if there is any real reason for the restriction and if you are interested in merging the PR.
I encountered a similar problem with https://github.com/gfranko/jquery.tocify.js/issues/36. More specifically, I am adding TOCs to a bunch of jupyter notebooks whose headers are inside cells and have a structure like
tocify.js could not get the
h3
s because they are not children ofh2
. I checked the source code and find that this restriction is not really necessary so I modified the code to display all headers regardless if they are siblings or children.The patch works but perhaps not using the best algorithm, but I would first like to know if there is any real reason for the restriction and if you are interested in merging the PR.