Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGruber committed Dec 24, 2023
2 parents ba35d24 + 08eefe8 commit b6f9b22
Show file tree
Hide file tree
Showing 40 changed files with 25,181 additions and 14,412 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "16"
- name: Install dependencies
run: npm install
- name: Build
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## not released

## v1.7.0 (2023-12-24)

- Add: Translation
- Fix: #67 HTML image tags are not recognized for `image` option
- Add: Option to disable automatic update of a note overview #57
- Add: Option to configure the `status` field per note overview #66 @aiosk
- Add: Option to configure the date and timeformat per note overview #68 @aiosk
- Add: The option `limit` to set how many results should be displayed per note overview #69

## v1.6.0 (2022-12-26)

- Add: #35 Warning color when a taks is close to a due date
Expand Down
22 changes: 14 additions & 8 deletions GENERATOR_DOC.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generator-joplin
# Plugin development

Scaffolds out a new Joplin plugin
This documentation describes how to create a plugin, and how to work with the plugin builder framework and API.

## Installation

Expand All @@ -14,14 +14,9 @@ npm install -g generator-joplin
Then generate your new project:

```bash
yo joplin
yo --node-package-manager npm joplin
```

## Development

To test the generator for development purposes, follow the instructions there: https://yeoman.io/authoring/#running-the-generator
This is a template to create a new Joplin plugin.

## Structure

The main two files you will want to look at are:
Expand All @@ -39,6 +34,10 @@ To build the plugin, simply run `npm run dist`.

The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.

## Updating the manifest version number

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.

