-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed as not planned
Labels
extensions:extlinkstype:enhancementenhance or introduce a new featureenhance or introduce a new feature
Milestone
Description
It would be nice if instead of a formatting string, you could pass a callable that returns the combined URL for extlinks. This would allow cases where the input part
isn't quite part of the url.
For example, this Docker reference uses lowercase anchors, but uppercase section titles: https://docs.docker.com/reference/builder/
Here's my current extlinks config:
'Dockerfile': (
'https://docs.docker.com/reference/builder/#%s',
''
)
To handle the difference in captalization, I need to link as follows:
:Dockerfile:`RUN <run>`
It would be preferable to define the extlink using a callable handling the case conversion:
'Dockerfile': (
lambda part: 'https://docs.docker.com/reference/builder/#%s' % part.lower(),
''
)
I suspect this is one of many possible use cases that would benefit. And since you could test for a callable vs a string, it should be fully backwards compatible.
- Bitbucket: https://bitbucket.org/birkenfeld/sphinx/issue/1622
- Originally reported by: Kevin Stone
- Originally created at: 2014-11-09T18:38:07.878
Metadata
Metadata
Assignees
Labels
extensions:extlinkstype:enhancementenhance or introduce a new featureenhance or introduce a new feature