Changelog
v1.7.2 (Insider)
Plugin#onUserEnable
gives you a place to performance one-time initialize after the user installs and enables your plugin. If your plugin has a custom view, this is a good place to initialize it rather than recreating the view in Plugin#onload
.Workspace#ensureSideLeaf
is now public. This function is a shorthand way to create a leaf in the sidebar if one does not already exist.WorkspaceLeaf#isDeferred
and WorkspaceLeaf#loadIfDeferred
. As of Obsidian v1.7.2, Obsidian will now defer tabs by default. We published a guide on how to handle deferred views in the developer docs.We've updated the API to prefer unknown
to any
. Using any
causes Typescript to disable typechecking entirely on the returned value, so this change could uncover some hidden typing issues.
We also removed prepareQuery
, fuzzySearch
, and PreparedQuery
from the API. If your plugin is using one of these functions, you should migrate to prepareFuzzySearch
.
// Old
let pq: PreparedQuery = prepareQuery(q);
...
fuzzySearch(pq, text);
// New
let fuzzy = prepareFuzzySearch(q);
...
fuzzy(text);
Plugin#removeCommand
is now available if your plugin needs to dynamically remove commands (for example, if your plugin allows for user-created commands).SuggestModal#selectActiveSuggestion
is now public. This is useful to provide an alternative hotkey to your SuggestModal that still triggers the selected item.Changelog
v1.5.7
Plugin#onExternalSettingsChange
There's a new callback function for plugins to react to when plugin settings (data.json
) get changed on disk. This callback can be used to reload settings when they are updated by an external application or when the settings get synced using a file syncing service like Obsidian Sync.
Vault#getFileByPath
and Vault#getFolderByPath
utility functionsThe getAbstractFileByPath
has long been a point of confusion with plugin developers. More often than not,
you are looking for either a file or a folder. And you know which you want at call-time. Instead of using
getAbstractFileByPath
then checking if the result is an instance of TFile
or TFolder
, now you can just
use getFileByPath
or getFolderByPath
to automatically do this check.
Changelog
v1.4.4
We've exposed our helper function for setting tooltips on elements (setTooltip
) as well as added a new progress bar component.
The FileManager#processFrontMatter
function now also exposes the DataWriteOptions argument to be consistent with the other process
and write
functions.
Changelog
v1.4.0
We've made some changes to CachedMetadata
to support Properties. FrontMatterCache
is now no longer a CacheItem
—meaning that it doesn't have a position. Instead, is it a Reference.
Another big change in v.1.4 is that frontmatter now supports wikilinks. If a value in the frontmatter can be interpreted as a link, it will be cached inside CachedMetadata.frontmatterLinks
.