How to screenshot Rust code properly: what Rust snippets actually look like, how auto-detection behaves, the theme that reads best, and the settings that keep the card legible.
Rust snippets are the most syntax-dense of the set: lifetimes (<'a, 'b: 'a>), trait bounds (T: Clone + Send + 'static), match arms, ? propagation, and attribute macros (#[derive(Debug, Serialize)]). Two features break naive highlighting. First, lifetimes and char literals share the apostrophe, so 'a and 'x' sit one character apart. Second, macros are called with a bang and their contents are not parsed as Rust, so println!("{}", x) and format!("{name}") look unlike anything else in the file.
Rust is rule 4, after Python, Ruby and Go. Four triggers: fn name(, let mut, the turbofish ::<, and println!(. That covers most real snippets. The gap is declaration-only code: #[derive(Debug)] plus struct Foo { … } plus impl Foo { … } contains none of the four, and a line starting with a brace is not present either, so the whole thing falls to the typescript default and gets TypeScript-flavoured colouring. let mut also appears in some pseudocode; if a snippet contains it but is not Rust, auto will still say Rust.
tokyo-night for dark cards: it gives lifetimes, macros and types three clearly separated hues, which is what a Rust snippet needs, and its background is dark enough that the many brackets do not shimmer. vitesse-light is the light counterpart — muted enough that a where-clause does not turn into confetti.
impl<T: Display + Debug + Send + Sync> Handler for S<T> needs the full width; raise width toward 1200 rather than shrinking the font below 14.#[derive(...)] line with its struct — it is Rust's most recognisable idiom and readers scan for it before reading anything else.highlightLines) instead of pasting the neighbouring 30 lines that exist only to give it context.Feature by feature, against the other code screenshot tools.