Last active
December 26, 2021 18:19
-
-
Save teticio/c00510d1b524a87d0abca4049e72d057 to your computer and use it in GitHub Desktop.
Jupyter notebook extension code prettifier configuration for Rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"rust": { | |
"library": "extern crate serde_json; extern crate rustfmt;", | |
"prefix": "{ use std::fs::File; use serde_json::json; use crate::rustfmt::{format_input, Input, config::Config}; let config = Config::default(); let input = Input::Text(", | |
"postfix": ".into()); let (summary, filemap, _) = format_input::<File>(input, &config, Option::None).unwrap(); if summary.has_no_errors() { let (_, output) = &filemap[0]; println!(\"{}\", json!(output.to_string())); } }" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to the configuration of the code prettifier nbextension to use with the Rust EvCxR Jupyter kernel.