question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure external link recognition (and handling)

See original GitHub issue

Currently, if a link ([text](link)) does not match a URL scheme (e.g. ‘http://…’) then it is treated as an internal cross-reference (to a reference target or sphinx document, etc): https://github.com/executablebooks/MyST-Parser/blob/3d5ae4f94c9d39435d76861b86dc5171ee23c9df/myst_parser/docutils_renderer.py#L412-L415

In some use cases a configuration option could be useful, such that links with certain extensions (or regexes) are converted to external links, rather than attempting to resolve them as internal links

_Originally posted by @chrisjsewell in https://github.com/executablebooks/jupyter-book/issues/823#issuecomment-668135898_

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjsewellcommented, Jan 10, 2022

Yep, and that will change in myst-parser 0.17

1reaction
chrisjsewellcommented, Dec 28, 2021

For Myst to be a replacement for recommonmark, this functionality is pretty critical though.

Well myst has already replaced recommonmark 😉: https://github.com/readthedocs/recommonmark/issues/221

its not out of the question, but I feel this is more of a “power-user” feature, that could be easily replicated with an external transform: e.g. simply add to you conf.py

# available in the next release
myst_all_links_external = True
# or
myst_url_schemes = ("http", "https", "mailto", "ftp", "issue")

from docutils import nodes
from sphinx.transforms import SphinxTransform

class MyTransform(SphinxTransform):
    default_priority = 1
    def apply(self, **kwargs) -> None:
        for node in self.document.traverse(nodes.reference):
            if "refuri" in node and node["refuri"].startswith("issue:"):
                node["refuri"] = "whatever you want"
                node["classes"].append("my-class")

def setup(app):
    app.add_transform(MyTransform)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Links - Usability & Web Accessibility - Yale University
Speech recognition software allows a user to avoid using a mouse. Users can speak the text of the link that they would like...
Read more >
Hyperlink Usability: Guidelines For Usable Links
Hyperlink design is a mixture of traditional usability guidelines and emerging trends that affect readability, clickability and contextual understanding.
Read more >
Link management: What it is and why your company needs it
Link management is about the ability to organize, edit, analyze and have complete control over all the links your organization shares – no ......
Read more >
Add a link - NYU Arts & Science
To setup an external link · Highlight the text you want to be the link · Click on Hyperlink icon(Chain) on the Edit...
Read more >
How to Place External Link Icons in WordPress - GreenGeeks
Step 1: Install External Links. The External Links plugin is one of the best plugins for managing external and internal WordPress links.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found