diff --git a/src/app.html b/src/app.html index 2760a94..adb9ef3 100644 --- a/src/app.html +++ b/src/app.html @@ -2,7 +2,7 @@
- + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5fe07c3..8e8c6fe 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -59,11 +59,61 @@ export const GET: RequestHandler = async () => { }; `; + + const apiReference = ` +import {ImageResponse, componentToImageResponse} from '@ethercorps/sveltekit-og' +import {SvelteComponent} from "svelte"; + +// ... +ImageResponse( + element : string, + options : { + width ? : number = 1200 + height ? : number = 630, + backgroundColor ? : string = "#fff" + fonts ? : { + name: string, + data: ArrayBuffer, + weight: number, + style: 'normal' | 'italic' + }[] + debug ? : boolean = false + graphemeImages ? : Record@@ -123,7 +173,68 @@ export const GET: RequestHandler = async () => {
+ Notice that our example uses TailwindCSS classes (e.g. tw="bg-gray-50"). Alternatively, your HTML can contain style attributes using any of the subset of CSS supported by Satori.
+
+
+ Satori supports only a subset of HTML and CSS. For full details, see Satori’s documentation. Notably, Satori only supports flex-based layouts.
+
+ Satori supports ttf, otf, and woff font formats; woff2 is not supported. To maximize the font parsing speed, ttf or otf are recommended over woff.
+
+
+ By default, @ethercorps/sveltekit-og includes only 'Noto Sans' font. If you need to use other fonts, you can specify them as shown in the example. Notably, you can also import a font file that is stored locally within your project and are not required to use fetch.
+
+ The package exposes an ImageResponse and componentToImageResponse constructors, with the following options available. +
+{@html highlightedApiReference}
+