mirror of
https://github.com/mnaoumov/obsidian-insert-multiple-attachments.git
synced 2026-07-22 11:30:26 +00:00
3 KiB
3 KiB
AGENTS.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
Insert Multiple Attachments is an Obsidian plugin that allows inserting multiple attachments at a time, extending the built-in Insert Attachment command to support selecting several files at once. It is built on obsidian-dev-utils.
Commands
| Task | Command |
|---|---|
| TypeScript check | npm run build:compile |
| Build | npm run build |
| Dev (watch) | npm run dev |
| Lint | npm run lint |
| Lint (fix) | npm run lint:fix |
| Format | npm run format |
| Format (check) | npm run format:check |
| Spellcheck | npm run spellcheck |
| Markdown lint | npm run lint:md |
| Markdown lint fix | npm run lint:md:fix |
| Unit tests | npm test |
| Coverage | npm run test:coverage |
| Integration tests | npm run test:integration |
| Commit (wizard) | npm run commit |
Architecture
- Root config files are thin re-exports — actual logic lives in
scripts/(eslint.config.mts→scripts/eslint-config.ts, etc.). src/— plugin source:main.ts— Obsidian entry point; imports the SCSS and default-exports thePluginclass.plugin.ts—Plugin extends PluginBase;onloadImplwires up the settings component and settings tab, then registers theInvokeCommandHandlervia the base-providedthis.commandHandlerComponent(the active-file provider, command registrar, and menu-event registrar are owned byPluginBasesince obsidian-dev-utils 86.0.0).plugin-settings.ts—PluginSettingsdata class:attachmentLinksPrefix,attachmentLinksDelimiter(default\n\n),attachmentLinksSuffix.plugin-settings-component.ts—PluginSettingsComponent extends PluginSettingsComponentBase; registers a legacy-settings converter mapping the oldshouldInsertDoubleLinesBetweenAttachmentLinksflag to a delimiter.plugin-settings-tab.ts—PluginSettingsTab extends PluginSettingsTabBase; renders prefix/delimiter/suffix text settings with whitespace visualized as␣/↵via value converters.insert-attachments-control.ts—InsertAttachmentsControl: creates a hidden multi-file<input>, saves each chosen file viaapp.saveAttachment, builds embed markdown links, and inserts them into the editor joined by the configured prefix/delimiter/suffix.command-handlers/invoke-command-handler.ts—InvokeCommandHandler extends EditorCommandHandler(idinvoke, iconlucide-paperclip);executeEditorinstantiatesInsertAttachmentsControl.styles/main.scss— plugin styles;styles/scss.d.ts— SCSS module type declaration.
mainfield points tosrc/main.ts(Obsidian plugin source entry; built artifact isdist/build/main.js, not published to npm).