proof of concept share/import feature for elm-lang.org/try

178 views
Skip to first unread message

Matteo Bertini

unread,
May 25, 2016, 12:29:21 PM5/25/16
to Elm Discuss
I have a proof of concept share/import feature for elm-lang.org/try

It uses the location.hash trick as in play.rust, was so simple I'm now thinking that this is perhaps an unwanted feature.

Here is the patch:https://github.com/elm-lang/elm-lang.org/commit/cd735fb82955dd86579f0350e74d0beb5b481d93 if there is some interest I can make a pull request and refine it (add a shortener and a length check, for example).

Cheers,
Matteo

PS
the branch is hacked to work opening locally the prova/index.html file.

Fernando Alegre

unread,
May 25, 2016, 5:35:24 PM5/25/16
to Elm Discuss

FWIW, I'd definitely want such feature. I think it is really useful for my use cases (schools and such).

Janis Voigtländer

unread,
May 26, 2016, 6:05:13 AM5/26/16
to elm-d...@googlegroups.com

Concerning the question whether this is a wanted feature at http://elm-lang.org/, there is this comment by Evan: https://github.com/elm-lang/elm-lang.org/issues/519#issuecomment-218553560


--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick H

unread,
May 26, 2016, 1:55:26 PM5/26/16
to elm-d...@googlegroups.com
Sounds like you should check out (and maybe contribute to) ElmFiddle.io!

Matteo Bertini

unread,
May 27, 2016, 4:20:56 AM5/27/16
to Elm Discuss
Il giorno giovedì 26 maggio 2016 19:55:26 UTC+2, Nick H ha scritto:
Sounds like you should check out (and maybe contribute to) ElmFiddle.io!

I'd like to have this basic functionality in the official "try" too, but I'll have a look at ElmFiddle.io !

Paul Brauner

unread,
May 27, 2016, 8:46:01 AM5/27/16
to Elm Discuss
Evan's comment on the issue sounds as if he thinks the code has to be stored serverside or something. Otherwise I'm not sure where the maintenance burden he's referring to lies.

Paul

--

Matteo Bertini

unread,
May 27, 2016, 11:13:25 AM5/27/16
to elm-d...@googlegroups.com
Yes, I've had the same idea, using the history only has no back-end maintenance burden, "only" a front-end will-work-now-on implicit contract.

Going on with the UI, I have added 2 more buttons in the command bar:

- Import that reads from the location.hash
- Share that puts the code encodeURIComponent'ed in the url as hash

The only automatic import is done at loading time.

Suggestions for a better workflow?


--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/QLrod8th2Sk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Gage Peterson

unread,
May 28, 2016, 2:31:06 PM5/28/16
to Elm Discuss, mat...@naufraghi.net

One way you could potentially rely on having access to Github Gists. Sign in with a Github account and then you could use this command to save the snippet as a Gist: https://developer.github.com/v3/gists/#create-a-gist. Then all the sever would do is pull it from Github, and send it back in a html page form to be compiled client side. 
Reply all
Reply to author
Forward
0 new messages