joplin-plugin-csv-mode 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReadMe.md +86 -0
- package/package.json +30 -4
- package/publish/net.zblesk.joplin.csv-mode.jpl +0 -0
- package/publish/net.zblesk.joplin.csv-mode.json +20 -0
- package/README.md +0 -3
package/ReadMe.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# CSV;Mode
|
|
2
|
+
|
|
3
|
+
A Joplin plugin that lets you view CSV data as pretty tables.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Step one always is telling Joplin that the current note is a CSV via the menu action or note toolbar button.
|
|
8
|
+
|
|
9
|
+
Paste CSV text into a note, mark the note as CSV, and the editor is replaced by a sortable, filterable grid. The first row of the data is used as the table header.
|
|
10
|
+
|
|
11
|
+
You can turn CSV mode on for every note, it won't just barge in by itself.
|
|
12
|
+
Delimiter, quote character and the other option defaults are stored within Joplin's config - but you can override for each note and the settings will be remembered.
|
|
13
|
+
|
|
14
|
+
The grid is built with [AG Grid Community](https://www.ag-grid.com/) and follows Joplin's light or dark theme.
|
|
15
|
+
|
|
16
|
+
### Getting started
|
|
17
|
+
|
|
18
|
+
1. Put CSV text in a note.
|
|
19
|
+
2. Click the table button in the note toolbar, or use **Tools > Set up CSV mode**.
|
|
20
|
+
3. Check the delimiter and the other options in the dialog, then press OK (or Enter).
|
|
21
|
+
|
|
22
|
+
The note re-opens as a table. (This doesn't seem to be supported quite well in the API - if it doesn't, just switch to a different note and back.)
|
|
23
|
+
To edit the file, use the "Toggle editor plugin" button (eye icon).
|
|
24
|
+
To permanently unmark a file so it's no longer displayed as a CSV, open the same dialog and choose **This is not a CSV**.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
### Table view
|
|
30
|
+
|
|
31
|
+
- Columns are named after the first row of the data.
|
|
32
|
+
- Every column has a filter, and columns can be sorted and resized.
|
|
33
|
+
- Quoted fields are supported, including doubled quote characters inside a field and line breaks inside a quoted field. (The line breaks are not show, but will be preserved on copy.)
|
|
34
|
+
- Rows shorter than the header are padded with empty cells.
|
|
35
|
+
- Completely empty lines are ignored.
|
|
36
|
+
- Right-click menu lets you copy values or auto-resize the columns.
|
|
37
|
+
|
|
38
|
+
### Per-note CSV configuration
|
|
39
|
+
|
|
40
|
+
The CSV config dialog (toolbar button or **Tools > Set up CSV mode**) has these options:
|
|
41
|
+
|
|
42
|
+
| Option | Meaning |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Delimiter | The character that separates columns. Enter `\t` or `tab` for a tab character. |
|
|
45
|
+
| String escape | The character used to quote fields that contain the delimiter, the quote character or a line break. |
|
|
46
|
+
| Lines to skip at start | Number of lines at the beginning of the note to ignore before the CSV data begins. |
|
|
47
|
+
| Skip frontmatter | Ignore a leading YAML frontmatter block. |
|
|
48
|
+
| Enable row selection | Show checkboxes for selecting rows (see below). |
|
|
49
|
+
|
|
50
|
+
Notes on the options:
|
|
51
|
+
|
|
52
|
+
- **Delimiter validation:** the delimiter must be a single character, or a tab spelling (`\t`, `tab`). Anything else is rejected and the dialog is shown again with an error message.
|
|
53
|
+
- **Skipping:** frontmatter is removed first, then the requested number of lines. Frontmatter is a block that starts on the first line with `---` and ends at the next `---` or `...` line. If the note doesn't start with `---`, nothing is removed. The first line left after skipping becomes the header row.
|
|
54
|
+
- **Confirming:** pressing Enter in the dialog confirms it.
|
|
55
|
+
|
|
56
|
+
### Global defaults
|
|
57
|
+
|
|
58
|
+
Under **Settings > CSV Mode** you can set defaults used by notes that don't have their own value:
|
|
59
|
+
|
|
60
|
+
- **Default separator** (default `;`). Enter `\t` or `tab` for a tab.
|
|
61
|
+
- **Default string escape** (default `"`).
|
|
62
|
+
- **Default lines to skip** (default 0).
|
|
63
|
+
- **Skip frontmatter by default** (default on).
|
|
64
|
+
|
|
65
|
+
A default separator longer than one character can't be used by the parser, so only its first character is used. Row selection has no global default and is off for new notes.
|
|
66
|
+
|
|
67
|
+
### Right-click menu
|
|
68
|
+
|
|
69
|
+
Right-clicking the grid opens a menu:
|
|
70
|
+
|
|
71
|
+
- **Copy cell value** copies the raw text of the cell under the pointer.
|
|
72
|
+
- **Copy row value** copies the row as a CSV line, using the note's delimiter and quote character. Fields that need it are quoted. If row selection is on and you right-click one of several ticked rows, all ticked rows are copied, one per line.
|
|
73
|
+
- **Enable row selection / Disable row selection** toggles the row checkboxes. The choice is saved in the note config.
|
|
74
|
+
- **Clear row selection** appears only while at least one row is ticked and deselects everything.
|
|
75
|
+
- **Auto-size columns** fits column widths to the content. Widths are capped at 500 px, and if the columns end up narrower than the grid, they are stretched to fill it.
|
|
76
|
+
|
|
77
|
+
### Row selection
|
|
78
|
+
|
|
79
|
+
When enabled, each row gets a checkbox and the header gets a select-all checkbox. Selected rows can be copied from the right-click menu. Turning row selection off clears the current selection.
|
|
80
|
+
|
|
81
|
+
## Limitations
|
|
82
|
+
|
|
83
|
+
- The first row after any skipped lines is always treated as the header. There is no headerless mode.
|
|
84
|
+
- The grid is read-only. To change data, edit the note's text without CSV mode. (You can switch to the text view by clicking the built-in eye icon.)
|
|
85
|
+
- Ranges of cells can't be selected. Only single cells and whole rows can be copied.
|
|
86
|
+
- Auto-sizing measures only the rows currently drawn in the grid, so in very long files the widths reflect the visible rows.
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joplin-plugin-csv-mode",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
|
|
6
|
+
"prepare": "npm run dist",
|
|
7
|
+
"updateVersion": "webpack --env joplin-plugin-config=updateVersion",
|
|
8
|
+
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"joplin-plugin"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
"publish"
|
|
16
|
+
],
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^18.7.13",
|
|
19
|
+
"chalk": "^4.1.0",
|
|
20
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
21
|
+
"fs-extra": "^10.1.0",
|
|
22
|
+
"glob": "^8.0.3",
|
|
23
|
+
"tar": "^6.1.11",
|
|
24
|
+
"ts-loader": "^9.3.1",
|
|
25
|
+
"typescript": "^4.8.2",
|
|
26
|
+
"webpack": "^5.74.0",
|
|
27
|
+
"webpack-cli": "^4.10.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"ag-grid-community": "^36.1.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"id": "net.zblesk.joplin.csv-mode",
|
|
4
|
+
"app_min_version": "3.7",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"name": "CSV;Mode",
|
|
7
|
+
"description": "Lets you view CSV files in Joplin as tables",
|
|
8
|
+
"author": "zblesk",
|
|
9
|
+
"homepage_url": "https://github.com/zblesk/joplin-csv-mode",
|
|
10
|
+
"repository_url": "https://github.com/zblesk/joplin-csv-mode",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"csv"
|
|
13
|
+
],
|
|
14
|
+
"categories": [],
|
|
15
|
+
"screenshots": [],
|
|
16
|
+
"icons": {},
|
|
17
|
+
"promo_tile": {},
|
|
18
|
+
"_publish_hash": "sha256:fd7999c23da66cc3f2c407f2ab263da35f08c141e4b209c8ca7acae2bf60b9bb",
|
|
19
|
+
"_publish_commit": "master:feeb03012f4409c7f4ded69304821e600cd167cc"
|
|
20
|
+
}
|
package/README.md
DELETED