-
-
Notifications
You must be signed in to change notification settings - Fork 359
Make use of code-run-websites #167
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
Comments
I see the value in this. I myself tonight copy/pasted some matlab code in the matlab online website because I don't have matlab installed on this machine (... oh wait... I just realized I do have it... gah...). |
I can see two different methods of doing this. Either include just a link to the website or have it somehow integrate in the AAA. @jiegillet I would say just creating it manually and checking if the output is right is enough. We need to pay attention to this then in future PRs of course, but I think this will be fine. I don't know what you mean by tools... A GitBook plugin doing that would be neat (and cover the second method I named), but I highly doubt it exists. |
Yeah I was thinking GitBook plugin... We have all the informations, where the file is, what the language is. Some online interpreters can handle hundreds of languages. But yes, chances are low it exists. |
I must say I'm not a fan of integrating these tools. I'd support the decision to have an introduction chapter with a bunch of links to such online interpreters/compilers, but in the end, we're writing a book. I don't think it needs live code execution. Secondly, I don't like the idea of creating a bunch of dependencies on third-party services. They can go down, change their APIs and it will be work to maintain working connections to them. |
@Gustorn recently brought up that we could do something like this: https://doc.rust-lang.org/book/second-edition/ch01-02-hello-world.html, where each codeblock can be run in the background. I don't know how well this will play with the include-codeblocks and theme-api plugins. @julianschacher mentioned we could use this too: https://docs.microsoft.com/en-us/dotnet/csharp/quick-starts/hello-world?tutorial-step=2, which brings up a separate editor so people can play with the code. I also don't know what languages are supported for a similar feature. Like @Butt4cak3 I don't know if these services will be stable for a long time or not... But I am not sure how long our current tools will be stable for anyway. |
A neat example of how to implement this can be seen in the Ant Design docs. Click on view code and note the small icons that link to the code preview sites. @Butt4cak3 I don't think it would hurt too much to just link to their sites like in this example ^ (most projects do that). I know it's super annoying to deal with changing APIs and whatnot, but if they do go down it wouldn't be too hard to remove them. @leios Something similar to what the rustlang book does is very hard for anything that's not JavaScript. I'd suggest linking to the code playground sites instead. Here are a few good ones that we can link to: JavaScript: https://codepen.io / https://jsfiddle.net/ / http://jsbin.com/ |
Cannot we just test in local what the results are, and cheat a little bit : when the user will press on buttons like 'play' or something like that, the results are stored somewhere and are just display! |
Yes that's right! |
For many languages websites exist, where people can run code snippets.
We currently don't really do that in the AAA, but I think it's a cool thing to add for languages supporting it.
People wouldn't have to download and install everything needed just to run some code and people could also run code on mobile.
This topic came to my attention again, because of this #164 which included a convenient way to run the code.
So I open this issue for discussion about this topic. What do you guys think?
The text was updated successfully, but these errors were encountered: