1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00

Compare commits

...

7 Commits

3 changed files with 42 additions and 22 deletions

View File

@@ -403,6 +403,7 @@ function useMenu(props: Props) {
label: module.fullLabel(moduleSource), label: module.fullLabel(moduleSource),
click: () => onImportModuleClickRef.current(module, moduleSource), click: () => onImportModuleClickRef.current(module, moduleSource),
}); });
if (module.separatorAfter) importItems.push({ type: 'separator' });
} }
} }
} }

View File

@@ -59,6 +59,39 @@ export default class InteropService {
description: _('Joplin Export File'), description: _('Joplin Export File'),
}, () => new InteropService_Importer_Jex()), }, () => new InteropService_Importer_Jex()),
makeImportModule({
format: 'raw',
sources: [FileSystemItem.Directory],
description: _('Joplin Export Directory'),
separatorAfter: true,
}, () => new InteropService_Importer_Raw()),
makeImportModule({
format: 'enex',
fileExtensions: ['enex'],
sources: [FileSystemItem.File],
description: _('Evernote Export File (as HTML)'),
supportsMobile: false,
outputFormat: ImportModuleOutputFormat.Html,
}, dynamicRequireModuleFactory('./InteropService_Importer_EnexToHtml')),
makeImportModule({
format: 'enex',
fileExtensions: ['enex'],
sources: [FileSystemItem.File],
description: _('Evernote Export File (as Markdown)'),
supportsMobile: false,
isDefault: true,
}, dynamicRequireModuleFactory('./InteropService_Importer_EnexToMd')),
makeImportModule({
format: 'html',
fileExtensions: ['html'],
sources: [FileSystemItem.File, FileSystemItem.Directory],
isNoteArchive: false, // Tells whether the file can contain multiple notes (eg. Enex or Jex format)
description: _('HTML document'),
}, () => new InteropService_Importer_Md()),
makeImportModule({ makeImportModule({
format: 'md', format: 'md',
fileExtensions: ['md', 'markdown', 'txt', 'html'], fileExtensions: ['md', 'markdown', 'txt', 'html'],
@@ -76,28 +109,12 @@ export default class InteropService {
}, () => new InteropService_Importer_Md_frontmatter()), }, () => new InteropService_Importer_Md_frontmatter()),
makeImportModule({ makeImportModule({
format: 'raw', format: 'txt',
sources: [FileSystemItem.Directory], fileExtensions: ['txt'],
description: _('Joplin Export Directory'), sources: [FileSystemItem.File, FileSystemItem.Directory],
}, () => new InteropService_Importer_Raw()), isNoteArchive: false, // Tells whether the file can contain multiple notes (eg. Enex or Jex format)
description: _('Text document'),
makeImportModule({ }, () => new InteropService_Importer_Md()),
format: 'enex',
fileExtensions: ['enex'],
sources: [FileSystemItem.File],
description: _('Evernote Export File (as Markdown)'),
supportsMobile: false,
isDefault: true,
}, dynamicRequireModuleFactory('./InteropService_Importer_EnexToMd')),
makeImportModule({
format: 'enex',
fileExtensions: ['enex'],
sources: [FileSystemItem.File],
description: _('Evernote Export File (as HTML)'),
supportsMobile: false,
outputFormat: ImportModuleOutputFormat.Html,
}, dynamicRequireModuleFactory('./InteropService_Importer_EnexToHtml')),
]; ];
const exportModules = [ const exportModules = [

View File

@@ -10,6 +10,7 @@ interface BaseMetadata {
fileExtensions: string[]; fileExtensions: string[];
description: string; description: string;
isDefault: boolean; isDefault: boolean;
separatorAfter: boolean; // this isn't a property of the importer, but of how it should be displayed in the GUI
supportsMobile: boolean; supportsMobile: boolean;
@@ -51,6 +52,7 @@ const defaultBaseMetadata = {
isNoteArchive: true, isNoteArchive: true,
supportsMobile: true, supportsMobile: true,
isDefault: false, isDefault: false,
separatorAfter: false,
}; };
const moduleFullLabel = (metadata: ImportMetadata|ExportMetadata, moduleSource: FileSystemItem = null) => { const moduleFullLabel = (metadata: ImportMetadata|ExportMetadata, moduleSource: FileSystemItem = null) => {