Thinks for contributing to obsidian-annotator
and helping make it better!
Feel free to pick up any existing issue that looks interesting to you, or fix a bug you encountered while using obsidian-annotator
. No matter the size, we welcome all improvements.
You'll want to install the following on your machine:
git clone [email protected]:elias-sundqvist/obsidian-annotator.git
git submodule init
git submodule update
Run npm install
to download all necessary dependencies.
- Go to
.\submodules\hypothesis-client-annotator-fork\node_modules\@hypothesis\frontend-build\lib\rollup.js
- Add
import { pathToFileURL } from 'url'
to the top of the file - Replace
import(resolve(path))
withimport(pathToFileURL(resolve(path)))
- Go to
.\submodules\hypothesis-client-annotator-fork\node_modules\@hypothesis\frontend-build\lib\manifest.js
- modify line 46 to say.
const relativePath = path.relative(manifestDir, file).replace("\\","/");
npm run build
– buildshypothesis
submodule andobsidian-annotator
npm run quick-build
– builds onlyobsidian-annotator
npm run build-hypothesis
- build onlyhypothesis
submodule
npm run dev
recommended for active development. It builds obsidian-annotator
on every change of code.
Project use betterer
to improve code step by step. Please run npm run betterer
from time to time to see if your changes made code better or worse.
When you made an improvement, run npm run betterer -- --update
to update betterer results.
Known problem: Sometime betterer makes warnings about code you didn't change. In this case, run npm run betterer -- --update
to ignore this warnings.
There are two ways to hot reload the plugin during development: automatically and semi-automatically.
How to build, install and reload plugin in your test vault on every change:
- Install Hot reload plugin manually and enable it
- Link repository as plugin into your test vault.
<test vault path>/.obsidian/plugins/obsidian-annotator
should refer to directory with repository - Run
npm run dev
How to build and install plugin on every change with manual reload:
- Create plugin's directory in your test vault. Exmaple:
<test vault path>/.obsidian/plugins/obsidian-annotator
- Write absolute path to plugin's directory
.vault_plugin_dir
file - Run
npm run dev
to build and copy plugin into you test vault on every change - Reopen your test vault or disable/enable plugin to see changes
Fork this repository, create a topic branch, and when ready, open a pull request from your fork.