You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-24 23:26:50 +02:00
Plugins: Added command to export folders and notes
This commit is contained in:
22
packages/app-desktop/commands/exportNotes.ts
Normal file
22
packages/app-desktop/commands/exportNotes.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
|
||||
import InteropService from '@joplin/lib/services/interop/InteropService';
|
||||
import { ExportOptions, FileSystemItem } from '@joplin/lib/services/interop/types';
|
||||
|
||||
export const declaration: CommandDeclaration = {
|
||||
name: 'exportNotes',
|
||||
};
|
||||
|
||||
export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
execute: async (_context: any, noteIds: string[], format: string, targetDirectoryPath: string) => {
|
||||
const exportOptions: ExportOptions = {
|
||||
path: targetDirectoryPath,
|
||||
format: format,
|
||||
target: FileSystemItem.Directory,
|
||||
sourceNoteIds: noteIds,
|
||||
};
|
||||
|
||||
return InteropService.instance().export(exportOptions);
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user