Files
plainleaf/plugs/editor/document.ts
T
MrMugameandGitHub e61a447d98 Implementing #913 (#1230)
Implemented custom editors
2025-03-06 15:11:17 +01:00

17 lines
482 B
TypeScript

import { editor, space } from "@silverbulletmd/silverbullet/syscalls";
export async function deleteDocument() {
const documentName = await editor.getCurrentPath();
if (
!await editor.confirm(
`Are you sure you would like to delete ${documentName}?`,
)
) {
return;
}
console.log("Navigating to index page");
await editor.navigate({ kind: "page", page: "" });
console.log("Deleting document from space");
await space.deleteDocument(documentName);
}