1.0.0 • Published 2 years ago
obsidian-file-suggestion-component v1.0.0
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
flakesandnix-commandare enabled, eg:mkdir -p ~/.local/nix && echo "experimental-features = nix-command flakes" >> nix.conf - Install
direnv, adjusting or removingbin_pathas needed:curl -sfL https://direnv.net/install.sh | bin_path=~/.local/bin bash direnvwill instruct you to add a line to your.bashrc, once that's done, rundirenv allow.
Testing
npm testNote 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.
License
1.0.0
2 years ago