import { markdown, space } from "$sb/silverbullet-syscall/mod.ts"; import { fs } from "$sb/plugos-syscall/mod.ts"; import { asset } from "$sb/plugos-syscall/mod.ts"; import type { PublishEvent } from "../share/publish.ts"; import { renderMarkdownToHtml } from "./markdown_render.ts"; export async function sharePublisher(event: PublishEvent) { const path = event.uri.split(":")[1]; const pageName = event.name; const text = await space.readPage(pageName); const tree = await markdown.parseMarkdown(text); const css = await asset.readAsset("assets/styles.css"); const markdownHtml = renderMarkdownToHtml(tree, { smartHardBreak: true, }); const html = `