1
0
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:
Laurent Cozic
2020-11-17 14:50:28 +00:00
parent eb8284ecdb
commit 4e08adb76f
10 changed files with 108 additions and 30 deletions

View 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);
},
};
};