MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

Using roles with CommonMark link formats

Open leamingrad opened this issue 1 year ago • 1 comments

Context

When writing documentation, I would like to be able to use roles when resolving references in CommonMark links.

At the moment, if MyST cannot resolve a link itself, it will pass through the link text as-is using a reftype of any to all missing-reference handlers.

MyST also supports using roles as an inline directive.

Proposal

I'd like it to be possible to combine the two, so that you could use Sphinx roles when declaring the target of a link.

For example, I'd like to be able to write something like:

My [Class]({py:class}`path.to.python.Class) is linked

Or use labels:

My [Class][label] is linked

[label]: {py:class}`path.to.python.Class`

Does this sound like a sensible idea?

Tasks and updates

No response

leamingrad avatar Jan 24 '23 12:01 leamingrad

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jan 24 '23 12:01 welcome[bot]