Ruby 是最适合截图的语言之一,因为地道的 Ruby 写法很短,要说明的意思通常三四行就看得出来。
Codeshot 会根据你粘贴的代码识别 Ruby,不存在选错语言的问题。下面是同一段代码在内置 30 款主题中的三款下的效果,由应用自身的样式表渲染。
Ruby
不必离开 Mac,就能把 Ruby 代码片段变成值得分享的图片。
Ruby 是最适合截图的语言之一,因为地道的 Ruby 写法很短,要说明的意思通常三四行就看得出来。
Codeshot 会根据你粘贴的代码识别 Ruby,不存在选错语言的问题。下面是同一段代码在内置 30 款主题中的三款下的效果,由应用自身的样式表渲染。
class Snapshot
attr_reader :code, :theme
def initialize(code, theme: "xcode", scale: 2)
@code, @theme, @scale = code, theme, scale
end
def export(path)
Renderer.render(code, theme).save(path, scale: @scale)
end
end
class Snapshot
attr_reader :code, :theme
def initialize(code, theme: "xcode", scale: 2)
@code, @theme, @scale = code, theme, scale
end
def export(path)
Renderer.render(code, theme).save(path, scale: @scale)
end
end
class Snapshot
attr_reader :code, :theme
def initialize(code, theme: "xcode", scale: 2)
@code, @theme, @scale = code, theme, scale
end
def export(path)
Renderer.render(code, theme).save(path, scale: @scale)
end
end
行数少意味着你可以把字号调大,同时还装得下完整的想法。把这份余量用在这里,而不是用来填满画面。
让图片随内容自适应,或锁定一个比例——1:1、4:3、3:2、16:9、9:16、2:3 或 3:4——然后以 1×、2× 或 3× 导出,在 Retina 屏上依然清晰。用 ⌘⇧C 直接复制到剪贴板,或用 ⌘S 保存。
查看全部 30 款主题对比,或阅读完整流程。
一切都在你的 Mac 上完成,代码不会外传。