You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To test the generator for development purposes, follow the instructions there: https://yeoman.io/authoring/#running-the-generator
23
-
This is a template to create a new Joplin plugin.
24
-
25
20
## Structure
26
21
27
22
The main two files you will want to look at are:
@@ -39,6 +34,10 @@ To build the plugin, simply run `npm run dist`.
39
34
40
35
The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.
41
36
37
+
## Updating the manifest version number
38
+
39
+
You can run `npm run updateVersion` to bump the patch part of the version number, so for example 1.0.3 will become 1.0.4. This script will update both the package.json and manifest.json version numbers so as to keep them in sync.
40
+
42
41
## Publishing the plugin
43
42
44
43
To publish the plugin, add it to npmjs.com by running `npm publish`. Later on, a script will pick up your plugin and add it automatically to the Joplin plugin repository as long as the package satisfies these conditions:
@@ -57,6 +56,13 @@ In general this command tries to do the right thing - in particular it's going t
57
56
58
57
The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file.
59
58
59
+
### Simple backup changes to `webpack.config.js`
60
+
61
+
To support including `7zip-bin` in the plugin's built `.jpl` file, the following changes are made:
62
+
63
+
- Added `node: { __dirname: 'mock' },` to the plugin `baseConfig`. This causes `7zip-bin` to return a more correct path to `7za` (e.g. `/linux/x64/7za` instead of `/tmp/.mount_Joplin/resources/app.asar/services/plugins/linux/x64/7za`).
64
+
- Added a `new CopyPlugin({ ... })` to `pluginConfig`'s `plugins` object to copy `7zip-bin` from `node_modules` to the `dist` directory.
65
+
60
66
## External script files
61
67
62
68
By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases:
@@ -67,6 +73,13 @@ By default, the compiler (webpack) is going to compile `src/index.ts` only (as w
67
73
68
74
To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file.
Copy file name to clipboardExpand all lines: api/JoplinData.d.ts
+25-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
import{ModelType}from'../../../BaseModel';
2
+
importPluginfrom'../Plugin';
2
3
import{Path}from'./types';
3
4
/**
4
-
* This module provides access to the Joplin data API: https://joplinapp.org/api/references/rest_api/
5
+
* This module provides access to the Joplin data API: https://joplinapp.org/help/api/references/rest_api
5
6
* This is the main way to retrieve data, such as notes, notebooks, tags, etc.
6
7
* or to update them or delete them.
7
8
*
@@ -17,7 +18,7 @@ import { Path } from './types';
17
18
* * `data`: (Optional) Applies to PUT and POST calls only. The request body contains the data you want to create or modify, for example the content of a note or folder.
18
19
* * `files`: (Optional) Used to create new resources and associate them with files.
19
20
*
20
-
* Please refer to the [Joplin API documentation](https://joplinapp.org/api/references/rest_api/) for complete details about each call. As the plugin runs within the Joplin application **you do not need an authorisation token** to use this API.
21
+
* Please refer to the [Joplin API documentation](https://joplinapp.org/help/api/references/rest_api) for complete details about each call. As the plugin runs within the Joplin application **you do not need an authorisation token** to use this API.
21
22
*
22
23
* For example:
23
24
*
@@ -39,6 +40,8 @@ import { Path } from './types';
39
40
exportdefaultclassJoplinData{
40
41
privateapi_;
41
42
privatepathSegmentRegex_;
43
+
privateplugin;
44
+
constructor(plugin: Plugin);
42
45
privateserializeApiBody;
43
46
privatepathToString;
44
47
get(path: Path,query?: any): Promise<any>;
@@ -47,4 +50,24 @@ export default class JoplinData {
* See the documentation of the [[ExportModule]] and [[ImportModule]] for more information.
11
11
*
12
-
* You may also want to refer to the Joplin API documentation to see the list of properties for each item (note, notebook, etc.) - https://joplinapp.org/api/references/rest_api/
12
+
* You may also want to refer to the Joplin API documentation to see the list of properties for each item (note, notebook, etc.) - https://joplinapp.org/help/api/references/rest_api
* This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user.
0 commit comments