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

create table of contents entries for functions, classes, and methods #6435

Closed
Phillip-M-Feldman opened this issue Jun 3, 2019 · 8 comments
Closed
Labels

Comments

@Phillip-M-Feldman
Copy link

I'd like to implement an option in Sphinx to create table-of-contents entries for all functions, classes, and methods, with method entries nested under the appropriate classes. I've been trying to figure out where I would make this change. When I look at https://github.com/sphinx-doc/sphinx/blob/master/sphinx/environment/adapters/toctree.py, it does seem to be manipulating the ToC tree, but I haven’t been able to identify any place where things are being inserted into the tree. Perhaps it is there and I’m just missing it. Any help will be appreciated.

@Phillip-M-Feldman Phillip-M-Feldman added the type:enhancement enhance or introduce a new feature label Jun 3, 2019
@lagru
Copy link

lagru commented Jun 7, 2019

I'm also interested in extending a custom directive with this functionality.

I found this interesting function and this snippet in the autosummary extension which seem related. But this seems to expect actual files as targets not the nodes corresponding to object descriptions.

@tk0miya
Copy link
Member

tk0miya commented Jun 8, 2019

Is this feature request? What is different with #6316?

@lagru
Copy link

lagru commented Jun 8, 2019

@tk0miya Not necessarily. But I'd be happy about a few pointers to the steps that would be necessary. If I manage to do this and there is a general interest, I'd be happy to help with a PR for a similar feature.

I'm not sure how sphinx (or is it docutils) goes about constructing the TOC tree and how I would apply that knowledge to a custom directive. That directive works similar to ObjectDescription but will generate its own content for the content node. It is used to document commands of a console interface. However it would be nice if the signature of this documented object would then be visible in the TOC and displayable in the sidebar.

I wasn't even aware of that other issue.

@tk0miya
Copy link
Member

tk0miya commented Jun 8, 2019

I'd like to know the goal of this issue. This is issues list of Sphinx, not forum. So all issues should have the goal. If you'd like to discuss or talk about developing, please move to sphinx-devel list. If not, please let me know the goal of the issue.
https://groups.google.com/forum/#!forum/sphinx-dev

@Phillip-M-Feldman
Copy link
Author

I believe that this is essentially the same as issue #6316. But, I never got a response to my request for advice as to how I can go about making that change, e.g., what modules and methods would have to be changed. I'm a bit surprised because I had expected the Sphinx team to jump on an offer for help.

@tk0miya
Copy link
Member

tk0miya commented Jun 9, 2019

Sorry for not response you on #6316. TBH, I don't know how to enhance TOC. So I could not answer to your question. I need to investigate our code to implement it...

@pawamoy
Copy link

pawamoy commented Dec 9, 2019

So I guess this issue can be closed as duplicate of #6316?

@jfbu
Copy link
Contributor

jfbu commented Dec 9, 2019

I am closing this as duplicate of #6316, feel free to re-open if you feel it is not duplicate.

@jfbu jfbu closed this as completed Dec 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants