Skip to content

Allow explicit markup in toctree directives#2354

Closed
nwf wants to merge 1 commit into
sphinx-doc:masterfrom
nwf:master
Closed

Allow explicit markup in toctree directives#2354
nwf wants to merge 1 commit into
sphinx-doc:masterfrom
nwf:master

Conversation

@nwf

@nwf nwf commented Feb 25, 2016

Copy link
Copy Markdown

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

tk0miya commented Mar 3, 2016

Copy link
Copy Markdown
Member

MEMO: Similar to #1800.

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

nwf commented Mar 3, 2016

Copy link
Copy Markdown
Author

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

@Blendify

Blendify commented Sep 6, 2016

Copy link
Copy Markdown
Contributor

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

nwf commented Apr 17, 2017

Copy link
Copy Markdown
Author

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
Copy Markdown

Kill=for/bar/baz

@nwf

nwf commented Jan 21, 2018

Copy link
Copy Markdown
Author

@MARIOBlueOrigin what?

@MARIOBlueOrigin

Copy link
Copy Markdown

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
Copy Markdown

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

@tk0miya

tk0miya commented Jul 2, 2020

Copy link
Copy Markdown
Member

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

nwf commented Jul 2, 2020

Copy link
Copy Markdown
Author

@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

tk0miya commented Jul 4, 2020

Copy link
Copy Markdown
Member

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

nwf commented Jul 4, 2020

Copy link
Copy Markdown
Author

@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

nwf commented Jul 15, 2020

Copy link
Copy Markdown
Author

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

@nwf nwf closed this Jul 15, 2020
@whitequark

Copy link
Copy Markdown

@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

nwf commented Jul 15, 2020

Copy link
Copy Markdown
Author

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