import { sandbox } from "$sb/plugos-syscall/mod.ts"; import { editor, markdown, sandbox as serverSandbox, } from "$sb/silverbullet-syscall/mod.ts"; export async function parsePageCommand() { console.log( "AST", JSON.stringify( await markdown.parseMarkdown(await editor.getText()), null, 2, ), ); } export async function showLogsCommand() { const clientLogs = await sandbox.getLogs(); const serverLogs = await serverSandbox.getServerLogs(); await editor.showPanel( "bhs", 1, `
${ clientLogs .map((le) => `[${le.level}] ${le.message}`) .join("\n") }
${ serverLogs .map((le) => `[${le.level}] ${le.message}`) .join("\n") }