MyPlugin
and SampleSettingTab
.main.js
in your repo. Only include it in your releases.fundingUrl
so that users of your plugin can show some support. Learn more..obsidian
folder if you need to access the configuration directory. The location could be customized, so please use Vault.configDir
instead.Please only complete this section if you have isDesktopOnly
set to false in your manifest.
fs
, path
, and electron
.FileSystemAdapter
class.process.platform
, use Obsidian's Platform
instead. Link to API.fetch
or axios.get
, use Obsidian's requestUrl
instead. Link to API.var
. Use let
or const
instead. Learn more.app
instance. Use this.app
provided to your plugin instance instead. Learn more.main.ts
into smaller files or even folders if it gets big to make code easier to find.async
and await
when you can for readability, instead of using Promise
. Learn more.instanceof
before casting into other types such as TFile
, TFolder
, or FileSystemAdapter
, as any
and use proper typing instead.Vault.modify
. If you want to edit the active file, prefer using the Editor
interface. If you want to edit it in the background, use Vault.process
.FileManager.processFrontMatter
. Learn more.vault.delete
to delete files. Use trashFile
instead to make sure the file is deleted according to the users preferences. Learn more.Adapter
API whenever possible. Use Vault
API instead. Learn more.Plugin.loadData()
and Plugin.saveData()
instead.normalizePath()
if you take user defined paths. Learn more.DeferredViews
. Detailed guide.moment
, make sure you're doing import { moment} from 'obsidian'
so that you don't import another copy.main.js
for releasing.workspace.onLayoutReady()
instead of in the constructor or onload()
function. Learn more.<h1>
or <h2>
for setting header. Use Obsidian API instead. Learn more.console.log
unless they are absolutely necessarily. Remove testing console logs that are not needed for production.