Closed dclong closed 1 year ago
Thanks for reaching out, but I'm going to close this as I don't anticipate that the team will add direct support for Jupyter notebooks to rustfmt. That being said, it probably wouldn't be too difficult to build a tool that extracted code blocks from a Jupyter notebook and then handed them off to rustfmt for formatting.
Jupyter notebooks are just JSON documents, and it should be fairly easy to iterate through all the "cell_type" : "code"
cells and run rustfmt on their source
.
https://github.com/evcxr/evcxr/tree/main/evcxr_jupyter is a Jupyter notebook kernel which allows running Rust code in Jupyter notebooks. It's a great tool (in addition to Rust Playground) for exploring and learning Rust.
It would be very appealing if rustfmt support format Jupyter notebooks containing Rust code too.