Factor out markdown widget rendering

This commit is contained in:
Zef Hemel
2023-10-29 10:02:50 +01:00
parent 23e99b0c46
commit 50caba8522
17 changed files with 102 additions and 77 deletions
+1 -4
View File
@@ -1,14 +1,11 @@
import { Hook, Manifest } from "../../plugos/types.ts";
import { System } from "../../plugos/system.ts";
import { CodeWidgetCallback } from "$sb/types.ts";
export type CodeWidgetT = {
codeWidget?: string;
};
export type CodeWidgetCallback = (
bodyText: string,
) => Promise<{ html: string; script: string }>;
export class CodeWidgetHook implements Hook<CodeWidgetT> {
codeWidgetCallbacks = new Map<string, CodeWidgetCallback>();