-
Notifications
You must be signed in to change notification settings - Fork 21
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
Change interlinks specification. #315
Comments
Thanks for taking the time to write this up, and make explicit comparisons across the 2 existing syntaxes and the proposed one. The link syntax I most often think about is It seems like there are two important reasons to differentiate the target:
It seems like backticks are nice for signaling an interlink, since they are often used to mark code related stuff. (See mkdocstrings cross ref docs for another example, where filters aren't used) . I'm partial to keeping backticks, but open to changes. @wch and @schloerke any thoughts on interlink syntax? |
The backticks are okay if you think of them that way (this is code to be processed). But that does not cover all the cases. We have these too:
which are RST roles. So we have inherited a syntax in an environment were some of its features are not required. The backticks no-longer mark all the code that will be processed and we are left with quirky thing with colons and backticks. We can move the "sometimes" middle backtick to the beginning. This rescues the consistency of "this is a code to be processed".
Also, noting that most interlinks do not change the link text, most of the time we would endup with.
And when the
The full syntax that uses links would remain valid. That means all these would link to the same location
|
In my mind, the colons are a filtering syntax, which hopefully is not too commonly used (except in some standard library ambiguity cases). If I understand, it sounds like the appeal to using all colons is consistency (since every part of the interlink would use the same separator |
Yes. Though now the second option of having the backticks around everything looks better because if there is a reference type ( The revised comparison becomes.
Also note that, we can do interlinking with only |
It'd be super nice if you only had to use brackets and parens when you need to change the link name, so it'd be awesome to have a short form for |
@gadenbuie agreed -- I think the trickiest thing here is figuring out something that is unambiguously an interlink in the pandoc AST. For example, I think my original hope was that :py:
I could see how @has2k1's proposed above shortform
Which would be pretty easy to identify from a filter. Would be nice if there were some easier way to add classes, etc.. to inline code elements. AFAIK a way to get classes on inline code elements is to do things like
|
Yes. That can work. I have included it. Then for consistency, should |
The current way interlinks are specified is adapted directly from the Intersphinx extension. This format uses reStructuredText Interpreted Text Role where, the colons and the backticks matter because the combination triggers the processing.
quartodoc implements interlinks using pandoc filters and the processing is triggered on markdown links where what matters is:
So we do not need the combination of colons and backticks. We can do with only colons. Here is a comparison
[](`target`)
[](:target:)
:reftype:`target`
[](:reftype:`target`)
[](:reftype:target:)
:domain:reftype:`target`
[](:domain:reftype:`target`)
[](:domain:reftype:target:)
:external:domain:reftype:`target`
[](:external:domain:reftype:`target`)
[](:external:domain:reftype:target:)
:external+invname:domain:reftype:`target`
[](:external+invname:domain:reftype:`target`)
[](:external+invname:domain:reftype:target:)
:domain:reftype:`text<target>`
[text](:domain:reftype:`target`)
[text](:domain:reftype:target:)
Given the differences in processing Intersphinx format cannot (usually) represent only a target (case 1). And the translation rule to copy the Intersphinx stuff into the braces of a markdown link does not apply to all cases. We have a more natural solution for case 6.
While at best this saves us a single character, backticks are also a markdown syntax element and the proposed change invites less visual scrutiny and looks better without them.
This change can be implemented without affecting the current users. The current style may be dropped silently at first then deprecated with a warning.
The text was updated successfully, but these errors were encountered: