Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor support in toctree #2954

Open
xoorath opened this issue Sep 13, 2016 · 4 comments
Open

Anchor support in toctree #2954

xoorath opened this issue Sep 13, 2016 · 4 comments

Comments

@xoorath
Copy link

xoorath commented Sep 13, 2016

Hey,

I'd like to request the ability to include same-page anchors in toctree.

A syntax similar to:

TOC
:::::::::::::::::::::
.. toctree::

    #constructors
    #set_get_methods
    #operators

Use case:
I'm using breathe to generate my c++ documentation from doxygen and having the ability to include some or all of the permalinks on my page in the table of contents would be desireable. Here's the real world use case for me: (an arbitrary anchor for reference) http://xo-math.readthedocs.io/en/latest/classes/vector4.html#special_operators

In this example doc you'll see I hacked in support for this myself. Having proper support so my TOC shows up in the side bar would be incredible.

Thanks,
Jared

@shibukawa
Copy link
Contributor

How about this http://docutils.sourceforge.net/docs/ref/rst/directives.html#table-of-contents

@tk0miya tk0miya added the markup label Sep 14, 2016
@xoorath
Copy link
Author

xoorath commented Sep 21, 2016

I'm not sure what you're trying to suggest I look at in there, @shibukawa. I don't see anything related to anchors or internal links in that document. Maybe I'm missing it, or not describing the suggestion very well?

@nwf
Copy link

nwf commented Jun 11, 2017

This looks like a subset of #701. The proposed fixes in #2354 or #1800 would, I think, enable this functionality, but they are stalled.

@red8888
Copy link

red8888 commented Feb 2, 2022

Has this been solved yet? I literally have this identical problem with breathe: https://stackoverflow.com/questions/70958524/can-sphinx-auto-generate-a-table-of-contents-from-all-anchors-on-a-page

Admittedly its more an issue with breadth itself. Its only able to dump a massive single page of all its documentation and has no built in way of generating a toc- it seriously limits its usefulness. BUT it at least has an anchor for every class/interface/etc on that page. So if there is some way of telling sphinx to create a toc where every item is an anchor on the page that would be a nice way of working around the limitations of breathe.

If there isn't a built in way to do this is there some plugin that adds this ability? I've used plugins that add some cool referencing features that you don't get ootb like sphinx.ext.autosectionlabe for example.

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

No branches or pull requests

6 participants