We welcome contributions to the Meilisearch MD plugin! Here's how you can get involved:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript with strict type checking
- Follow the existing code style
- Add JSDoc comments for public methods
- Run linter before committing (
npm run lint:fix) - Write clear, descriptive commit messages, use Conventional Commits style
Before submitting a pull request, please ensure that:
- The plugin builds without errors (
npm run build) - You run the linter and fix any issues (
npm run lint) - The plugin loads correctly in Obsidian
- All functionality works as expected
- The code follows the project and Obsidian guidelines
- Node.js
- npm
- Git
- Meilisearch
- Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Make changes to the source code in the
src/directory. -
The plugin will be automatically compiled to
main.js. -
To test the plugin:
- Copy
main.js,manifest.json, andstyles.cssto your Obsidian vault's plugins folder:<Vault>/.obsidian/plugins/meilisearch-md/ - Reload Obsidian and enable the plugin in Settings → Community plugins
- Copy
meilisearch-md/
├── src/
│ ├── modals/ # UI modal components
│ │ └── SearchModal.ts
│ ├── search/ # Search functionality
│ │ ├── BasicSearchUI.ts
│ │ └── SearchController.ts
│ ├── services/ # Core services
│ │ ├── indexing.ts # Indexing service
│ │ ├── meilisearch.ts # Meilisearch API client
│ │ └── parser.ts # Document parsing
│ ├── settings/ # Settings UI and defaults
│ │ └── ui.ts
│ ├── types.ts # TypeScript type definitions
│ └── utils/ # Utility functions
│ ├── hash.ts # Hash generation
│ └── notifications.ts # Notification helpers
├── main.ts # Plugin entry point
├── manifest.json # Plugin manifest
├── styles.css # Plugin styles
└── package.json # Dependencies and scripts
-
MeilisearchPlugin (
main.ts): Main plugin class that handles lifecycle events and registers commands. -
MeilisearchService (
src/services/meilisearch.ts): Handles communication with the Meilisearch server, including indexing and searching. -
IndexingService (
src/services/indexing.ts): Manages the indexing process, including incremental and full indexing. -
SearchModal (
src/modals/SearchModal.ts): Provides the search UI and handles user interactions. -
SearchController and BasicSearchUI (
src/search/): Handle search logic and UI rendering.
-
Indexing:
- Files are parsed into
DocumentDataobjects - Documents are sent to Meilisearch for indexing
- Metadata is stored locally to track indexed files
- Files are parsed into
-
Searching:
- User enters a query in the search modal
- Query is sent to Meilisearch
- Results are displayed with scoring
- User can click on results to open the corresponding notes
-
Real-time Updates:
- File system events are monitored
- New/modified files are automatically indexed
- Deleted files are removed from the index