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

Magiclink support for repo paths paths #2446

Open
samvanstroud opened this issue Aug 31, 2024 · 1 comment
Open

Magiclink support for repo paths paths #2446

samvanstroud opened this issue Aug 31, 2024 · 1 comment
Labels
S: triage Issue needs triage. T: feature Feature.

Comments

@samvanstroud
Copy link

Description

If the user mentions a file which exists in the corresponding repo, a link to the source could be automatically added to the documentation page. This could work for directories too.

e.g.

The `scripts/example.py` script is an example.

Is converted to

The [`example.py`](https://github.com/org/repo/blob/-/scripts/example.py) script is an example.

Benefits

Allowing the user to quickly reference the source code associated with a file being discussed in the documentation.

Solution Idea

No response

@samvanstroud samvanstroud added the T: feature Feature. label Aug 31, 2024
@gir-bot gir-bot added the S: triage Issue needs triage. label Aug 31, 2024
@facelessuser
Copy link
Owner

While I can understand the usefulness of this, our current repo support does not poll the repository provider API to check anything against the repo, which is why it references the URL host and requires the shorthand syntax to be unique and recognizable so it can know the intent is to linkify the item in question.

For path handling, as you are requesting, we would have no idea if the path was an actual repo path or not. There are times when it could also be ambiguous if we were looking at a path as well. Lastly, using paths in inline code blocks would not be ideal. Inline code blocks are supposed to preserve the content. How would we know if we want a literal code block and one converted to a path link?

The only way I would likely be willing to consider anything of the like would be:

  1. It would need a very specific syntax unique enough to know the user intends it for it to be a linked path.
  2. A requirement for it to be a code block may be quite niche and not universally desired. I would likely only be interested in converting them to links. Users are within their right to target the classes and to style them like code blocks if desired.

I'm not sure what syntax for such paths would make sense at this time, so that would need to be decided if we were to consider moving forward with such a request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: triage Issue needs triage. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

3 participants