Problem Statement
As Obsidian is getting more and more powerful, its now possible to view different kinds of files inside Obsidian. It will be great, if we can also embed these different files inside our notes and render them as they usually render in their custom view/leaf.
Right now this is possible to achieve in our plugins using “unofficial” method/APIs. We can implement it something like this :
import { EmbedRegistry } from "obsidian-typings";
const embedRegistry = this.app.embedRegistry as EmbedRegistry;
if (
!embedRegistry?.isExtensionRegistered(TASKBOARD_FILE_EXTENSION)
) {
embedRegistry?.registerExtension(
TASKBOARD_FILE_EXTENSION,
(context, file, subPath) => {
return new TaskBoardEmbedComponent(
context.containerEl,
this,
file,
context.containerEl.getAttr("alt") || undefined,
);
},
);
}
Possible Solution
It will be nice if Obsidian can provide an official API for this which will make it much easier to integrate this feature inside plugins.