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 26, 2022
2 parents ab0ec17 + 90bae70 commit ba35d24
Show file tree
Hide file tree
Showing 27 changed files with 1,002 additions and 146 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
tsconfig.json
webpack.config.js
/__test__
.env
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## not released

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

- Add: #35 Warning color when a taks is close to a due date
- Add: Virtual field `link` to display the `source_url` to make the output configurable
- Fix: Ignore noteoverview blocks if they start with a codeblock (```) statement
- Add: #36 Variable `{{count}}` to the summary of the details HTML tag
- Add: #27 RegEx filter `regex` for excerpt
- Add: Option for logfile
- Add: #28 Stripe note-overview code block fields
- Add: #26 Date variables for search query

## v1.5.5 (2022-01-26)

- Improved: Alias keyword `AS` is now case insensetive #43
Expand Down
95 changes: 91 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ A note overview is created based on the defined search and the specified fields.
- [Automatic](#automatic)
- [Manual](#manual)
- [Usage](#usage)
- [Limitations](#limitations)
- [Codeblock options](#codeblock-options)
- [search](#search)
- [search variable date](#search-variable-date)
- [fields](#fields)
- [sort](#sort)
- [alias](#alias)
Expand All @@ -26,6 +28,7 @@ A note overview is created based on the defined search and the specified fields.
- [details](#details)
- [count](#count)
- [listview](#listview)
- [link](#link)
- [Examples](#examples)
- [ToDo Overview](#todo-overview)
- [Show all ToDos with status](#show-all-todos-with-status)
Expand All @@ -40,9 +43,11 @@ A note overview is created based on the defined search and the specified fields.
- [Change count for single overview](#change-count-for-single-overview)
- [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)
- [Plugin options](#plugin-options)
- [Keyboard Shortcuts](#keyboard-shortcuts)
- [FAQ](#faq)
- [The note overview is not updated](#the-note-overview-is-not-updated)
- [Error: Nested mappings are not allowed in compact mappings](#error-nested-mappings-are-not-allowed-in-compact-mappings)
- [Error: Implicit map keys need to be followed by map values](#error-implicit-map-keys-need-to-be-followed-by-map-values)
- [Error: All collection items must start at the same column](#error-all-collection-items-must-start-at-the-same-column)
Expand Down Expand Up @@ -90,11 +95,15 @@ Several of these blocks can be included in one note, also between text.

The note content is updated every x minutes (depending on your setting) or manualy by `Tools > Create Note overview`.

### Limitations

> ⚠ Adding and editing the code block does not work in the **Rich Text (WYSIWYG)** editor!
> ⚠ When the note is edited in `Rich Text` (WYSIWYG) editor, the note code block is not preserved!
> ❕ The refresh of the note ist not working in the `Rich Text` (WYSIWYG) editor, to update the note view please change the note and switch back.
> ⚠ The manual refresh of the note ist not working in the `Rich Text` (WYSIWYG) editor, to update the note chnage to markdown editor, viewer or a other note and trigger the note overview update again.
> With an automatic update, the currently displayed note opened in the `markdown` or `Rich Text` (WYSIWYG) editor is not updated to prevent data loss during editing!
## Codeblock options

Expand All @@ -109,6 +118,30 @@ The search filter which will be used to create the overview.
search: type:todo
```
#### search variable date
To search for date texts the variable `{{moments:<FORMAT>}}` is available, replace the `<FORMAT>` with the [moments formatting](https://momentjs.com/docs/#/displaying/)

```yml
search: Logbook {{moments:YYYY}}
```

The date can be manipulated with `modify:<MANIPULATION>`, for `<MANIPULATION>` the syntax is `<+ or -><amount><Key>` and the following key. This syntax can be repeated comma separated.

| Modification | Key |
| ------------ | --- |
| years | y |
| quarters | Q |
| months | M |
| weeks | w |
| days | d |
| hours | h |
| minutes | m |

```yml
search: Logbook {{moments:DD-MM-YYYY modify:+1m,-1d}}
```

### fields

Which fields should be output in the table.<br>
Expand All @@ -125,6 +158,7 @@ In addition to the Joplin fields, there are the following virtual fields:
- `breadcrumb`: Folder breadcrumb (Folder path)
- `image`: In this field a image resource from the note will be displayed. This field can be configured using the `image` option
- `excerpt`: Displays an excerpt of the note body
- `link`: Display the `source_url`. This field can be configured using the `link` option

```yml
fields: todo_due, title, tags, notebook
Expand Down Expand Up @@ -169,21 +203,32 @@ image:

### excerpt

Displays an excerpt of the note body, the length of the excerpt can be configured using `maxlength`.
Displays an excerpt of the note body, the length of the excerpt can be configured using `maxlength` or you can use a RegEx to select data for the excerpt.

```yml
excerpt:
maxlength: 200
removenewline: [true | false]
removemd: [true | false]
regex: ^.*Joplin.*$
regexflags: gmi
```

- `maxlength`: Maximum length for the excerpt
- `removenewline`: Remove new lines from excerpt, default `true`
- `removemd`: Remove markdown from excerpt, default `true`
- `regex`: Regular expression to match content for the excerpt. `maxlength` will be ignored if this option is used.
- `regexflags`: Regular expression flags for the `regex` match

### details

Add the overview into a details section that can open and close on demand.
In the summary the variable `{{count}}` can be used, to display the number of matched notes.

```yml
details:
open: [true | false]
summary: All notes without a Tag
summary: {{count}} notes without a Tag
```

### count
Expand Down Expand Up @@ -212,6 +257,21 @@ listview:
suffix: ==
```

### link

This allows you to control the output displayed in the `link` field.

- `caption`: The text to display for the link (default = `Link`).
- `html`:
`false` = Output is a markdown link (default)
`true` = Output is a HTML link

```yml
link:
caption: "Jump to"
html: true
```

## Examples

### ToDo Overview
Expand Down Expand Up @@ -365,20 +425,43 @@ listview:
-->
```

### Show all uncompleted checkboxes (ToDos)

```yml
<!-- note-overview-plugin
search: tag:todo
fields: title, excerpt
listview:
text: |-
{{title}}
{{excerpt}}
excerpt:
regex: ^.*- \[( )\].*$
regexflags: gmi
removenewline: false
removemd: false
-->
```

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

## 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}}` |
| `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` |
Expand All @@ -392,6 +475,10 @@ Under `Options > Keyboard Shortcuts` you can assign a keyboard shortcut for the

## FAQ

### The note overview is not updated

See the [limitations](#limitations) section.

### Error: Nested mappings are not allowed in compact mappings

This error message occurs when a colon is used in the option value and an space character follows the colon. Just enclose the value of the option in quotes like `alias: "title AS : Title :"`.
Expand Down
61 changes: 61 additions & 0 deletions __test__/data/notes/codeBlock/body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Codeblock check

## Ignore 1

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

## Ignore 2 with space

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

## Ignore 3

```
<!-- note-overview-plugin
search: -tag:*
fields: updated_time, title, notebook
alias: updated_time AS Edit
sort: updated_time DESC
-->
| Edit | title | notebook |
| --- | --- | --- |
|24/08/2021 20:56|[Note 1](:/2f9c4c5803974a85bb1891e2bcf1903f)|Import|
|24/08/2021 12:54|[Note 2](:/74173316718d44668a73e17aeb97a69a)|Import|
<!--endoverview-->
```

## Match 1

```
Some Code
```

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

## Match 2

<!-- note-overview-plugin
search: type:todo iscompletetd:0 notebook:"5 - SOMEDAY / MAYBE" tag:pro
fields: title, created_time
sort: created_time ASC
-->

```
Code
```
6 changes: 6 additions & 0 deletions __test__/data/notes/codeBlock/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "",
"title": "Test note mock",
"body": "",
"type_": 1
}
1 change: 1 addition & 0 deletions __test__/data/options/field_link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
link:
3 changes: 3 additions & 0 deletions __test__/data/options/field_link_html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
link:
caption: data
html: true
25 changes: 25 additions & 0 deletions __test__/data/removeNoteoverviewCode/closeTag.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Some note body


and more Text

```
<!-- note-overview-plugin
search: type:todo
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
-->
More data
<!--endoverview-->
```

and some more text


Some note body


data from overview


End
36 changes: 36 additions & 0 deletions __test__/data/removeNoteoverviewCode/closeTag.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Some note body

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

and more Text

```
<!-- note-overview-plugin
search: type:todo
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
-->
More data
<!--endoverview-->
```

and some more text


Some note body

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

data from overview

<!--endoverview-->

End
7 changes: 7 additions & 0 deletions __test__/data/removeNoteoverviewCode/multiple.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Some note body


and more Text


and some more Text
17 changes: 17 additions & 0 deletions __test__/data/removeNoteoverviewCode/multiple.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Some note body

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

and more Text

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

and some more Text
4 changes: 4 additions & 0 deletions __test__/data/removeNoteoverviewCode/single.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Some note body


and more Text
Loading

0 comments on commit ba35d24

Please sign in to comment.