-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support wasm-pack frontend in mdBook #1501
base: master
Are you sure you want to change the base?
Conversation
85bbf32
to
414ad34
Compare
414ad34
to
e43b231
Compare
Hi, I have already served my own rust-playground with |
Sorry, I'm maybe a little confused on what this is doing. Has the corresponding PR been accepted by integer32? Have they committed to allowing that endpoint to be used by public tools? I probably won't review until they commit to it. If you're proposing to use a new service, I unfortunately probably won't accept that. I think I would prefer making the backend more configurable (#350), so that books can define their own (maybe through some kind of theme files?), but that would need some design work. |
Yes, #350 would be the better solution when it comes to plenty of available backends. |
This PR aim to solve #1500.
Change of code
run_wasm_pack_code
function intheme/book.js
to fetchwasm-pack
results and rendering them in Iframewasm
className intheme/book.js
to differentiate the normal Rust and Wasm codetheme/iframe.html
andtheme/wasm-entry.mjs
for Iframeiframe.html
andwasm-entry.mjs
to built directory by RustNote
iframe.html
andwasm-entry.mjs
if we adapt their method, but the real implementation needs to be discussed.Demo
2021-04-15.11-29-30.mp4
P.S.
This implementation is more like prototype than production, feel free to point out where I could do better or rewrite suitibly.