Giter Club home page Giter Club logo

Comments (7)

tscanlin avatar tscanlin commented on September 25, 2024

Yeah that should be possible by setting the heading selector to target those elements. Although I don't know how nesting will work then because those tags won't have a level like the headings have.. so this may not be really easy to do.
headingSelector: 'dt.sig',

from tocbot.

kapooramit avatar kapooramit commented on September 25, 2024

Thanks @tscanlin . This will work for me. I will need to update the page DOM to fix the hierarchy but it will work. Thanks a ton!

from tocbot.

kapooramit avatar kapooramit commented on September 25, 2024

@tscanlin : It worked just fine. The only issue would be what you said - hierarchy. I am unable to find anything on web that allows me to find the last heading level before this class type (dt.sig) so that I can add appropriate heading level...

from tocbot.

kapooramit avatar kapooramit commented on September 25, 2024

@tscanlin : The heading I added before calling tocbot shows up fine in tocbot but the headings that active are not highlighted as they do otherwise on scrolling. The highlight is stuck on first element (if I use heading) or last element (if I use default span). Clicks are working but the link in tobot stays normal. Is there something I need to do?

Also, this option doesn't make a difference if the heading is hidden with display:none. The heading doen't show in the tocbot output when it should because the following is set to false.
ignoreHiddenElements: false,

from tocbot.

kapooramit avatar kapooramit commented on September 25, 2024

I am using JavaScript to add id and class to each (.py.method > .sig.sig-object > .sig-name.descname > .pre) and then I call tocbot. The links work but the highlighting is not working.

I have shared the link to the live page in email to you with subject "Sphinx tocbot issue"

I am not sure why tabindex=-1 getting added to target spans but even if remove them, the issue exists.

Please help!

from tocbot.

kapooramit avatar kapooramit commented on September 25, 2024

Ok. Just going to doctor sometimes solves the issues without medication 😊. And that is what happened today.

I changed the logic to add a heading instead of updating the existing span but it didn’t work. Then, I added the heading before the first selector /span where it is actually a proper heading and it worked! Is it that the heading must be at its own level and not under something else?

I had to set its visibility to hidden and height and width to 0px so that it is not shown and doesn’t take any space.

New working HTML:

<h3 id="get_child_objects" class="apifunction">get_child_objects</h3>
<dl class="py method">
<dt class="sig sig-object py" id="get_child_objects">
<span class="sig-name descname">
<span class="pre">get_child_objects</span>
....
</dt>

Thank you!

from tocbot.

tscanlin avatar tscanlin commented on September 25, 2024

Yeah, heading have to be at their own level and can’t be nested, that is correct. Glad you were able to make progress on this!

from tocbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.