Skip to content

Rust code block like feature for all languages #1942

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

Closed
SunPodder opened this issue Dec 2, 2022 · 3 comments
Closed

Rust code block like feature for all languages #1942

SunPodder opened this issue Dec 2, 2022 · 3 comments

Comments

@SunPodder
Copy link

Why don't we still get this? I understand that all languages might not have a playground like rust. But in that case we may use our own backend. (Maybe specify that in book.toml?)

I was patching my book.js to add my own backend, but I found myself reinventing the wheel. Like, in python playground playground_text function returns empty string everytime. Also the output text gets written into the source code block instead of a new one.

But that works if I use rust instead. Also we get a different run button than rust in python playground. Why that? I don't know if you guys hard-coded that for rust only. If so, please make them dynamic so atleast we can do easy patches until any official solution becomes available.

@ehuss
Copy link
Contributor

ehuss commented Dec 2, 2022

Sorry, I don't fully understand what this issue is asking. If it is about supporting other languages for remote code execution, then that is tracked in #350.

@SunPodder
Copy link
Author

Yes, What I was actually looking for is remote code execution. But the UI also differs when using rust vs other languages. Like I get another run button (top left corner, always visible) when using python code block rather than what I get in rust (top right, visible on hover) code block. The UI should be the same for all languages, shouldn't it?

Also as I mentioned, I changed the book.js fetch url to my own api. But the playground_text() function in the javascript file returns "" in python code block, which isn't the case in rust code block (with the same javascript file)

@ehuss
Copy link
Contributor

ehuss commented Dec 2, 2022

I can't say why the run button is different. However, since other languages aren't supported, I'm not too surprised there are issues. I'm going to close as a duplicate of #350, as this seems to be essentially the same issue. If and when that is fixed, I'm sure getting the UI working would be part of that.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants