denoland / docs

Deno documentation, examples and API Reference. Powered by Lume.
https://docs.deno.com
MIT License
56 stars 100 forks source link

Shorten example command URLs #473

Open marvinhagemeister opened 3 months ago

marvinhagemeister commented 3 months ago

On https://docs.deno.com/examples/http-server-websocket the command to run the example is quite long:

deno run --allow-net https://raw.githubusercontent.com/denoland/deno-docs/main/by-example/http-server-websocket.ts
dsherret commented 1 month ago

Another reason to move away from these kind of links is that it doesn't allow us to provide redirects when the structure of the repo changes in the future.

marvinhagemeister commented 1 month ago

We should probably host all kinds of example modules directly on JSR, that way it would just be:

deno serve jsr:@deno-docs/http-server-websocket
dsherret commented 1 month ago

I'm not sure about storing the examples on JSR. JSR somewhat obscures the source by making it internal to the package whereas with an https url you can copy and paste it into your browser to see the source. Also, it's nice to keep the code close to the documentation.

thisisjofrank commented 1 month ago

Should we just host it in a /static folder on docs?

marvinhagemeister commented 1 month ago

Fair point, makes more sense to have them in the same repo instead of somewhere external on JSR.