Fix #701 by allowing title <hyperlink>_ toctree entries#1800
Closed
dghubble wants to merge 1 commit into
Closed
Conversation
* Hyperlink entries without a title fall back to using the ref
title <hyperlink>_ toctree entriestitle <hyperlink>_ toctree entries
|
👍 This did exactly what I needed. (I'm using the contrib |
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a stab at allowing toctree entries to contain relative links (#701) by allowing hyperlinks.
Currently, toctree's allow explicit web links via a special syntax that looks like
but replacing the explicit web link with a relative one "../some/path" results in sphinx trying to find a document and failing. Essentially, plain relative links can't be added in a toctree.
One suggestion in #701 was a special syntax
<href:../some/path>. However, after looking over the code, it seems cleaner to support standard rst inline hyperlinks.Just like inline hyperlinks in text, If no title is explicitly given, the link text is used as the title (i.e. body of the anchor tag). Separately defined
.. _a link: http://example.com/target's aren't supported though.I'd mostly just like to see #701 addressed, whether it is this approach or something else the maintainers like.