obsidian-file-suggestion-component
v1.0.0
Published
Provides a popover fuzzy file and folder search helper for input fields in Obsidian.
Downloads
15
Maintainers
Readme
File Suggestion Component for Obsidian Plugins
Provides a text input with on-the-fly file and/or folder suggestions.
Suggestions are scored using its own fuzzy search logic. Scores are based on Damerau-Levenshtein distance between the query and the file/folder name. Multipliers ensure that the suggestions will prioritize names which contain or start with the query string.
Usage
... TODO ...
Development Environment
direnv
There is a direnv
config which can be used to quickly configure a completely isolated local environment. Setting it up requires a few extra steps though.
- Install the Nix package manager:
sh <(curl -L https://nixos.org/nix/install) --no-daemon
- Ensure
flakes
andnix-command
are enabled, eg:mkdir -p ~/.local/nix && echo "experimental-features = nix-command flakes" >> nix.conf
- Install
direnv
, adjusting or removingbin_path
as needed:curl -sfL https://direnv.net/install.sh | bin_path=~/.local/bin bash
direnv
will instruct you to add a line to your.bashrc
, once that's done, rundirenv allow
.
Testing
npm test
Note that Obsidian libraries have to be mocked for Jest to function properly. These are stored in test/__mocks__/obsidian.ts
.
Credits
- Unit tests draw on an English word list created by wordgamedictionary.com.