Go backend (#1555)

* Replaces old Deno server with a Go implementation
* Restructured the code base accordingly
This commit is contained in:
Zef Hemel
2025-09-19 13:23:20 +02:00
committed by GitHub
parent ff2cb27a1b
commit a524c64884
322 changed files with 3841 additions and 3228 deletions
+24
View File
@@ -0,0 +1,24 @@
import type { SysCallMapping } from "../../lib/plugos/system.ts";
import type { CodeWidgetHook } from "../hooks/code_widget.ts";
import type { CodeWidgetContent } from "@silverbulletmd/silverbullet/type/client";
export function codeWidgetSyscalls(
codeWidgetHook: CodeWidgetHook,
): SysCallMapping {
return {
"codeWidget.render": (
_ctx,
lang: string,
body: string,
pageName: string,
): Promise<CodeWidgetContent | null> => {
const langCallback = codeWidgetHook.codeWidgetCallbacks.get(
lang,
);
if (!langCallback) {
throw new Error(`Code widget ${lang} not found`);
}
return langCallback(body, pageName);
},
};
}