doc_website icon indicating copy to clipboard operation
doc_website copied to clipboard

Clicking on [src] in builtin types downloads the source file

Open singla-shivam opened this issue 4 years ago • 5 comments

Actual

On the documentation of builtin (https://doc.deno.land/builtin/stable), clicking [src] downloads the source file.

Expected

It should have opened the source code on GitHub with the pointed line highlighted.

singla-shivam avatar Mar 17 '21 16:03 singla-shivam

@singla-shivam which src are you clicking?

If I click src for addEventListener it just takes me to the page https://doc-proxy.deno.dev/builtin/stable#L5802 without downloading.

GuiltyDolphin avatar Jun 27 '21 14:06 GuiltyDolphin

probably this was fixed by https://github.com/denoland/doc_website/pull/183

It used to point to https://github.com/denoland/deno/releases/download/v1.11.2/lib.deno.d.ts and it has content-type: application/octet-stream which causes the downloading of the file.

kt3k avatar Jun 28 '21 07:06 kt3k

It would be a better experience if it pointed to the actual source code on the repository (not sure if this is possible) with working line fragments (#L).

satyarohith avatar Jun 28 '21 09:06 satyarohith

The doc (e.g. https://doc-proxy.deno.dev/builtin/stable ) is generated from multiple source files. So it's not easily possible to point the line in the source file. But the doc page is generated by this Deploy script https://github.com/denoland/doc_website/blob/main/deploy/main.ts So probably we can enhance this output to make #L hash work.

kt3k avatar Jun 28 '21 11:06 kt3k

@singla-shivam which src are you clicking?

@GuiltyDolphin It used to download the source file. But as mentioned by @kt3k, it is fixed now.

singla-shivam avatar Jun 30 '21 16:06 singla-shivam