TypeStrong / typedoc-auto-docs

An idea from TS Discord to automatically render docs for the ecosystem, similar to docs.rs and doc.deno.land
MIT License
10 stars 4 forks source link

"Defined in" linking to unpkg or github #6

Open cspotcode opened 3 years ago

cspotcode commented 3 years ago

Typedoc can link to the source code in github. But if we're rendering from npm installs, links will be to the bundled .d.ts. Can we link to unpkg.com? Is this useful, or should we not attempt any unpkg linking, preferring instead to wait until we can link to github?

keithlayne commented 3 years ago

One consideration is that not everything might be on github. I think unpkg would probably be pretty good.

I mean, if we have the npm, we have the source. This could be done:

image

(from the rails api docs) I don't know how useful that is. It's also possible I'm missing a step.

cspotcode commented 3 years ago

I found this in Typedoc's source: https://github.com/TypeStrong/typedoc/blob/8e097efdea3cda1b1f27467199a5ea5d690943f4/src/lib/converter/plugins/GitHubPlugin.ts#L257-L266

I think we can tweak this plugin to render links to unpkg.

cspotcode commented 3 years ago

I've self-assigned this because I'm going to try making a Unpkg linking plugin, based on the github plugin.