diff --git a/main.ts b/main.ts index 8bcc29b..0cb360d 100644 --- a/main.ts +++ b/main.ts @@ -24,6 +24,21 @@ export default class ContexterPlugin extends Plugin { callback: () => void this.activateProjectView(), }); + this.registerObsidianProtocolHandler("contexter", async (params) => { + const project = params.project; + if (!project) { + await this.activateProjectView(); + return; + } + const leaf = this.app.workspace.getLeaf(false); + await leaf.setViewState({ + type: VIEW_TYPE_PROJECT_DETAILS_VIEW, + active: true, + state: { project }, + }); + this.app.workspace.revealLeaf(leaf); + }); + if (Platform.isMobile) { const reattach = () => this.reattachMobileBreadcrumbs(); this.registerEvent(