Skip to content

Documentation / jpl-vite / api / ExportModule

Interface: ExportModule ​

Defined in: joplin-plugin-api/dist/types.d.ts:65

Used to implement a module to export data from Joplin. View the demo plugin for an example.

In general, all the event handlers you'll need to implement take a context object as a first argument. This object will contain the export or import path as well as various optional properties, such as which notes or notebooks need to be exported.

To get a better sense of what it will contain it can be useful to print it using console.info(context).

Properties ​

description ​

description: string

Defined in: joplin-plugin-api/dist/types.d.ts:73

The description that will appear in the UI, for example in the menu item.


fileExtensions? ​

optional fileExtensions: string[]

Defined in: joplin-plugin-api/dist/types.d.ts:87

The extensions of the files exported by your module. For example, it is ["htm", "html"] for the HTML module, and just ["jex"] for the JEX module.


format ​

format: string

Defined in: joplin-plugin-api/dist/types.d.ts:69

The format to be exported, eg "enex", "jex", "json", etc.


isNoteArchive ​

isNoteArchive: boolean

Defined in: joplin-plugin-api/dist/types.d.ts:83

Only applies to single file exporters or importers It tells whether the format can package multiple notes into one file. For example JEX or ENEX can, but HTML cannot.


target ​

target: FileSystemItem

Defined in: joplin-plugin-api/dist/types.d.ts:77

Whether the module will export a single file or multiple files in a directory. It affects the open dialog that will be presented to the user when using your exporter.

Methods ​

onClose() ​

onClose(context): Promise<void>

Defined in: joplin-plugin-api/dist/types.d.ts:103

Called when the export process is done.

Parameters ​

context ​

ExportContext

Returns ​

Promise<void>


onInit() ​

onInit(context): Promise<void>

Defined in: joplin-plugin-api/dist/types.d.ts:91

Called when the export process starts.

Parameters ​

context ​

ExportContext

Returns ​

Promise<void>


onProcessItem() ​

onProcessItem(context, itemType, item): Promise<void>

Defined in: joplin-plugin-api/dist/types.d.ts:95

Called when an item needs to be processed. An "item" can be any Joplin object, such as a note, a folder, a notebook, etc.

Parameters ​

context ​

ExportContext

itemType ​

number

item ​

any

Returns ​

Promise<void>


onProcessResource() ​

onProcessResource(context, resource, filePath): Promise<void>

Defined in: joplin-plugin-api/dist/types.d.ts:99

Called when a resource file needs to be exported.

Parameters ​

context ​

ExportContext

resource ​

any

filePath ​

string

Returns ​

Promise<void>

Released under the MIT License.