How to screenshot Ruby code properly: what Ruby snippets actually look like, how auto-detection behaves, the theme that reads best, and the settings that keep the card legible.
Rails-flavoured Ruby dominates: a controller action or a model with has_many, validates, a block with do |x| … end, symbol-keyword arguments (def create(order:, notify: true)), string interpolation ("Order #{id}"), and the modifier forms that make Ruby read like prose (return unless order, items.each_with_index.map). Ruby's end keyword means indentation is decorative and structure is explicit — which is good for screenshots, because a fragment keeps its shape even when pasted out of context.
Ruby is rule 2, immediately after Python. Triggers: def name (no paren needed), a line that is just end, puts , attr_accessor, and require. Python's rule 1 needs def name(...): with a paren and a colon, so def foo alone goes to Ruby and def foo(a): goes to Python — a clean split in theory. Two real problems: require also matches Node's CommonJS const x = require('y'), and since Ruby is rule 2 it beats the JavaScript rule (13) outright, so a Node snippet renders as Ruby; and a Rails snippet written entirely in block form (items.each do |i| … end) may still miss if it contains none of the five triggers and no def.
rose-pine for dark: symbols and strings need to separate, because Ruby cards are full of :symbol and "interpolated #{strings}", and rose-pine keeps those two hues apart without a saturated background. catppuccin-latte for light, paired with rose-pine-moon if you want a second dark variant for the same snippet.
do |x| … end block intact on the card; Ruby's block syntax is its most distinctive shape, and a truncated block with a dangling end is the most common pasted mistake.language: "ruby" on any snippet containing require — Node's require will otherwise pull the whole card toward Ruby only if it wins, or toward Ruby when you wanted JavaScript.highlightLines on the callback inside a block rather than on the end: the eye already finds end, and highlighting punctuation teaches nothing.Feature by feature, against the other code screenshot tools.