mirror of
https://github.com/laurent22/joplin.git
synced 2025-04-01 21:24:45 +02:00
388 lines
19 KiB
HTML
388 lines
19 KiB
HTML
<!doctype html>
|
|
<html class="default no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>ExportModule | Joplin Plugin API Documentation</title>
|
|
<meta name="description" content="Documentation for Joplin Plugin API Documentation">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../assets/css/main.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
<input id="tsd-search-field" type="text" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="../classes/joplin.html" class="title">Joplin Plugin API Documentation</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<div id="tsd-filter">
|
|
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
<div class="tsd-filter-group">
|
|
<div class="tsd-select" id="tsd-filter-visibility">
|
|
<span class="tsd-select-label">All</span>
|
|
<ul class="tsd-select-list">
|
|
<li data-value="public">Public</li>
|
|
<li data-value="protected">Public/Protected</li>
|
|
<li data-value="private" class="selected">All</li>
|
|
</ul>
|
|
</div>
|
|
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container">
|
|
<ul class="tsd-breadcrumb">
|
|
<!--
|
|
<li>
|
|
<a href="../globals.html">Globals</a>
|
|
</li>
|
|
-->
|
|
<li>
|
|
<a href="exportmodule.html">ExportModule</a>
|
|
</li>
|
|
</ul>
|
|
<h1><!-- Interface -->ExportModule</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<section class="tsd-panel tsd-comment">
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Used to implement a module to export data from Joplin. <a href="https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/json_export">View the demo plugin</a> for an example.</p>
|
|
</div>
|
|
<p>In general, all the event handlers you'll need to implement take a <code>context</code> 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.</p>
|
|
<p>To get a better sense of what it will contain it can be useful to print it using <code>console.info(context)</code>.</p>
|
|
</div>
|
|
</section>
|
|
<!--
|
|
<section class="tsd-panel tsd-hierarchy">
|
|
<h3>Hierarchy</h3>
|
|
<ul class="tsd-hierarchy">
|
|
<li>
|
|
<span class="target">ExportModule</span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
</section>
|
|
-->
|
|
<section class="tsd-panel-group tsd-index-group">
|
|
<h2>Index</h2>
|
|
<section class="tsd-panel tsd-index-panel">
|
|
<div class="tsd-index-content">
|
|
<section class="tsd-index-section ">
|
|
<h3>Properties</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="exportmodule.html#description" class="tsd-kind-icon">description</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="exportmodule.html#fileextensions" class="tsd-kind-icon">file<wbr>Extensions</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="exportmodule.html#format" class="tsd-kind-icon">format</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="exportmodule.html#isnotearchive" class="tsd-kind-icon">is<wbr>Note<wbr>Archive</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="exportmodule.html#target" class="tsd-kind-icon">target</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Methods</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="exportmodule.html#onclose" class="tsd-kind-icon">on<wbr>Close</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="exportmodule.html#oninit" class="tsd-kind-icon">on<wbr>Init</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="exportmodule.html#onprocessitem" class="tsd-kind-icon">on<wbr>Process<wbr>Item</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="exportmodule.html#onprocessresource" class="tsd-kind-icon">on<wbr>Process<wbr>Resource</a></li>
|
|
</ul>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Properties</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
<a name="description" class="tsd-anchor"></a>
|
|
<h3>description</h3>
|
|
<div class="tsd-signature tsd-kind-icon">description<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>The description that will appear in the UI, for example in the menu item.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
<a name="fileextensions" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagOptional">Optional</span> file<wbr>Extensions</h3>
|
|
<div class="tsd-signature tsd-kind-icon">file<wbr>Extensions<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>The extensions of the files exported by your module. For example, it is <code>["htm", "html"]</code> for the HTML module, and just <code>["jex"]</code> for the JEX module.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
<a name="format" class="tsd-anchor"></a>
|
|
<h3>format</h3>
|
|
<div class="tsd-signature tsd-kind-icon">format<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>The format to be exported, eg "enex", "jex", "json", etc.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
<a name="isnotearchive" class="tsd-anchor"></a>
|
|
<h3>is<wbr>Note<wbr>Archive</h3>
|
|
<div class="tsd-signature tsd-kind-icon">is<wbr>Note<wbr>Archive<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>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.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
|
|
<a name="target" class="tsd-anchor"></a>
|
|
<h3>target</h3>
|
|
<div class="tsd-signature tsd-kind-icon">target<span class="tsd-signature-symbol">:</span> <a href="../enums/filesystemitem.html" class="tsd-signature-type">FileSystemItem</a></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>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.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Methods</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
|
<a name="onclose" class="tsd-anchor"></a>
|
|
<h3>on<wbr>Close</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
<li class="tsd-signature tsd-kind-icon">on<wbr>Close<span class="tsd-signature-symbol">(</span>context<span class="tsd-signature-symbol">: </span><a href="exportcontext.html" class="tsd-signature-type">ExportContext</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Called when the export process is done.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>context: <a href="exportcontext.html" class="tsd-signature-type">ExportContext</a></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
|
<a name="oninit" class="tsd-anchor"></a>
|
|
<h3>on<wbr>Init</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
<li class="tsd-signature tsd-kind-icon">on<wbr>Init<span class="tsd-signature-symbol">(</span>context<span class="tsd-signature-symbol">: </span><a href="exportcontext.html" class="tsd-signature-type">ExportContext</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Called when the export process starts.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>context: <a href="exportcontext.html" class="tsd-signature-type">ExportContext</a></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
|
<a name="onprocessitem" class="tsd-anchor"></a>
|
|
<h3>on<wbr>Process<wbr>Item</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
<li class="tsd-signature tsd-kind-icon">on<wbr>Process<wbr>Item<span class="tsd-signature-symbol">(</span>context<span class="tsd-signature-symbol">: </span><a href="exportcontext.html" class="tsd-signature-type">ExportContext</a>, itemType<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, item<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Called when an item needs to be processed. An "item" can be any Joplin object, such as a note, a folder, a notebook, etc.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>context: <a href="exportcontext.html" class="tsd-signature-type">ExportContext</a></h5>
|
|
</li>
|
|
<li>
|
|
<h5>itemType: <span class="tsd-signature-type">number</span></h5>
|
|
</li>
|
|
<li>
|
|
<h5>item: <span class="tsd-signature-type">any</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
|
|
<a name="onprocessresource" class="tsd-anchor"></a>
|
|
<h3>on<wbr>Process<wbr>Resource</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
<li class="tsd-signature tsd-kind-icon">on<wbr>Process<wbr>Resource<span class="tsd-signature-symbol">(</span>context<span class="tsd-signature-symbol">: </span><a href="exportcontext.html" class="tsd-signature-type">ExportContext</a>, resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, filePath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Called when a resource file needs to be exported.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>context: <a href="exportcontext.html" class="tsd-signature-type">ExportContext</a></h5>
|
|
</li>
|
|
<li>
|
|
<h5>resource: <span class="tsd-signature-type">any</span></h5>
|
|
</li>
|
|
<li>
|
|
<h5>filePath: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<!--
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class="globals ">
|
|
<a href="../globals.html"><em>Globals</em></a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
-->
|
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
<ul class="before-current">
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="current tsd-kind-interface">
|
|
<a href="exportmodule.html" class="tsd-kind-icon">ExportModule</a>
|
|
<ul>
|
|
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#description" class="tsd-kind-icon">description</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#fileextensions" class="tsd-kind-icon">file<wbr>Extensions</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#format" class="tsd-kind-icon">format</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#isnotearchive" class="tsd-kind-icon">is<wbr>Note<wbr>Archive</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#target" class="tsd-kind-icon">target</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#onclose" class="tsd-kind-icon">on<wbr>Close</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#oninit" class="tsd-kind-icon">on<wbr>Init</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#onprocessitem" class="tsd-kind-icon">on<wbr>Process<wbr>Item</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-interface">
|
|
<a href="exportmodule.html#onprocessresource" class="tsd-kind-icon">on<wbr>Process<wbr>Resource</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="after-current">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- JOPLINCHANGE
|
|
<footer class="with-border-bottom">
|
|
<div class="container">
|
|
<h2>Legend</h2>
|
|
<div class="tsd-legend-group">
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<div class="container tsd-generator">
|
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
</div>
|
|
-->
|
|
<div class="overlay"></div>
|
|
<script src="../assets/js/main.js"></script>
|
|
</body>
|
|
</html> |