packages/web/src/routes/docs/contributors/obsidian/+page.md
This page will outline the most important bits of information needed to work on the Harper Obsidian plugin. In addition to that outlined in environment set up page, you'll also need a working Obsidian installation and vault prepared.
All the code for the Obsidian plugin lies in the packages/obsidian-plugin directory of our monorepo.
Obsidian, in the interest of relieving their development team of any overhead, imposes some restrictions on our plugins that make the build and deploy process unusual.
All the executable code for an Obsidian plugin must be contained within a single file. That includes both JavaScript and—in our case—WebAssembly.
This is why the only artifact of the Harper Obsidian plugin build process is a single, heavily minimized main.js file.
All Obsidian plugins are downloaded and installed from the latest release in a dedicated GitHub repository.
Since Harper uses a monorepo, our dedicated GitHub repository is just a skeleton, containing barely more than a plugin manifest and README.md.
PRs for the Obsidian plugin should be submitted to the monorepo. When a release is necessary, Harper maintainers will increment the version in the skeletal repository and create a release.
Obsidian loads its plugins from the dedicated plugin directory inside your vault:
<vault dir>/.obsidian/plugins/<plugin name>
For Harper, this looks exactly as you'd expect:
<vault dir>/.obsidian/plugins/harper
The workflow for quickly iterating on the plugin looks something like this:
just setup && cd packages/obsidian-plugin && pnpm dev.
This will continously rebuild main.js anytime you make a change to a file in the packages/obsidian-plugin directory.manifest.json from the skeletal repo to the dedicated plugin directory shown above.main.js produced by step 1 in the dedicated plugin directory above.Reload app without saving command inside of Obsidian.If you've done everything right, the dedicated plugin directory should contain three files:
main.jsmanifest.jsondata.jsondata.json is a configuration file created and modified by the Harper plugin to persist settings, the user's dictionary and other miscellaneous things.