Lua

Lua Code Screenshot Generator

Turn Lua snippets into images worth sharing, without leaving your Mac.

Lua shows up in config and game scripting, where the snippet is usually a small table or a single function.

Codeshot detects Lua from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

local Snapshot = {}
Snapshot.__index = Snapshot

function Snapshot.new(code, theme)
  return setmetatable({ code = code, theme = theme or "xcode" }, Snapshot)
end

function Snapshot:export(path, scale)
  return render(self.code, self.theme):save(path, scale or 2)
end

return Snapshot
Atom One · dark
local Snapshot = {}
Snapshot.__index = Snapshot

function Snapshot.new(code, theme)
  return setmetatable({ code = code, theme = theme or "xcode" }, Snapshot)
end

function Snapshot:export(path, scale)
  return render(self.code, self.theme):save(path, scale or 2)
end

return Snapshot
Edge · dark
local Snapshot = {}
Snapshot.__index = Snapshot

function Snapshot.new(code, theme)
  return setmetatable({ code = code, theme = theme or "xcode" }, Snapshot)
end

function Snapshot:export(path, scale)
  return render(self.code, self.theme):save(path, scale or 2)
end

return Snapshot
GitHub · dark

Choosing a theme for Lua

Lua snippets are short by nature, so resist filling the frame. A small snippet with generous padding reads better than a cramped larger one.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for Lua, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS