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
Copy file name to clipboardExpand all lines: GENERATOR_DOC.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,22 @@
1
-
# generator-joplin
1
+
# Plugin development
2
2
3
-
Scaffolds out a new Joplin plugin
3
+
This documentation describes how to create a plugin, and how to work with the plugin builder framework and API.
4
4
5
5
## Installation
6
6
7
7
First, install [Yeoman](http://yeoman.io) and generator-joplin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
8
8
9
9
```bash
10
-
npm install -g yo
10
+
npm install -g yo@4.3.1
11
11
npm install -g generator-joplin
12
12
```
13
13
14
14
Then generate your new project:
15
15
16
16
```bash
17
-
yo joplin
17
+
yo --node-package-manager npm joplin
18
18
```
19
19
20
-
## Development
21
-
22
-
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:
@@ -67,6 +66,13 @@ By default, the compiler (webpack) is going to compile `src/index.ts` only (as w
67
66
68
67
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-2Lines changed: 25 additions & 2 deletions
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