## Publishing the plugin

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:
Expand Down Expand Up @@ -67,6 +66,13 @@ By default, the compiler (webpack) is going to compile `src/index.ts` only (as w

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.

## More information

- [Joplin Plugin API](https://joplinapp.org/api/references/plugin_api/classes/joplin.html)
- [Joplin Data API](https://joplinapp.org/help/api/references/rest_api)
- [Joplin Plugin Manifest](https://joplinapp.org/api/references/plugin_manifest/)
- Ask for help on the [forum](https://discourse.joplinapp.org/) or our [Discord channel](https://discord.gg/VSj7AFHvpq)

## License

MIT © Laurent Cozic
98 changes: 80 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- markdownlint-disable MD033 -->
<!-- markdownlint-disable MD028 -->
<!-- markdownlint-disable MD007 -->
<!-- markdownlint-disable MD045 -->

# Joplin note overview

Expand All @@ -22,13 +23,16 @@ A note overview is created based on the defined search and the specified fields.
- [search variable date](#search-variable-date)
- [fields](#fields)
- [sort](#sort)
- [limit](#limit)
- [alias](#alias)
- [datetime](#datetime)
- [image](#image)
- [excerpt](#excerpt)
- [details](#details)
- [count](#count)
- [listview](#listview)
- [link](#link)
- [status](#status)
- [Examples](#examples)
- [ToDo Overview](#todo-overview)
- [Show all ToDos with status](#show-all-todos-with-status)
Expand All @@ -44,6 +48,8 @@ A note overview is created based on the defined search and the specified fields.
- [Change to listview no linbreak](#change-to-listview-no-linbreak)
- [Combine notes dynamically](#combine-notes-dynamically)
- [Show all uncompleted checkboxes ToDos](#show-all-uncompleted-checkboxes-todos)
- [Disable automatic note overview update for one note overview](#disable-automatic-note-overview-update-for-one-note-overview)
- [Show the last 5 edited notes](#show-the-last-5-edited-notes)
- [Plugin options](#plugin-options)
- [Keyboard Shortcuts](#keyboard-shortcuts)
- [FAQ](#faq)
Expand Down Expand Up @@ -112,7 +118,7 @@ Options that can be specified in the in the code block using YAML syntax.
### search

The search filter which will be used to create the overview.
[Documentation of search filters](https://joplinapp.org/help/#search-filters).
[Documentation of search filters](https://joplinapp.org/help/apps/search#search-filters).

```yml
search: type:todo
Expand Down Expand Up @@ -172,6 +178,14 @@ By which field the output should be sorted. It can be only sorted by one field a
sort: todo_due ASC
```

### limit

Displayes only the first x hits of the search. Without the limit option all results are displayed.

```yml
limit: 5
```

### alias

This allows renaming the fields in the output.
Expand All @@ -182,6 +196,35 @@ Syntax: `<field> AS <new field name>`, multiple fields comma seperated.
alias: todo_due AS Due Date, notebook AS Folder
```

### datetime

Customize datetime format for a single overview.

```yml
datetime:
date: "YYYY-MM-DD"
time: "HH:mm"
```

- `date`: Set date format. Default is Joplin global settings on `Tools` > `Options` > `General` > `Date format`
- `time`: Set time format. Default is Joplin global settings on `Tools` > `Options` > `General` > `Time format`

Complete list of format can be found [here](https://momentjs.com/docs/#/displaying/format/).

You can also set datetime to [humanize](https://momentjs.com/docs/#/durations/humanize/) format, to display a length of time. You can do that by adding `humanize` settings.

```yml
datetime:
date: "YYYY-MM-DD"
time: "HH:mm"
humanize:
enabled: [true | false]
withSuffix: [true | false]
```

- `enabled` : set `true` to enable humanize format. Default is `false`.
- `withSuffix` : set `false`, to remove oriented duration (ex: `a month`). Default is `true`, it will add oriented duration (ex: `in a month`, `a month ago`).

### image

This allows you to control the image displayed in the `image` field.
Expand Down Expand Up @@ -272,6 +315,19 @@ link:
html: true
```

### status

Customize note status field for a single overview.

```yml
status:
note: ""
todo:
open: ☐
done: 🗹
overdue: ⚠
```

## Examples

### ToDo Overview
Expand Down Expand Up @@ -446,27 +502,33 @@ excerpt:

<img src="img/example_option_excerpt_regex_checkbox.png">

### Disable automatic note overview update for one note overview

When you set the `update` option to `manual`, then note overview is only updated when you select the note and trigger a update.

```yml
<!-- note-overview-plugin
search: tag:todo
fields: title, excerpt
update: manual
-->
```

### Show the last 5 edited notes

```yml
<!-- note-overview-plugin
search: /*
fields: title, updated_time
sort: updated_time DESC
limit: 5
-->
```

## Plugin options

Settings for the plugin, accessible at `Tools > Options > Note overview`.

| Option | Description | Default |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `Show note count` | Show the number of notes found. | `off` |
| `Note count text` | Text for the display of the found notes, `{{count}}` is replace with the number of matched notes. | `Note count: {{count}}` |
| `Update interval in minutes` | How often the overview notes should be updated. | `5` |
| `Update on Joplin sync` | Update the Noteoverview after a Joplin syncronisation. Independent of the update interval. | `No` |
| `Field status: open todo` | Text for the `status` field, when the todo is not completed. | |
| `Field status: todo completed` | Text for the `status` field, when the todo is completed. | |
| `Field status: todo over due` | Text for the `status` field, when the due date of the todo is exceeded. | |
| `Color: todo [open]` | HTML color for the `due_date`, when the todo is not completed. | |
| `Color: todo [warning]` | HTML color for the `due_date`, when the todo is not completed and within `todo [warning] hours`. | |
| `todo [warning] hours` | How many hours before due_date the warning color should be applied. 0 = Disabled. | `0` |
| `Color: todo [open_overdue]` | HTML color for the `due_date`, when the todo is over the due date. | `red` |
| `Color: todo [done]` | HTML color for the `due_date` and `todo_completed`, when the todo is completed. Seperate the color for due_date and todo_completed by a `,`. | `limegreen,limegreen` |
| `Color: todo [done_overdue]` | HTML color for the `due_date` and `todo_completed`, when the todo was completed after the due date. Seperate the color for due_date and todo_completed by a `,`. | `orange,orange` |
| `Color: todo [done_nodue]` | HTML color for the `todo_completed`, when the todo was completed but no due date was set. | |

## Keyboard Shortcuts

Under `Options > Keyboard Shortcuts` you can assign a keyboard shortcut for the following commands:
Expand Down
27 changes: 27 additions & 0 deletions __test__/data/notes/updateSetting/body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Pro

## default

<!-- note-overview-plugin
search: type:todo iscompleted:0 notebook:"default" tag:pro
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
-->

## automatic

<!-- note-overview-plugin
search: type:todo iscompleted:0 notebook:"automatic" tag:pro
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
update: automatic
-->

## manual

<!-- note-overview-plugin
search: type:todo iscompleted:0 notebook:"manual" tag:pro
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
update: manual
-->
6 changes: 6 additions & 0 deletions __test__/data/notes/updateSetting/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "",
"title": "Test note mock",
"body": "",
"type_": 1
}
3 changes: 3 additions & 0 deletions __test__/data/options/datetime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
datetime:
date: "DD/MM/YYYY"
time: ""
5 changes: 5 additions & 0 deletions __test__/data/options/datetime_humanize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
datetime:
date: "DD/MM/YYYY"
time: "HH:mm"
humanize:
enabled: true
6 changes: 6 additions & 0 deletions __test__/data/options/datetime_humanize_withoutSuffix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
datetime:
date: "DD/MM/YYYY"
time: "HH:mm"
humanize:
enabled: true
withSuffix: false
6 changes: 6 additions & 0 deletions __test__/data/options/note_status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
status:
note: "n"
todo:
open: "o"
done: "d"
overdue: "od"
Loading

0 comments on commit b6f9b22

Please sign in to comment.