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

Allow explicit markup in toctree directives #2354

Closed
wants to merge 1 commit into from
Closed

Conversation

nwf
Copy link

@nwf nwf commented Feb 25, 2016

This adds support for :ref:`` text in toctree listings in particular, but is
reasonably generic. My website, for example, now contains something like

.. toctree::
   _ :ref:`foo <bar>`
   baz

which renders as one might expect.

@tk0miya
Copy link
Member

tk0miya commented Mar 3, 2016

MEMO: Similar to #1800.

@tk0miya tk0miya added this to the 1.5 milestone Mar 3, 2016
@nwf
Copy link
Author

nwf commented Mar 3, 2016

Man, somehow I completely missed that in my search for this. D'oh! Either way. :)

@Blendify
Copy link
Contributor

Blendify commented Sep 6, 2016

Big +1 for this

This adds support for :ref:`` text in toctree listings in particular, but is
reasonably generic.  My website, for example, now contains something like

.. toctree::
   _ :ref:`foo <bar>`
   baz

which renders as one might expect.
@nwf
Copy link
Author

nwf commented Apr 17, 2017

Just pushed a new commit that's caught up to HEAD.

@tk0miya tk0miya modified the milestones: 1.7, 1.6 Apr 23, 2017
@tk0miya tk0miya modified the milestones: 1.7, 1.8 Jan 5, 2018
@MARIOBlueOrigin
Copy link

Kill=for/bar/baz

@nwf
Copy link
Author

nwf commented Jan 21, 2018

@MARIOBlueOrigin what?

@MARIOBlueOrigin
Copy link

Kill=foo/bar/baz;
Kill=foo/bar;

@tk0miya tk0miya modified the milestones: 1.8.0, 2.0 Aug 5, 2018
@tk0miya tk0miya modified the milestones: 2.0.0, 2.1.0 Feb 3, 2019
@tk0miya tk0miya modified the milestones: 2.1.0, 3.0.0 May 26, 2019
@tk0miya tk0miya modified the milestones: 3.0.0, 4.0.0 Mar 14, 2020
@whitequark
Copy link

@tk0miya Is there any reason this PR cannot be merged?

@tk0miya
Copy link
Member

tk0miya commented Jul 2, 2020

I don't have an answer how such reference should be represented in non-HTML formats. In addition, I don't think cross-references are not a part of ToC. So it's strange to define it in toctree directive.

@nwf
Copy link
Author

nwf commented Jul 2, 2020

@tk0miya As per #701 (comment), I believe we understand what LaTeX should do when it encounters these TOC entries: it should render the node as an argument to \addtocontents. If that's really all that's holding this up, then I can try to find time to patch the LaTeX builder.

@tk0miya
Copy link
Member

tk0miya commented Jul 4, 2020

I think LaTeX is only one example. How about manpage? How about singlehtml? We have many builders (including 3rd party builders) that don't represent ToC trees as link collections.

@nwf
Copy link
Author

nwf commented Jul 4, 2020

@tk0miya How about #7913? @whitequark Would something like that work for your needs?

nwf added a commit to nwf/sphinx that referenced this pull request Jul 9, 2020
Rather than the approach taken by sphinx-doc#2354,
which would require answering some tricky questions about the entire set
of Builders in the known universe, just expose just enough through hooks or
overridable routines so that individual instances of Sphinx can splice
in their own implementation of this functionality if it is desired.
nwf added a commit to nwf/sphinx that referenced this pull request Jul 11, 2020
Rather than the approach taken by sphinx-doc#2354,
which would require answering some tricky questions about the entire set
of Builders in the known universe, just expose just enough through hooks or
overridable routines so that individual instances of Sphinx can splice
in their own implementation of this functionality if it is desired.
@nwf
Copy link
Author

nwf commented Jul 15, 2020

It's apparent that this approach can no longer be considered viable.

@nwf nwf closed this Jul 15, 2020
@whitequark
Copy link

@whitequark Would something like that work for your needs?

That looks nice! I see the PR is closed, do you still want to pursue the approach?

@nwf
Copy link
Author

nwf commented Jul 15, 2020

I don't believe I have the bandwidth to properly modify something as deeply integrated to sphinx as its toctrees. So I hacked around it; see #701 (comment) . I probably should have posted that first before closing the PRs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants