comprehensive-rust icon indicating copy to clipboard operation
comprehensive-rust copied to clipboard

Show `stderr` from code blocks

Open mgeisler opened this issue 2 years ago • 2 comments

Today, mdbook doesn't show stderr when running Rust code. The problem is that it uses a Playground endpoint which doesn't deliver this information. However, the Playground itself does have this information via an internal endpoint. See https://github.com/rust-lang/mdBook/pull/1315 for details.

Fixing this would allow us to start using dbg!(foo) instead of println!("foo: {foo:?}") in our code samples and thus simplify a lot of code blocks.

With https://github.com/google/mdbook-i18n-helpers/pull/75 merged, many more code blocks would be automatically removed from the translation files, thus reducing churn for our translators.

mgeisler avatar Mar 27 '23 14:03 mgeisler

I'll try to work on it in the next two weeks. -- Emma

emmali01 avatar Sep 23 '23 01:09 emmali01

Thanks Emma! You might very likely have to make changes to the upstream mdbook — we should upstream as much as possible, both so it can benefit everybody and so we can avoid carrying patches (which makes it hard to update our version of mdbook).

mgeisler avatar Sep 23 '23 09:09 mgeisler