mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-13 23:12:24 +00:00
fix: Bug in high-level API for png formatter
This commit is contained in:
parent
3bf8172b89
commit
8b34a1659d
@ -1,16 +1,20 @@
|
||||
require "../formatter"
|
||||
require "compress/gzip"
|
||||
require "digest/sha1"
|
||||
require "stumpy_png"
|
||||
require "stumpy_utils"
|
||||
require "compress/gzip"
|
||||
|
||||
module Tartrazine
|
||||
def self.to_png(text : String, language : String,
|
||||
theme : String = "default-dark",
|
||||
line_numbers : Bool = false) : String
|
||||
buf = IO::Memory.new
|
||||
|
||||
Tartrazine::Png.new(
|
||||
theme: Tartrazine.theme(theme),
|
||||
line_numbers: line_numbers
|
||||
).format(text, Tartrazine.lexer(name: language))
|
||||
).format(text, Tartrazine.lexer(name: language), buf)
|
||||
buf.to_s
|
||||
end
|
||||
|
||||
class FontFiles
|
||||
|
Loading…
Reference in New Issue
Block a user