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

Support auto-linking #... issue references to pantsbuild/pants #203

Open
huonw opened this issue May 14, 2024 · 2 comments
Open

Support auto-linking #... issue references to pantsbuild/pants #203

huonw opened this issue May 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@huonw
Copy link
Contributor

huonw commented May 14, 2024

In pantsbuild/pants#20492 (comment), we noticed that it's convenient to write #... issue references in docs, and some places (particularly GitHub renderers) will auto-link them.

If we could do the same in our published website that might be nice, e.g. replace matches of /#([0-9]{3,})/ with [#\1](https://github.com/pantsbuild/pants/issues/\1) (or some equivalent). Notes:

  • Preferably we'd do this in a Markdown aware-way, only in body text, and not within code blocks, existing links etc.
  • The {3,} is to require at least #123, to reduce spurious references like a reference to a list item ("#1 is a good option").

From a quick skim of the docusaurus docs and plugins, there doesn't appear to be existing support for this, but I might've missed it.

@thejcannon
Copy link
Member

This should be doable in a remark plugin

@huonw
Copy link
Contributor Author

huonw commented May 15, 2024

Ah, nice! Looks like https://github.com/remarkjs/remark-github exists already and https://docusaurus.io/docs/markdown-features/plugins seems to describe how to install it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants