-
-
-
-
Applications
- -
- -
-
Support
- -
- -
-
Development
- -
- -
-
Google Summer of Code 2020
- -
- -
-
About
- -
-
Get startedπ
-In this article you will learn the basic steps to build and test a plugin in Joplin.
-##Β Setting up your environment
-First you need to setup your environment:
- -You will also need to have Joplin installed and running in development mode, which we'll describe later.
-But first install Yeoman and the Joplin Plugin Generator:
-npm install -g yo generator-joplin
-
-Then to create the plugin, run:
-yo joplin
-
-This will create the basic scafolding of the plugin. At the root of it, there is a number of configuration files which you normally won't need to change. Then the src/
directory will contain your code. By default, the project uses TypeScript, but you are free to use plain JavaScript too - eventually the project is compiled to plain JS in any case.
The src/
directory also contains a manifest.json file, which you can edit to set various information about the plugin, such as its name, homepage URL, etc.
Building the pluginπ
-The file src/index.ts
already contain some basic code meant for testing the plugin. In particular it contains a call to joplin.plugins.register, which all plugins should call to register the plugin. And an onStart event handler, which will be executed by Joplin when the plugin starts.
To try this basic plugin, compile the app by running the following from the root of the project:
-npm run dist
-
-Doing so should compile all the files into the dist/
directory. This is from here that Joplin will load the plugin.
Testing the pluginπ
-In order to test the plugin, you might want to run Joplin in Development Mode. Doing so means that Joplin will run using a different profile, so you can experiment with the plugin without risking to accidentally change or delete your data.
-Finally, in order to test the plugin, open the Setting screen, then navigate the the Plugins section, and add the plugin path in the Development plugins text field. For example, if your plugin project path is /home/user/src/joplin-plugin
, add this in the text field.
Restart the app, and Joplin should load the plugin and execute its onStart
handler. If all went well you should see the test message: "Test plugin started".
Next stepsπ
--
-
- You might want to check the Table of content plugin tutorial to get a good overview of how to create a complete plugin and how to use the plugin API. -
- For more information about the plugin API, check the Plugin API reference. -
-
-
-
-
Applications
- -
- -
-
Support
- -
- -
-
Development
- -
- -
-
Google Summer of Code 2020
- -
- -
-
About
- -
-
Joplin APIπ
-In order to use it, you'll first need to find on which port the service is running. To do so, open the Web Clipper Options in Joplin and if the service is running it should tell you on which port. Normally it runs on port 41184. If you want to find it programmatically, you may follow this kind of algorithm:
-let port = null;
-for (let portToTest = 41184; portToTest <= 41194; portToTest++) {
- const result = pingPort(portToTest); // Call GET /ping
- if (result == 'JoplinClipperServer') {
- port = portToTest; // Found the port
- break;
- }
-}
-
-Authorisationπ
-To prevent unauthorised applications from accessing the API, the calls must be authentified. To do so, you must provide a token as a query parameter for each API call. You can get this token from the Joplin desktop application, on the Web Clipper Options screen.
-This would be an example of valid cURL call using a token:
-curl http://localhost:41184/notes?token=ABCD123ABCD123ABCD123ABCD123ABCD123
-
-In the documentation below, the token will not be specified every time however you will need to include it.
-Using the APIπ
-All the calls, unless noted otherwise, receives and send JSON data. For example to create a new note:
-curl --data '{ "title": "My note", "body": "Some note in **Markdown**"}' http://localhost:41184/notes
-
-In the documentation below, the calls may include special parameters such as :id or :note_id. You would replace this with the item ID or note ID.
-For example, for the endpoint DELETE /tags/:id/notes/:note_id
, to remove the tag with ID "ABCD1234" from the note with ID "EFGH789", you would run for example:
curl -X DELETE http://localhost:41184/tags/ABCD1234/notes/EFGH789
-
-The four verbs supported by the API are the following ones:
--
-
- GET: To retrieve items (notes, notebooks, etc.). -
- POST: To create new items. In general most item properties are optional. If you omit any, a default value will be used. -
- PUT: To update an item. Note in a REST API, traditionally PUT is used to completely replace an item, however in this API it will only replace the properties that are provided. For example if you PUT {"title": "my new title"}, only the "title" property will be changed. The other properties will be left untouched (they won't be cleared nor changed). -
- DELETE: To delete items. -
Filtering dataπ
-You can change the fields that will be returned by the API using the fields=
query parameter, which takes a list of comma separated fields. For example, to get the longitude and latitude of a note, use this:
curl http://localhost:41184/notes/ABCD123?fields=longitude,latitude
-
-To get the IDs only of all the tags:
-curl http://localhost:41184/tags?fields=id
-
-Error handlingπ
-In case of an error, an HTTP status code >= 400 will be returned along with a JSON object that provides more info about the error. The JSON object is in the format { "error": "description of error" }
.
About the property typesπ
--
-
- Text is UTF-8. -
- All date/time are Unix timestamps in milliseconds. -
- Booleans are integer values 0 or 1. -
Testing if the service is availableπ
-Call GET /ping to check if the service is available. It should return "JoplinClipperServer" if it works.
-Searchingπ
-Call GET /search?query=YOUR_QUERY to search for notes. This end-point supports the field
parameter which is recommended to use so that you only get the data that you need. The query syntax is as described in the main documentation: https://joplinapp.org/#searching
To retrieve non-notes items, such as notebooks or tags, add a type
parameter and set it to the required item type name. In that case, full text search will not be used - instead it will be a simple case-insensitive search. You can also use *
as a wildcard. This is convenient for example to retrieve notebooks or tags by title.
For example, to retrieve the notebook named recipes
: GET /search?query=recipes&type=folder
To retrieve all the tags that start with project-
: GET /search?query=project-*&type=tag
Item type IDsπ
-Item type IDs might be refered to in certain object you will retrieve from the API. This is the correspondance between name and ID:
-Name | -Value | -
---|---|
note | -1 | -
folder | -2 | -
setting | -3 | -
resource | -4 | -
tag | -5 | -
note_tag | -6 | -
search | -7 | -
alarm | -8 | -
master_key | -9 | -
item_change | -10 | -
note_resource | -11 | -
resource_local_state | -12 | -
revision | -13 | -
migration | -14 | -
smart_filter | -15 | -
Notesπ
-Propertiesπ
-Name | -Type | -Description | -
---|---|---|
id | -text | -- |
parent_id | -text | -ID of the notebook that contains this note. Change this ID to move the note to a different notebook. | -
title | -text | -The note title. | -
body | -text | -The note body, in Markdown. May also contain HTML. | -
created_time | -int | -When the note was created. | -
updated_time | -int | -When the note was last updated. | -
is_conflict | -int | -Tells whether the note is a conflict or not. | -
latitude | -numeric | -- |
longitude | -numeric | -- |
altitude | -numeric | -- |
author | -text | -- |
source_url | -text | -The full URL where the note comes from. | -
is_todo | -int | -Tells whether this note is a todo or not. | -
todo_due | -int | -When the todo is due. An alarm will be triggered on that date. | -
todo_completed | -int | -Tells whether todo is completed or not. This is a timestamp in milliseconds. | -
source | -text | -- |
source_application | -text | -- |
application_data | -text | -- |
order | -numeric | -- |
user_created_time | -int | -When the note was created. It may differ from created_time as it can be manually set by the user. | -
user_updated_time | -int | -When the note was last updated. It may differ from updated_time as it can be manually set by the user. | -
encryption_cipher_text | -text | -- |
encryption_applied | -int | -- |
markup_language | -int | -- |
is_shared | -int | -- |
body_html | -text | -Note body, in HTML format | -
base_url | -text | -If body_html is provided and contains relative URLs, provide the base_url parameter too so that all the URLs can be converted to absolute ones. The base URL is basically where the HTML was fetched from, minus the query (everything after the '?'). For example if the original page was https://stackoverflow.com/search?q=%5Bjava%5D+test , the base URL is https://stackoverflow.com/search . |
-
image_data_url | -text | -An image to attach to the note, in Data URL format. | -
crop_rect | -text | -If an image is provided, you can also specify an optional rectangle that will be used to crop the image. In format { x: x, y: y, width: width, height: height } |
-
GET /notesπ
-Gets all notes
-GET /notes/:idπ
-Gets note with ID :id
-GET /notes/:id/tagsπ
-Gets all the tags attached to this note.
-GET /notes/:id/resourcesπ
-Gets all the resources attached to this note.
-POST /notesπ
-Creates a new note
-You can either specify the note body as Markdown by setting the body
parameter, or in HTML by setting the body_html
.
Examples:
--
-
-
-
Create a note from some Markdown text
-
-curl --data '{ "title": "My note", "body": "Some note in **Markdown**"}' http://127.0.0.1:41184/notes -
- -
-
Create a note from some HTML
-
-curl --data '{ "title": "My note", "body_html": "Some note in <b>HTML</b>"}' http://127.0.0.1:41184/notes -
- -
-
Create a note and attach an image to it:
-
-curl --data '{ "title": "Image test", "body": "Here is Joplin icon:", "image_data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUeNoAyAA3/wFwtO3K6gUB/vz2+Prw9fj/+/r+/wBZKAAExOgF4/MC9ff+MRH6Ui4E+/0Bqc/zutj6AgT+/Pz7+vv7++nu82c4DlMqCvLs8goA/gL8/fz09fb59vXa6vzZ6vjT5fbn6voD/fwC8vX4UiT9Zi//APHyAP8ACgUBAPv5APz7BPj2+DIaC2o3E+3o6ywaC5fT6gD6/QD9/QEVf9kD+/dcLQgJA/7v8vqfwOf18wA1IAIEVycAyt//v9XvAPv7APz8LhoIAPz9Ri4OAgwARgx4W/6fVeEAAAAASUVORK5CYII="}' http://127.0.0.1:41184/notes -
-
Creating a note with a specific IDπ
-When a new note is created, it is automatically assigned a new unique ID so normally you do not need to set the ID. However, if for some reason you want to set it, you can supply it as the id
property. It needs to be a 32 characters long string in hexadecimal. Make sure it is unique, for example by generating it using whatever GUID function is available in your programming language.
curl --data '{ "id": "00a87474082744c1a8515da6aa5792d2", "title": "My note with custom ID"}' http://127.0.0.1:41184/notes
-
-PUT /notes/:idπ
-Sets the properties of the note with ID :id
-DELETE /notes/:idπ
-Deletes the note with ID :id
-Foldersπ
-This is actually a notebook. Internally notebooks are called "folders".
-Propertiesπ
-Name | -Type | -Description | -
---|---|---|
id | -text | -- |
title | -text | -The folder title. | -
created_time | -int | -When the folder was created. | -
updated_time | -int | -When the folder was last updated. | -
user_created_time | -int | -When the folder was created. It may differ from created_time as it can be manually set by the user. | -
user_updated_time | -int | -When the folder was last updated. It may differ from updated_time as it can be manually set by the user. | -
encryption_cipher_text | -text | -- |
encryption_applied | -int | -- |
parent_id | -text | -- |
is_shared | -int | -- |
GET /foldersπ
-Gets all folders
-The folders are returned as a tree. The sub-notebooks of a notebook, if any, are under the children
key.
GET /folders/:idπ
-Gets folder with ID :id
-GET /folders/:id/notesπ
-Gets all the notes inside this folder.
-POST /foldersπ
-Creates a new folder
-PUT /folders/:idπ
-Sets the properties of the folder with ID :id
-DELETE /folders/:idπ
-Deletes the folder with ID :id
-Resourcesπ
-Propertiesπ
-Name | -Type | -Description | -
---|---|---|
id | -text | -- |
title | -text | -The resource title. | -
mime | -text | -- |
filename | -text | -- |
created_time | -int | -When the resource was created. | -
updated_time | -int | -When the resource was last updated. | -
user_created_time | -int | -When the resource was created. It may differ from created_time as it can be manually set by the user. | -
user_updated_time | -int | -When the resource was last updated. It may differ from updated_time as it can be manually set by the user. | -
file_extension | -text | -- |
encryption_cipher_text | -text | -- |
encryption_applied | -int | -- |
encryption_blob_encrypted | -int | -- |
size | -int | -- |
is_shared | -int | -- |
GET /resourcesπ
-Gets all resources
-GET /resources/:idπ
-Gets resource with ID :id
-GET /resources/:id/fileπ
-Gets the actual file associated with this resource.
-POST /resourcesπ
-Creates a new resource
-Creating a new resource is special because you also need to upload the file. Unlike other API calls, this one must have the "multipart/form-data" Content-Type. The file data must be passed to the "data" form field, and the other properties to the "props" form field. An example of a valid call with cURL would be:
-curl -F 'data=@/path/to/file.jpg' -F 'props={"title":"my resource title"}' http://localhost:41184/resources
-
-The "data" field is required, while the "props" one is not. If not specified, default values will be used.
-PUT /resources/:idπ
-Sets the properties of the resource with ID :id
-DELETE /resources/:idπ
-Deletes the resource with ID :id
-Tagsπ
-Propertiesπ
-Name | -Type | -Description | -
---|---|---|
id | -text | -- |
title | -text | -The tag title. | -
created_time | -int | -When the tag was created. | -
updated_time | -int | -When the tag was last updated. | -
user_created_time | -int | -When the tag was created. It may differ from created_time as it can be manually set by the user. | -
user_updated_time | -int | -When the tag was last updated. It may differ from updated_time as it can be manually set by the user. | -
encryption_cipher_text | -text | -- |
encryption_applied | -int | -- |
is_shared | -int | -- |
parent_id | -text | -- |
GET /tagsπ
-Gets all tags
-GET /tags/:idπ
-Gets tag with ID :id
-GET /tags/:id/notesπ
-Gets all the notes with this tag.
-POST /tagsπ
-Creates a new tag
-POST /tags/:id/notesπ
-Post a note to this endpoint to add the tag to the note. The note data must at least contain an ID property (all other properties will be ignored).
-PUT /tags/:idπ
-Sets the properties of the tag with ID :id
-DELETE /tags/:idπ
-Deletes the tag with ID :id
-DELETE /tags/:id/notes/:note_idπ
-Remove the tag from the note.
- - - - - - - diff --git a/docs/blog/20200220-190804/index.html b/docs/blog/20200220-190804/index.html index 16c5c32450..35a2f3f300 100644 --- a/docs/blog/20200220-190804/index.html +++ b/docs/blog/20200220-190804/index.html @@ -364,7 +364,7 @@ https://github.com/laurent22/joplin/blob/master/readme/blog/20200220-190804.mdGSoC 2020: Joplin has been accepted as a mentor organization!π
Good news, our Google Summer of Code 2020 application has been accepted!
Since we made the announcement back in November, we already had a few students submitted pull requests and getting themselves familiar with the codebase.
-We hope some of them will work on the project ideas we've suggested, and develop some great features this summer!
+We hope some of them will work on the project ideas we've suggested, and develop some great features this summer!
url: https://www.patreon.com/posts/gsoc-2020-joplin-34196835
published_at: 2020-02-20T19:08:04.000+00:00
GSoC 2020 Ideasπ
-2020 is Joplin first round at Google Summer of Code. Detailed information on how to get involved and apply are given in the general Summer of Code introduction
+2020 is Joplin first round at Google Summer of Code. Detailed information on how to get involved and apply are given in the general Summer of Code introduction
These are all proposals! We are open to new ideas you might have!! Do you have an awesome idea you want to work on with Joplin but that is not among the ideas below? That's cool. We love that! But please do us a favour: Get in touch with a mentor early on and make sure your project is realistic and within the scope of Joplin.
Information for Studentsπ
These ideas were contributed by our developers and users. They are sometimes vague or incomplete. If you wish to submit a proposal based on these ideas, you are urged to contact the developers and find out more about the particular suggestion you're looking at.
diff --git a/docs/index.html b/docs/index.html index 9ae78aaac4..dc2610337d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -521,11 +521,11 @@ https://github.com/laurent22/joplin/blob/master/README.mdTo import Evernote data, first export your Evernote notebooks to ENEX files as described here. Then follow these steps:
In the desktop application, open File > Import > ENEX and select your file. The notes will be imported into a new separate notebook. If needed they can then be moved to a different notebook, or the notebook can be renamed, etc.
-In the terminal application, in command-line mode, type import /path/to/file.enex
. This will import the notes into a new notebook named after the filename.
In the terminal application, in command-line mode, type import /path/to/file.enex
. This will import the notes into a new notebook named after the filename.
Importing from Markdown filesπ
Joplin can import notes from plain Markdown file. You can either import a complete directory of Markdown files or individual files.
In the desktop application, open File > Import > MD and select your Markdown file or directory.
-In the terminal application, in command-line mode, type import --format md /path/to/file.md
or import --format md /path/to/directory/
.
In the terminal application, in command-line mode, type import --format md /path/to/file.md
or import --format md /path/to/directory/
.
Importing from other applicationsπ
In general the way to import notes from any application into Joplin is to convert the notes to ENEX files (Evernote format) and to import these ENEX files into Joplin using the method above. Most note-taking applications support ENEX files so it should be relatively straightforward. For help about specific applications, see below:
-
diff --git a/docs/plugin/api/assets/css/main.css b/docs/plugin/api/assets/css/main.css
deleted file mode 100644
index 0174b4fe66..0000000000
--- a/docs/plugin/api/assets/css/main.css
+++ /dev/null
@@ -1,2707 +0,0 @@
-/*! normalize.css v1.1.3 | MIT License | git.io/normalize */
-/* ==========================================================================
- * * HTML5 display definitions
- * * ========================================================================== */
-/**
- * * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. */
-article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
- display: block;
-}
-
-/**
- * * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. */
-audio, canvas, video {
- display: inline-block;
- *display: inline;
- *zoom: 1;
-}
-
-/**
- * * Prevent modern browsers from displaying `audio` without controls.
- * * Remove excess height in iOS 5 devices. */
-audio:not([controls]) {
- display: none;
- height: 0;
-}
-
-/**
- * * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
- * * Known issue: no IE 6 support. */
-[hidden] {
- display: none;
-}
-
-/* ==========================================================================
- * * Base
- * * ========================================================================== */
-/**
- * * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
- * * `em` units.
- * * 2. Prevent iOS text size adjust after orientation change, without disabling
- * * user zoom. */
-html {
- font-size: 100%;
- /* 1 */
- -ms-text-size-adjust: 100%;
- /* 2 */
- -webkit-text-size-adjust: 100%;
- /* 2 */
- font-family: sans-serif;
-}
-
-/**
- * * Address `font-family` inconsistency between `textarea` and other form
- * * elements. */
-button, input, select, textarea {
- font-family: sans-serif;
-}
-
-/**
- * * Address margins handled incorrectly in IE 6/7. */
-body {
- margin: 0;
-}
-
-/* ==========================================================================
- * * Links
- * * ========================================================================== */
-/**
- * * Address `outline` inconsistency between Chrome and other browsers. */
-a:focus {
- outline: thin dotted;
-}
-a:active, a:hover {
- outline: 0;
-}
-
-/**
- * * Improve readability when focused and also mouse hovered in all browsers. */
-/* ==========================================================================
- * * Typography
- * * ========================================================================== */
-/**
- * * Address font sizes and margins set differently in IE 6/7.
- * * Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
- * * and Chrome. */
-h1 {
- font-size: 2em;
- margin: 0.67em 0;
-}
-
-h2 {
- font-size: 1.5em;
- margin: 0.83em 0;
-}
-
-h3 {
- font-size: 1.17em;
- margin: 1em 0;
-}
-
-h4, .tsd-index-panel h3 {
- font-size: 1em;
- margin: 1.33em 0;
-}
-
-h5 {
- font-size: 0.83em;
- margin: 1.67em 0;
-}
-
-h6 {
- font-size: 0.67em;
- margin: 2.33em 0;
-}
-
-/**
- * * Address styling not present in IE 7/8/9, Safari 5, and Chrome. */
-abbr[title] {
- border-bottom: 1px dotted;
-}
-
-/**
- * * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. */
-b, strong {
- font-weight: bold;
-}
-
-blockquote {
- margin: 1em 40px;
-}
-
-/**
- * * Address styling not present in Safari 5 and Chrome. */
-dfn {
- font-style: italic;
-}
-
-/**
- * * Address differences between Firefox and other browsers.
- * * Known issue: no IE 6/7 normalization. */
-hr {
- box-sizing: content-box;
- height: 0;
-}
-
-/**
- * * Address styling not present in IE 6/7/8/9. */
-mark {
- background: #ff0;
- color: #000;
-}
-
-/**
- * * Address margins set differently in IE 6/7. */
-p, pre {
- margin: 1em 0;
-}
-
-/**
- * * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. */
-code, kbd, pre, samp {
- font-family: monospace, serif;
- _font-family: "courier new", monospace;
- font-size: 1em;
-}
-
-/**
- * * Improve readability of pre-formatted text in all browsers. */
-pre {
- white-space: pre;
- white-space: pre-wrap;
- word-wrap: break-word;
-}
-
-/**
- * * Address CSS quotes not supported in IE 6/7. */
-q {
- quotes: none;
-}
-q:before, q:after {
- content: "";
- content: none;
-}
-
-/**
- * * Address `quotes` property not supported in Safari 4. */
-/**
- * * Address inconsistent and variable font size in all browsers. */
-small {
- font-size: 80%;
-}
-
-/**
- * * Prevent `sub` and `sup` affecting `line-height` in all browsers. */
-sub {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-
-sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-/* ==========================================================================
- * * Lists
- * * ========================================================================== */
-/**
- * * Address margins set differently in IE 6/7. */
-dl, menu, ol, ul {
- margin: 1em 0;
-}
-
-dd {
- margin: 0 0 0 40px;
-}
-
-/**
- * * Address paddings set differently in IE 6/7. */
-menu, ol, ul {
- padding: 0 0 0 40px;
-}
-
-/**
- * * Correct list images handled incorrectly in IE 7. */
-nav ul, nav ol {
- list-style: none;
- list-style-image: none;
-}
-
-/* ==========================================================================
- * * Embedded content
- * * ========================================================================== */
-/**
- * * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
- * * 2. Improve image quality when scaled in IE 7. */
-img {
- border: 0;
- /* 1 */
- -ms-interpolation-mode: bicubic;
-}
-
-/* 2 */
-/**
- * * Correct overflow displayed oddly in IE 9. */
-svg:not(:root) {
- overflow: hidden;
-}
-
-/* ==========================================================================
- * * Figures
- * * ========================================================================== */
-/**
- * * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. */
-figure, form {
- margin: 0;
-}
-
-/* ==========================================================================
- * * Forms
- * * ========================================================================== */
-/**
- * * Correct margin displayed oddly in IE 6/7. */
-/**
- * * Define consistent border, margin, and padding. */
-fieldset {
- border: 1px solid #c0c0c0;
- margin: 0 2px;
- padding: 0.35em 0.625em 0.75em;
-}
-
-/**
- * * 1. Correct color not being inherited in IE 6/7/8/9.
- * * 2. Correct text not wrapping in Firefox 3.
- * * 3. Correct alignment displayed oddly in IE 6/7. */
-legend {
- border: 0;
- /* 1 */
- padding: 0;
- white-space: normal;
- /* 2 */
- *margin-left: -7px;
-}
-
-/* 3 */
-/**
- * * 1. Correct font size not being inherited in all browsers.
- * * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
- * * and Chrome.
- * * 3. Improve appearance and consistency in all browsers. */
-button, input, select, textarea {
- font-size: 100%;
- /* 1 */
- margin: 0;
- /* 2 */
- vertical-align: baseline;
- /* 3 */
- *vertical-align: middle;
-}
-
-/* 3 */
-/**
- * * Address Firefox 3+ setting `line-height` on `input` using `!important` in
- * * the UA stylesheet. */
-button, input {
- line-height: normal;
-}
-
-/**
- * * Address inconsistent `text-transform` inheritance for `button` and `select`.
- * * All other form control elements do not inherit `text-transform` values.
- * * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
- * * Correct `select` style inheritance in Firefox 4+ and Opera. */
-button, select {
- text-transform: none;
-}
-
-/**
- * * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
- * * and `video` controls.
- * * 2. Correct inability to style clickable `input` types in iOS.
- * * 3. Improve usability and consistency of cursor style between image-type
- * * `input` and others.
- * * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
- * * Known issue: inner spacing remains in IE 6. */
-button, html input[type=button] {
- -webkit-appearance: button;
- /* 2 */
- cursor: pointer;
- /* 3 */
- *overflow: visible;
-}
-
-/* 4 */
-input[type=reset], input[type=submit] {
- -webkit-appearance: button;
- /* 2 */
- cursor: pointer;
- /* 3 */
- *overflow: visible;
-}
-
-/* 4 */
-/**
- * * Re-set default cursor for disabled elements. */
-button[disabled], html input[disabled] {
- cursor: default;
-}
-
-/**
- * * 1. Address box sizing set to content-box in IE 8/9.
- * * 2. Remove excess padding in IE 8/9.
- * * 3. Remove excess padding in IE 7.
- * * Known issue: excess padding remains in IE 6. */
-input {
- /* 3 */
-}
-input[type=checkbox], input[type=radio] {
- box-sizing: border-box;
- /* 1 */
- padding: 0;
- /* 2 */
- *height: 13px;
- /* 3 */
- *width: 13px;
-}
-input[type=search] {
- -webkit-appearance: textfield;
- /* 1 */
- /* 2 */
- box-sizing: content-box;
-}
-input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-
-/**
- * * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
- * * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
- * * (include `-moz` to future-proof). */
-/**
- * * Remove inner padding and search cancel button in Safari 5 and Chrome
- * * on OS X. */
-/**
- * * Remove inner padding and border in Firefox 3+. */
-button::-moz-focus-inner, input::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-
-/**
- * * 1. Remove default vertical scrollbar in IE 6/7/8/9.
- * * 2. Improve readability and alignment in all browsers. */
-textarea {
- overflow: auto;
- /* 1 */
- vertical-align: top;
-}
-
-/* 2 */
-/* ==========================================================================
- * * Tables
- * * ========================================================================== */
-/**
- * * Remove most spacing between table cells. */
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-/* *
- * *Visual Studio-like style based on original C# coloring by Jason Diamond
-
-
- ----
desktop Executes the given command. - The
-props
are the arguments passed to the command, and they vary based on the command
-// Create a new note in the current notebook: -await joplin.commands.execute('newNote'); - -// Create a new sub-notebook under the provided notebook -// Note: internally, notebooks are called "folders". -await joplin.commands.execute('newFolder', { parent_id: "SOME_FOLDER_ID" });
Parameters
--
-
-
-
commandName: string
-
- -
-
Default value props: any = null
-
-
- -
-
-
-
- ----
desktop Registers a new command.
-
-// Register a new commmand called "testCommand1" - -await joplin.commands.register({ - name: 'testCommand1', - label: 'My Test Command 1', - iconName: 'fas fa-music', - execute: () => { - alert('Testing plugin command 1'); - }, -});
Parameters
--
-
-
-
command: Command
-
-
- -
-
path
: This is an array that represents the path to the resource in the form["resouceName", "resourceId", "resourceLink"]
(eg. ["tags", ":id", "notes"]). The "resources" segment is the name of the resources you want to access (eg. "notes", "folders", etc.). If not followed by anything, it will refer to all the resources in that collection. The optional "resourceId" points to a particular resources within the collection. Finally, an optional "link" can be present, which links the resource to a collection of resources. This can be used in the API for example to retrieve all the notes associated with a tag.
- query
: (Optional) The query parameters. In a URL, this is the part after the question mark "?". In this case, it should be an object with key/value pairs.
- 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.
- files
: (Optional) Used to create new resources and associate them with files.
- -
-
-
Parameters
--
-
-
-
path: Path
-
- -
-
Default value query: any = null
-
-
- -
-
-
-
-
Parameters
--
-
-
-
path: Path
-
- -
-
Default value query: any = null
-
-
- -
-
-
-
-
Parameters
--
-
-
-
path: Path
-
- -
-
Default value query: any = null
-
- -
-
Default value body: any = null
-
- -
-
Default value files: any[] = null
-
-
- -
-
-
-
-
Parameters
--
-
-
-
path: Path
-
- -
-
Default value query: any = null
-
- -
-
Default value body: any = null
-
- -
-
Default value files: any[] = null
-
-
- -
-
-
-
-
Parameters
--
-
-
-
module: ExportModule
-
-
- -
-
-
-
-
Parameters
--
-
-
-
module: ImportModule
-
-
- -
-
- register -
-
-
- ----
Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an
-onStart
method to it. - ThatonStart
method will be executed as soon as the plugin is loaded.
-joplin.plugins.register({ - onStart: async function() { - // Run your plugin code here - } -});
Parameters
--
-
-
-
script: Script
-
-
- -
-
- register
Section
- - register
Setting
- - set
Value
- - value -
-
-
- ----
Registers a new setting section. Like for registerSetting, it is dynamic and needs to be done every time the plugin starts.
-Parameters
--
-
-
-
name: string
-
- -
-
section: SettingSection
-
-
- -
-
-
-
- ----
Registers a new setting. Note that registering a setting item is dynamic and will be gone next time Joplin starts. - What it means is that you need to register the setting every time the plugin starts (for example in the onStart event). - The setting value however will be preserved from one launch to the next so there is no risk that it will be lost even if for some - reason the plugin fails to start at some point.
-Parameters
--
-
-
-
key: string
-
- -
-
settingItem: SettingItem
-
-
- -
-
-
-
- ----
Sets a setting value (only applies to setting you registered from your plugin)
-Parameters
--
-
-
-
key: string
-
- -
-
value: any
-
-
- -
-
-
-
- ----
Gets a setting value (only applies to setting you registered from your plugin)
-Parameters
--
-
-
-
key: string
-
-
- -
-
- dialogs -
- menu
Items
- - panels -
- toolbar
Buttons
- - - - - -
- - - - -
- - - - -
- - - - -
- create -
- open -
- set
Buttons
- - set
Html
- - show
Message Box
- -
-
- -- ---
Creates a new dialog
-
- -
-
- ----
Opens the dialog
-Parameters
--
-
-
-
handle: ViewHandle
-
-
- -
-
-
-
- ----
Sets the dialog buttons.
-Parameters
--
-
-
-
handle: ViewHandle
-
- -
-
buttons: ButtonSpec[]
-
-
- -
-
-
-
- ----
Sets the dialog HTML content
-Parameters
--
-
-
-
handle: ViewHandle
-
- -
-
html: string
-
-
- -
-
-
-
- ----
Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel"
-Parameters
--
-
-
-
message: string
-
-
- -
-
- create -
-
-
- ----
Creates a new menu item and associate it with the given command. You can specify under which menu the item should appear using the
-location
parameter.Parameters
--
-
-
-
commandName: string
-
- -
-
Default value location: MenuItemLocation = MenuItemLocation.Tools
-
- -
-
Default value options: CreateMenuItemOptions = null
-
-
- -
-
-
-
- ----
Adds and loads a new JS or CSS files into the panel.
-Parameters
--
-
-
-
handle: ViewHandle
-
- -
-
scriptPath: string
-
-
- -
-
-
-
- -- ---
Creates a new panel
-
- -
-
- ----
Called when a message is sent from the webview (using postMessage).
-Parameters
--
-
-
-
handle: ViewHandle
-
- -
-
callback: Function
-
-
- -
-
-
-
- ----
Sets the panel webview HTML
-Parameters
--
-
-
-
handle: ViewHandle
-
- -
-
html: string
-
-
- -
-
- create -
-
-
- ----
Creates a new toolbar button and associate it with the given command.
-Parameters
--
-
-
-
commandName: string
-
- -
-
location: ToolbarButtonLocation
-
-
- -
-
-
-
- ----
Called when an alarm associated with a to-do is triggered.
-Parameters
--
-
-
-
callback: Function
-
-
- -
-
-
-
- ----
Called when the content of a note changes.
-Parameters
--
-
-
-
callback: Function
-
-
- -
-
-
-
- ----
Called when a new note or notes are selected.
-Parameters
--
-
-
-
callback: Function
-
-
- -
-
-
-
- ----
Called when the synchronisation process has finished.
-Parameters
--
-
-
-
callback: Function
-
-
- -
-
-
-
- -- ---
Gets the currently selected note
-
- -
-
- -- ---
Gets the IDs of the selected notes (can be zero, one, or many). Use the data API to retrieve information about these notes.
-
- - Editor
Toolbar
- - Note
Toolbar
- - Button
Spec
- - Command -
- Create
Menu Item Options
- - Editor
Command
- - Export
Context
- - Export
Module
- - Export
Options
- - Import
Context
- - Import
Module
- - Script -
- Setting
Item
- - Setting
Section
- - Button
Id
- - Path -
- View
Handle
- -
-
-
Parameters
--
-
-
-
props: any
-
-
- -
-
-
-
-
Parameters
--
-
-
-
props: any
-
-
- -
-
-
-
-
Parameters
--
-
-
-
state: any
-
-
- -
-
- accelerator -
- description -
- file
Extensions
- - format -
- is
Note Archive
- - target -
- on
Close
- - on
Init
- - on
Process Item
- - on
Process Resource
- -
-
- ----
Called when the export process is done.
-Parameters
--
-
-
-
context: ExportContext
-
-
- -
-
-
-
- ----
Called when the export process starts.
-Parameters
--
-
-
-
context: ExportContext
-
-
- -
-
-
-
- ----
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
-
-
- -
-
-
-
- ----
Called when a resource file needs to be exported.
-Parameters
--
-
-
-
context: ExportContext
-
- -
-
resource: any
-
- -
-
filePath: string
-
-
- -
-
- format -
- module
Path
- - path -
- source
Folder Ids
- - source
Note Ids
- - target -
- options -
- source
Path
- - warnings -
- description -
- file
Extensions
- - format -
- is
Note Archive
- - output
Format
- - sources -
- on
Exec
- -
-
- ----
Called when the import process starts. There is only one event handler within which you should import the complete data.
-Parameters
--
-
-
-
context: ImportContext
-
-
- -
-
- on
Start
- -
-
-
Parameters
--
-
-
-
event: any
-
-
- -
-
- description -
- icon
Name
- - label -
- name -
joplin
-joplin.commands
-This class allows executing or registering new Joplin commands. Commands can be executed or associated with - toolbar buttons or menu items.
-Executing Joplin's internal commands
- -It is also possible to execute internal Joplin's commands which, as of now, are not well documented. - You can find the list directly on GitHub though at the following locations:
-https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/MainScreen/commands - https://github.com/laurent22/joplin/tree/dev/ElectronClient/commands - https://github.com/laurent22/joplin/tree/dev/ElectronClient/gui/NoteEditor/commands/editorCommandDeclarations.ts
-To view what arguments are supported, you can open any of these files and look at the execute()
command.
Index
-Methods
-execute
--
-
-
-
register
--
-
-
-
joplin.data
-This module provides access to the Joplin data API: https://joplinapp.org/api/ - This is the main way to retrieve data, such as notes, notebooks, tags, etc. - or to update them or delete them.
-This is also what you would use to search notes, via the search
endpoint.
In general you would use the methods in this class as if you were using a REST API. There are four methods that map to GET, POST, PUT and DELETE calls. - And each method takes these parameters:
--
-
Please refer to the Joplin API documentation 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.
-For example:
-// Get a note ID, title and body
-const noteId = 'some_note_id';
-const note = await joplin.data.get(['notes', noteId], { fields: ['id', 'title', 'body'] });
-
-// Get all folders
-const folders = await joplin.data.get(['folders']);
-
-// Set the note body
-await joplin.data.put(['notes', noteId], null, { body: "New note body" });
-
-// Create a new note under one of the folders
-await joplin.data.post(['notes'], null, { body: "my new note", title: "some title", parent_id: folders[0].id });
- Index
-Methods
-delete
--
-
-
-
get
--
-
-
-
post
--
-
-
-
put
--
-
-
-
joplin.interop
-Provides a way to create modules to import external data into Joplin or to export notes into any arbitrary format.
-To implement an import or export module, you would simply define an object with various event handlers that are called - by the application during the import/export process.
-See the documentation of the ExportModule and ImportModule for more information.
-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/
-Index
-Methods
- -Methods
-registerExportModule
- -
-
-
-
registerImportModule
- -
-
-
-
joplin.plugins
-This class provides access to plugin-related features.
-Index
-Methods
--
-
Methods
-register
--
-
-
-
joplin.settings
-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.
-Settings are essentially key/value pairs.
-Note: Currently this API does not provide access to Joplin's built-in settings. This is by design as plugins that modify user settings could give unexpected results
- -Index
-Methods
--
-
Methods
-registerSection
- -
-
-
-
registerSetting
- -
-
-
-
setValue
- -
-
-
-
value
--
-
-
-
joplin.views
-This namespace provides access to view-related services.
-All view services provide a create()
method which you would use to create the view object, whether it's a dialog, a toolbar button or a menu item.
- In some cases, the create()
method will return a ViewHandle, which you would use to act on the view, for example to set certain properties or call some methods.
Index
-Accessors
--
-
Accessors
-dialogs
--
-
-
-
menuItems
- -
-
-
-
panels
--
-
-
-
toolbarButtons
- -
-
-
-
joplin.views.dialogs
-Allows creating and managing dialogs. A dialog is modal window that contains a webview and a row of buttons. You can update the update the webview using the setHtml
method.
- Dialogs are hidden by default and you need to call open()
to open them. Once the user clicks on a button, the open
call will return and provide the button ID that was
- clicked on. There is currently no "close" method since the dialog should be thought as a modal one and thus can only be closed by clicking on one of the buttons.
Index
-Methods
--
-
Methods
-create
--
-
-
-
open
--
-
-
-
setButtons
- -
-
-
-
setHtml
- -
-
-
-
showMessageBox
- -
-
-
-
joplin.views.menuItems
-Allows creating and managing menu items.
-Index
-Methods
--
-
Methods
-create
--
-
-
-
joplin.views.panels
-Allows creating and managing view panels. View panels currently are displayed at the right of the sidebar and allows displaying any HTML content (within a webview) and update it in real-time. For example - it could be used to display a table of content for the active note, or display various metadata or graph.
-Index
-Methods
-addScript
- -
-
-
-
create
--
-
-
-
onMessage
- -
-
-
-
setHtml
- -
-
-
-
joplin.views.toolbarButtons
-Allows creating and managing toolbar buttons.
-Index
-Methods
--
-
Methods
-create
--
-
-
-
joplin.workspace
-The workspace service provides access to all the parts of Joplin that are being worked on - i.e. the currently selected notes or notebooks as well - as various related events, such as when a new note is selected, or when the note content changes.
-Index
-Methods
- -Methods
-onNoteAlarmTrigger
- -
-
-
-
onNoteContentChange
- -
-
-
-
onNoteSelectionChange
- -
-
-
-
onSyncComplete
- -
-
-
-
selectedNote
- -
-
-
-
selectedNoteIds
- -
-
-
-
FileSystemItem
-ImportModuleOutputFormat
-MenuItemLocation
-SettingItemType
-ToolbarButtonLocation
-Index
-Enumeration members
--
-
Enumeration members
-EditorToolbar
-
-
- This toolbar is right above the text editor. It applies to the note body only.
-NoteToolbar
-
-
- This toolbar in the top right corner of the application. It applies to the note as a whole, including its metadata.
-Joplin Plugin API Documentation
-Index
-Enumerations
- -Classes
- -Interfaces
--
-
Type aliases
--
-
Type aliases
-ButtonId
-
-
- Path
- - -An array of at least one element and at most three elements.
-[0]: Resource name (eg. "notes", "folders", "tags", etc.) - [1]: (Optional) Resource ID. - [2]: (Optional) Resource link.
-ViewHandle
-
-
- Joplin Plugin API Documentation
-Joplin Plugin Documentation
- -Welcome to Joplin Plugin Documentation
-ButtonSpec
-Command
-Index
-Properties
-Optional iconName
-
-
- label
- - -name
- - -Methods
-execute
--
-
-
-
Optional isEnabled
- -
-
-
-
Optional mapStateToProps
- -
-
-
-
CreateMenuItemOptions
-Index
-Properties
--
-
Properties
-accelerator
- - -EditorCommand
-ExportContext
-ExportModule
-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)
.
Index
-Properties
--
-
Methods
--
-
Properties
-description
- - -The description that will appear in the UI, for example in the menu item.
-Optional fileExtensions
-
-
- 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
- - -The format to be exported, eg "enex", "jex", "json", etc.
-isNoteArchive
-
-
- 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
- - -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
- -
-
-
-
onInit
- -
-
-
-
onProcessItem
- -
-
-
-
onProcessResource
- -
-
-
-
ExportOptions
-Index
-Properties
--
-
Properties
-Optional format
- - -Optional modulePath
-
-
- Optional path
- - -Optional sourceFolderIds
-
-
- Optional sourceNoteIds
-
-
- Optional target
- - -ImportContext
-Index
-Properties
--
-
Properties
-options
- - -sourcePath
-
-
- warnings
- - -ImportModule
-Index
-Properties
--
-
Methods
--
-
Properties
-description
- - -The description that will appear in the UI, for example in the menu item.
-Optional fileExtensions
-
-
- Tells the file extensions of the exported files.
-format
- - -The format to be exported, eg "enex", "jex", "json", etc.
-isNoteArchive
-
-
- 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.
-Optional outputFormat
-
-
- Tells the type of notes that will be generated, either HTML or Markdown (default).
-sources
- - -The type of sources that are supported by the module. Tells whether the module can import files or directories or both.
-Methods
-onExec
- -
-
-
-
Script
-Index
-Methods
--
-
Methods
-Optional onStart
- -
-
-
-
SettingItem
-Index
-Properties
-Optional advanced
- - -Optional appTypes
-
-
- Optional description
- - -Optional isEnum
-
-
- label
- - -Optional maximum
- - -Optional minimum
- - -Optional options
- - -public
- - -Optional section
- - -Optional secure
- - -Optional step
- - -type
- - -value
- - -SettingSection
-Index
-Properties
--
-
Properties
-Optional description
- - -Optional iconName
-
-
- label
- - -Optional name
- - -The Joplin applications, including the Android, iOS, Windows, macOS and Linux applications, do not send any data to any service without your authorisation. Any data that Joplin saves, such as notes or images, are saved to your own device and you are free to delete this data at any time.
- -If you choose to synchronise with a third-party, such as OneDrive, the notes will be sent to your OneDrive account, in which case the third-party privacy policy applies.
- -For any question about Joplin privacy policy, please leave a message on the forum.
\ No newline at end of file
This is the main entry point to the Joplin API. You can access various services using the provided accessors.
-