feat(toplogy): add png and jpg image rendering; add iamge-name small cards

This commit is contained in:
oddlama 2024-03-21 16:31:51 +01:00
parent 5248003dfe
commit 8f66df0238
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
8 changed files with 202 additions and 66 deletions

View file

@ -13,7 +13,8 @@ program
.argument("<output>", "output svg")
.option("--font <font>", "Sets the font")
.option("--font-bold <font>", "Sets the bold font")
.option("-w, --width <width>", "Sets the width of the output", 680)
.option("-w, --width <width>", "Sets the width of the output. Use auto for automatic scaling.", "auto")
.option("-h, --height <height>", "Sets the height of the output. Use auto for automatic scaling.", "auto")
.action(async (input, output, options) => {
if (!options.font) {
console.error("--font is required");
@ -27,7 +28,8 @@ program
const markup = html(await fs.readFile(input, { encoding: "utf8" }));
const svg = await satori(markup, {
width: options.width,
...(options.width != "auto" && {width: options.width}),
...(options.height != "auto" && {height: options.height}),
embedFont: true,
fonts: [
{