svg2png-wasm
10 |Convert svg to png using WebAssembly.
11 |Demo
16 |Playground
21 |Runs in the browser, file is not sent to the server.
22 |20 | 39 |
40 |
41 | {#each promises as promise}
42 | {#await promise}
43 |
52 | {/if}
53 | {/await}
54 | {/each}
55 |
19 |
24 |
6 |15 | -------------------------------------------------------------------------------- /site/src/lib/components/markdown-plugins/code/BlockquoteAdapter.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |12 | 14 |13 |
{@render children?.()}7 | -------------------------------------------------------------------------------- /site/src/lib/components/markdown-plugins/code/Code.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |
{@render children?.()}
7 |
--------------------------------------------------------------------------------
/site/src/lib/components/markdown-plugins/code/Pre.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 | {#each get(getAstNode()).children?.[0].children ?? [] as astNode}13 | -------------------------------------------------------------------------------- /site/src/lib/components/markdown-plugins/code/index.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from "svelte-exmarkdown"; 2 | import Blockquote from "./BlockquoteAdapter.svelte"; 3 | import Code from "./CodeAdapter.svelte"; 4 | import Pre from "./PreAdapter.svelte"; 5 | 6 | export const codePlugin: Plugin = { 7 | renderer: { 8 | pre: Pre, 9 | code: Code, 10 | blockquote: Blockquote, 11 | h1: "h2", 12 | h2: "h3", 13 | h3: "h4", 14 | h4: "h5", 15 | h5: "h6", 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /site/src/lib/components/markdown-plugins/highlight/index.ts: -------------------------------------------------------------------------------- 1 | import typescript from "highlight.js/lib/languages/typescript"; 2 | import rehypeHighlight from "rehype-highlight"; 3 | import type { Plugin } from "svelte-exmarkdown"; 4 | import "highlight.js/styles/github.css"; 5 | 6 | export const highlightPlugin: Plugin = { 7 | rehypePlugin: [rehypeHighlight, { languages: { typescript } }], 8 | }; 9 | -------------------------------------------------------------------------------- /site/src/lib/components/markdown-plugins/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./highlight"; 2 | export * from "./code"; 3 | -------------------------------------------------------------------------------- /site/src/lib/stores/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./packageManager"; 2 | export * from "./svg2png"; 3 | -------------------------------------------------------------------------------- /site/src/lib/stores/packageManager.ts: -------------------------------------------------------------------------------- 1 | import { browser } from "$app/environment"; 2 | import { writable } from "svelte/store"; 3 | 4 | export const packageManagers = ["npm", "yarn", "pnpm"] as const; 5 | 6 | export type PackageManager = (typeof packageManagers)[number]; 7 | 8 | const storeKey = "packageManager"; 9 | const npmOrYarnOrPnpm = (pm: unknown): PackageManager => 10 | pm === "npm" || pm === "yarn" || pm === "pnpm" ? pm : "npm"; 11 | 12 | export const packageManager = (() => { 13 | const { subscribe, set } = writable{/each}
Convert svg to png using WebAssembly.
11 |Runs in the browser, file is not sent to the server.
22 |