rust-lang / rust-playground

The Rust Playground
https://play.rust-lang.org/
Apache License 2.0
1.2k stars 201 forks source link

Please bring back URL shortening #166

Open jethrogb opened 6 years ago

jethrogb commented 6 years ago

I'd prefer not to store transient code snippets permanently on GitHub, subject to GitHub's T&C, etc. is.gd was a very good choice, but I think a service that retires shortlinks after some time would be even better.

shepmaster commented 6 years ago

I'd prefer not to store transient code snippets permanently on GitHub, subject to GitHub's T&C, etc.

Instead, you'd be storing transient code on whichever link shortener's site, subject to whatever their terms and conditions are, correct?

joshtriplett commented 6 years ago

Please don't use a service that retires shortlinks. However, I did very much like the self-contained nature of the link shortener solution, and I'd like to see this as well.

shepmaster commented 6 years ago

the self-contained nature of the link shortener solution

Could you expand on the benefit compared to the Gists? What does "self-containment" mean in this case?

joshtriplett commented 6 years ago

@shepmaster I like the ability to link to the playground with code in the URL (and AFAICT the new playground still supports that). URL shorteners just redirect to that exact same URL. By doing so, they make it obvious that they're not doing anything "special": anything that preserves the URL works. (So, for instance, you can also paste the full URL with code onto Twitter or similar, and use its URL shortener instead.)

So, it's not that there's anything special about is.gd or bit.ly or j.mp or any other specific shortener. It's that using a shortener that redirects to the code URL provides transparency about the mechanism, and makes it obvious what a user can do themselves.

shepmaster commented 6 years ago

It seems that an alternate solution would be a method that places the code in the text field into a URL using the code parameter and then let you copy that. You can then choose your favorite link shortener as you please.

Thoughts?

joshtriplett commented 6 years ago

@shepmaster That'd be an improvement, yes. Having a "shorten" button would be nice to go with that, but not as critical.

polarathene commented 6 years ago

Alternatively if there is an open source shortener service that you could run in a docker container and lock the urls to the playground(so that it's not used for shortening urls elsewhere), that'd work too? I was confused that the url/link button for code was missing.

Could a copy button or something also appear with the two gist links to get the playground url(avoids auto replacing whatever user has copied presently and doesn't require right-click, navigate to copy, left-click to get link).