joplin-plugin-shared-attachments
v1.0.0
Published
Automatically moves attachments to a shared folder and updates links.
Downloads
1,199
Readme
Joplin Shared Attachments Plugin
This plugin automatically moves file attachments to a shared network folder (or any local folder) and updates the links in your notes to point to that shared location. This is useful for teams sharing a notebook where everyone has access to the same network drive.
Features
- Automatic Interception: Detects when you attach a file to a note.
- Shared Storage: Copies the file to a configured Shared Path.
- Link Update: Replaces the internal
(:/resource_id)link with afile://link to the shared location. - Subfolders: Optionally organizes files into
YYYY/MMfolders. - Conflict Handling: Renames files if a file with the same name already exists.
Installation
Development / Testing
- Open Joplin.
- Go to Tools > Options > Plugins (Windows/Linux) or Joplin > Settings > Plugins (macOS).
- Click Manage your plugins.
- Check Enable development plugins.
- Click Load unpacked plugin and select the
distfolder in this project.
Production
To create a .jpl file for distribution:
- Run
npm run dist. - Zip the contents of the
distfolder into a file namedjoplin-shared-attachments.jpl. - Install via Install from file.
Configuration
After installation:
- Go to Tools > Options > Shared Attachments.
- Shared Folder Path: Enter the path where attachments should be stored.
- Windows UNC:
\\Server\Share\Attachments - Local:
C:\Users\Public\Documents - macOS/Linux:
/mnt/server/attachments
- Windows UNC:
- Use Subfolders: Check to organize by date (default: true).
Development
Building
Install Dependencies:
npm installBuild:
npm run distThis creates a
.jplfile in thepublishdirectory (ordistdepending on config).
Architecture
src/index.ts: Entry point. Listens foronNoteChange, scans for resource links, extracts files, and updates links.src/utils/files.ts: Handles file system operations (copying, ensuring directories, generated file URLs).
