Code widget refactor
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import type { WidgetContent } from "$sb/app_event.ts";
|
||||
import { editor, events, language, space, system } from "$sb/syscalls.ts";
|
||||
import { events, language, space, system } from "$sb/syscalls.ts";
|
||||
import { parseTreeToAST } from "$sb/lib/tree.ts";
|
||||
import { astToKvQuery } from "$sb/lib/parse-query.ts";
|
||||
import { jsonToMDTable, renderTemplate } from "../directive/util.ts";
|
||||
import { replaceTemplateVars } from "../template/template.ts";
|
||||
import { parse } from "../../common/markdown_parser/parse_tree.ts";
|
||||
|
||||
export async function widget(bodyText: string): Promise<WidgetContent> {
|
||||
const pageMeta = await space.getPageMeta(await editor.getCurrentPage());
|
||||
export async function widget(
|
||||
bodyText: string,
|
||||
pageName: string,
|
||||
): Promise<WidgetContent> {
|
||||
const pageMeta = await space.getPageMeta(pageName);
|
||||
|
||||
try {
|
||||
const queryAST = parseTreeToAST(
|
||||
|
||||
Reference in New Issue
Block a user