forked from mirrors_public/oddlama_nix-config
feat(toplogy): add png and jpg image rendering; add iamge-name small cards
This commit is contained in:
parent
5248003dfe
commit
8f66df0238
8 changed files with 202 additions and 66 deletions
|
@ -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: [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue