Obsidian Front Matter Title Plugin Api Provider
This package provide some functions to get API from to resolve file titles
by Front Matter Title which is required to be installed
Documentation
Get API
import {App} from "obsidian";
import {getApi, isPluginEnabled, PluginNotEnabledError} from "obsidian-front-matter-plugin-api-provider";
const app: App = null;
try {
const api = isPluginEnabled(app) ? getApi() : null;
const title = api.resolveSync('/path/to/file.md');
api.resolve('/path/to/file.md')
.then(title => doSomething(title))
.catch(console.error)
} catch (e) {
if (e instanceof PluginNotEnabledError) {
}
}
Get Lazy Api
Lazy Api provides an object which checks all itself and catch PluginNotEnabledError. It checks all before each resolve
import {App} from "obsidian";
import {getApiLazy, isPluginEnabled, PluginNotEnabledError} from "obsidian-front-matter-plugin-api-provider";
const app: App = null;
const api = getApiLazy(app);
const title = api.resolveSync('/path/to/file.md');
api.resolve('/path/to/file.md')
.then(title => doSomething(title))
.catch(console.error)