You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
All: Add support for application plugins (#3257)
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
import { ImportExportResult } from './types';
|
||||
|
||||
const InteropService_Importer_Base = require('lib/services/interop/InteropService_Importer_Base').default;
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
|
||||
export default class InteropService_Importer_EnexToHtml extends InteropService_Importer_Base {
|
||||
async exec(result:ImportExportResult) {
|
||||
const { importEnex } = require('lib/import-enex');
|
||||
|
||||
let folder = this.options_.destinationFolder;
|
||||
|
||||
if (!folder) {
|
||||
const folderTitle = await Folder.findUniqueItemTitle(filename(this.sourcePath_));
|
||||
folder = await Folder.save({ title: folderTitle });
|
||||
}
|
||||
|
||||
await importEnex(folder.id, this.sourcePath_, { ...this.options_, outputFormat: 'html' });
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user