You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the code that comes up when you first load Try PureScript is loaded from a gist, whose ID is specified in the configuration (client/config/dev/Try.Config.purs). That gist also contains links to other gists.
I think using gists for these examples is a bit awkward, since you can't do pull requests on them, and access control on gists is not really a thing either. I think it would be ideal to move them inside the repo, although of course we should continue to support loading code from gists. Perhaps we could achieve this by including these examples in the deploy bundle and hosting them at try.purescript.org, and then implementing an example query string parameter which operates in a similar way to the gist one, except that instead of a gist ID to load, it specifies a URL path to a PureScript source file? A query string like ?example=Records could tell the client to fetch try.purescript.org/examples/Records/Main.purs and load it into the editor, for instance.
The text was updated successfully, but these errors were encountered:
I'd quite like to generalise this a little and provide a way to load any PureScript source file on GitHub, perhaps via ?github=user/repo/branch/path/to/file.purs. Requests to raw.githubusercontent.com have an Access-Control-Allow-Origin: * response header so I think this should be possible.
Right now, the code that comes up when you first load Try PureScript is loaded from a gist, whose ID is specified in the configuration (
client/config/dev/Try.Config.purs
). That gist also contains links to other gists.I think using gists for these examples is a bit awkward, since you can't do pull requests on them, and access control on gists is not really a thing either. I think it would be ideal to move them inside the repo, although of course we should continue to support loading code from gists. Perhaps we could achieve this by including these examples in the deploy bundle and hosting them at try.purescript.org, and then implementing an
example
query string parameter which operates in a similar way to thegist
one, except that instead of a gist ID to load, it specifies a URL path to a PureScript source file? A query string like?example=Records
could tell the client to fetchtry.purescript.org/examples/Records/Main.purs
and load it into the editor, for instance.The text was updated successfully, but these errors were encountered: