Skip to content
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

Make repo_auto_link() part of downlit? #94

Closed
maelle opened this issue May 4, 2021 · 2 comments
Closed

Make repo_auto_link() part of downlit? #94

maelle opened this issue May 4, 2021 · 2 comments

Comments

@maelle
Copy link
Contributor

maelle commented May 4, 2021

pkgdown currently has code for linking issues and usernames. It uses a regular expression to identify issues and usernames.

https://github.com/r-lib/pkgdown/blob/c9e7dde4c5ca066f4a797ff201ead380f702473f/R/repo.R#L36

While not in scope for downlit in the sense of highlighting code, it does link things. 🙂

Pros if it were to be integrated to downlit:

  • It could use tweak_children and therefore use XPath in combination with regex to identify the text to link.
  • It could be used outside of pkgdown e.g. in release blog posts.
  • Maybe it could be extended to other GitHub-linking functionality à la lookup::lookup_browse().
@maelle
Copy link
Contributor Author

maelle commented May 6, 2021

Sort of related r-lib/pkgdown#1671

If repo_auto_link used tweak_children() I think it'd be easier to implement the feature requested in that issue and not confuse it with something in an URL.

@hadley
Copy link
Member

hadley commented Oct 29, 2021

Unfortunately this just feels out of scope for downlit to me; I think we want to keep it pretty tightly scoped to scope.

@hadley hadley closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants