diff --git a/plugos-silverbullet-syscall/editor.ts b/plugos-silverbullet-syscall/editor.ts index 98a68244..66567a20 100644 --- a/plugos-silverbullet-syscall/editor.ts +++ b/plugos-silverbullet-syscall/editor.ts @@ -32,14 +32,22 @@ export function flashNotification(message: string): Promise { return syscall("editor.flashNotification", message); } -export function showRhs(html: string): Promise { - return syscall("editor.showRhs", html); +export function showRhs(html: string, flex = 1): Promise { + return syscall("editor.showRhs", html, flex); } export function hideRhs(): Promise { return syscall("editor.hideRhs"); } +export function showLhs(html: string, flex = 1): Promise { + return syscall("editor.showLhs", html, flex); +} + +export function hideLhs(): Promise { + return syscall("editor.hideLhs"); +} + export function insertAtPos(text: string, pos: number): Promise { return syscall("editor.insertAtPos", text, pos); } diff --git a/plugs/markdown/markdown.plug.yaml b/plugs/markdown/markdown.plug.yaml index 66f5eb29..4f56324b 100644 --- a/plugs/markdown/markdown.plug.yaml +++ b/plugs/markdown/markdown.plug.yaml @@ -3,6 +3,8 @@ functions: path: "./markdown.ts:togglePreview" command: name: "Toggle Markdown Preview" + key: Ctrl-p + mac: Cmd-p preview: path: "./markdown.ts:updateMarkdownPreview" env: client diff --git a/plugs/markdown/markdown.ts b/plugs/markdown/markdown.ts index 8e42e43b..aee5d1dd 100644 --- a/plugs/markdown/markdown.ts +++ b/plugs/markdown/markdown.ts @@ -48,7 +48,7 @@ export async function updateMarkdownPreview() { } }); let html = md.render(renderMarkdown(mdTree)); - await showRhs(`${html}`); + await showRhs(`${html}`, 1); } async function hideMarkdownPreview() { diff --git a/webapp/components/panel.tsx b/webapp/components/panel.tsx index 363916f3..16a2e9c3 100644 --- a/webapp/components/panel.tsx +++ b/webapp/components/panel.tsx @@ -1,9 +1,8 @@ import {useEffect, useRef} from "react"; // @ts-ignore import iframeHtml from "bundle-text:./panel.html"; -import {Simulate} from "react-dom/test-utils"; -export function Panel({ html }: { html: string }) { +export function Panel({ html, flex }: { html: string; flex: number }) { const iFrameRef = useRef(null); useEffect(() => { function loadContent() { @@ -25,7 +24,7 @@ export function Panel({ html }: { html: string }) { }; }, [html]); return ( -
+