Development Setup
Auto Tagger is an Obsidian plugin built with TypeScript and bundled with esbuild.Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- An Obsidian vault for testing
Local Development
Link to test vault
Create a symlink from your Obsidian vault’s plugin folder to the development directory:
Start development mode
Run the development build with watch mode:This runs esbuild in watch mode, automatically rebuilding when you save changes.
Build Scripts
The project uses npm scripts defined inpackage.json:
Runs esbuild in watch mode with inline sourcemaps for debugging
Runs TypeScript type checking, then creates a production build with minification and tree-shaking
Project Structure
Key Files
Contains:
AutoTaggerPlugin- Main plugin classAutoTaggerSettings- Settings interfaceAutoTaggerSettingTab- Settings UITagSuggestionModal- Modal for showing all suggestions
Contains:
TagModel- TF-IDF engine and tag suggestion logicTagSuggestion- Tag suggestion data structureModelStats- Statistics about the learned model
TypeScript Configuration
The project uses TypeScript with strict null checks:Build Configuration
The plugin uses esbuild for fast bundling:- Entry point:
src/main.ts - Output:
main.js - Format: CommonJS (required by Obsidian)
- Target: ES2018
- External modules:
obsidian,electron, CodeMirror packages - Development: Inline sourcemaps, watch mode
- Production: Minified, tree-shaken, no sourcemaps
Testing
Currently, testing is manual:- Run
npm run devto start watch mode - Make changes to the source code
- Reload the plugin in Obsidian
- Test with a vault that has existing tags
Testing Checklist
- Vault scanning on startup
- Real-time suggestions while typing
- Tag insertion in all three modes (first-line, frontmatter, inline-end)
- Settings UI and persistence
- Rescan vault command
- Manual suggest command
- Tag extraction from both inline tags and frontmatter
Contributing Guidelines
Code Style
- Use TypeScript with strict type checking
- Follow the existing code structure
- Add comments for complex logic (especially in TF-IDF calculations)
- Use descriptive variable names
Before Submitting
Areas for Contribution
- Performance: Optimize scanning for large vaults (10k+ notes)
- UI/UX: Improve suggestion display and interaction
- Algorithms: Enhance tag suggestion accuracy
- Testing: Add automated tests for the model
- Internationalization: Support for more languages in tokenization
- Documentation: Improve user guides and API docs
License
Auto Tagger is licensed under the MIT License:Getting Help
If you need help with development:- Check the Obsidian plugin development documentation
- Review the source code comments
- Open an issue on the GitHub repository