-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add embedding support to the REPL. #849
Comments
With a little bit of digging I've discovered that the repl actually already supports this, but the functionality for loading usermade gists is broken. Passing in something such as https://svelte.dev/repl/embed?gist=1d80b906abca49e697dde437fd57be0a will cause an internal error. I've tracked the gist fetching problem down to this line; investigating further. |
I found the problem; the object being returned by const components = files.map(({ name, source }) => {
const dot = name.lastIndexOf('.');
if (!~dot) return;
return {
name: name.slice(0, dot),
type: name.slice(dot + 1),
source
}
}); appears to return the correct data. Should I PR this? |
In sveltejs/svelte#4866 (comment) @Conduitry expressed concerns about this, and I'm not sure how much that has changed. We have open collective money now though so the situation is different now. |
Ah, I see. |
Describe the problem
At the moment, setting up code examples in documentation sites is rather tedious due to svelte's compiled nature. You have a few options:
Describe the proposed solution
While all of these options are valid, I believe that this could be made easier. Similarly to sites such as YouTube that offer <iframe /> embedding, I think the site could offer an embeddable link to a specific REPL with just the input and output. This would have a few advantages:
Alternatives considered
Document https://github.com/sveltejs/svelte-repl and make it more easily adaptable to external environments.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: