-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Relative links in readme can be broken #9
Comments
It would be AMAZING if one could define some docs files structure that tsdocs can interpret and display. It would remove the need for a custom docusaurus-type site, as one could just put some markdown files in a I see two options:
A third option would be to support both, where the convention would be a "default config" that can be customized by adding a config file. |
PD: I'd be happy to take a stab at this. |
I believe the @DaniGuardiola let's open a new issue to discuss structure. Keeping this one for broken readme links. |
If it helps, what npm's site seems to do is rewrite relative links to repository (GitHub) links. I don't know the details of their algorithm, but a relative link in the README of a GitHub hosted project points to GitHub's user/repo/blob/HEAD/ |
Added a pull request addressing this issue |
I'd argue that relative links should link to files within the NPM package, not to GitHub. Our case for this is that we publish one of our packages to NPM from a private GitHub repo so that would make the links broken. Also, by linking within the same package you could also link to files generated at publish build time. And I think it just fits the general idea of relative links better, i.e: they point to the files next to the current one. |
I do agree with your use case. It won't function the same in the case of a private repo and relative links should actually refer to the root directory of the NPM package. |
I'd argue that packages should include all files linked to from other files. It should only be a small effort for them to include such files during publishing, no? So I'd just forget about supporting linking to GitHub to keep things simple. In other words: If you decide to include the README.md file in your package, then you should also include any files linked to from there. The responsibility lies with the publisher. |
In an ideal world that should happen. But, unfortunately it doesn't happen that way. Already bumped into these issues. |
How about we support both at the same time by first trying to resolve a relative link locally within the package that's being processed and falling back to GitHub deep links? I suppose that could be implemented in a followup PR so we can already merge your PR in the mean time to start using GitHub links. |
I think that is a good suggestion. But before we merge, we need to complete the discussion on post-load script for already generated docs. |
From HN:
The text was updated successfully, but these errors were encountered: