Fixes #129: add "attachment" query source (#239)

This commit is contained in:
Evgenii Karagodin
2022-12-28 08:51:55 +01:00
committed by GitHub
parent d41b146c51
commit a2ff27f511
4 changed files with 21 additions and 5 deletions
+7
View File
@@ -0,0 +1,7 @@
import { QueryProviderEvent } from "$sb/app_event.ts";
import { applyQuery } from "$sb/lib/query.ts";
import { space } from "$sb/silverbullet-syscall/mod.ts";
export async function attachmentQueryProvider({ query }: QueryProviderEvent) {
return applyQuery(query, await space.listAttachments());
}
+6
View File
@@ -66,6 +66,12 @@ functions:
command:
name: "Editor: Toggle Read Only Mode"
# Attachments
attachmentQueryProvider:
path: ./attachment.ts:attachmentQueryProvider
events:
- query:attachment
# Backlinks
indexLinks:
path: "./page.ts:indexLinks"