Plugin: Many enhancement for my daily usage

Hello! To meet my requirements in daily usage, I created a plugin that contains several different functions. Hope it can help you. :slight_smile:

Features

Each feature can be disabled/enabled in the settings.

ReadCube Papers

ReadCube Papers is a reference manager: Official website.

This plugin supports:

  1. Sync your papers information to local database. [Almost real time syncing due to the websocket protocal].
  2. Render a paper info table after the note content for paper note. [Note created by the menu 'Tools -> Create notes for papers'].
  3. Direct link to the PDF file in the paper info table.
  4. Auto insert formatted references through tool button.

ATTENTION: this plugin use database file instead of notes to store the papers' information since v0.6.1. No notes will be deleted. Your data will be safe.

WARNING: DO NOT delete the source_url attribute of notes. It helps to tell the renderer which notes should be rendered with a paper information table. The notes created for Papers have the source_url with the papers_ prefix.

Dialog UI code from joplin/plugin-bibtex.git

img

How to use:

  1. In the Joplin Settings -> Joplin Enhancement -> Set your cookie for Papers
  2. Joplin Menubar -> Tools -> Sync files with Papers: It will create notes for your papers without the annotations
    1. Not needed anymore. Now it will fully fetch the papers at the startup and keep syncing based on websocket
  3. 'Tools -> Create notes for papers'. Only the notes created in this way can have a rendered paper information table

How to get cookies:

  1. Open your browser, go to your Papers Library
  2. Press F12 to open developer tools.
  3. Click any paper

Pseudocode

Pseudocode block:

Image

Allow following md works:

![Your Figure Caption Here](/path/to/your/img){width=60%}

This plugin can:

  • Specific the width/height of the image with {width=80px}, {height=30}, {width=50%}
  • Render the image ![]() in a <figure> block with figcaption
  • Use the alt attribute as the figure caption, and display the caption under the image if not empty
  • Center alignment for image and caption
  • Automatic image numbering

Cat and Dog

Table

Auto add row/column, delete column, and format table.

This part mainly comes from takumisoft68: vscode-markdown-table. Please refer to it for the feature description.
I just convert the code from vscode's editor to joplin's codemirror. :slight_smile:

Because I have no idea how to create a context menu, currently all the operations are triggered by shortcut:

Function Shutcut
Insert a row above/below ctrl + shift + up/down
Insert a column left/right ctrl + shift + left/right
Delete current column ctrl + shift + backspace
Navigate to previous cell tab
Navigate to next cell shift + tab
  1. It will automatically format your table code for alignment when navigation between cells with tab
  2. A new line is appended when trying to navigate to next cell from the last cell

Table column colorize from the plugin: hieuthi/joplin-plugin-markdown-table-colorize

tableFormatter

Local file preview

Currently only local pdf file can be previewed.

Quick Commands

Type /command in the editor for quick input of table, mermaid, etc.

  • /table
  • /graph
  • /flowchart
  • /sequenceDiagram
  • /gantt
  • /classDiagram
  • /erDiagram
  • /journey

Auto folder in the editor

Currently only the mermaid block can be folded automatically.

Thanks to

16 Likes

Thanks!

I'd love it if the table features could be made as a standalone, or possibly merged into one of the other table plugins, like the Table Formatter.

4 Likes

That's an interesting collection of improvements!
Can you tell if there is perf impact when some features are disabled?

1 Like

Each feature should work fine with some of them disabled because each feature are independent of each other at the code level.

1 Like

It is not likely to make it as a standalone for my convenience. However, I think I can make a PR to the plugin Table Formatter.

Edit: PR is already created.

5 Likes

Is there a ready package to install / copy to the plugin folder?

Or maybe publish the CodeMirror module separately? Then each plugin can choose to integrate it or not (I think it would be good for Rich Markdown too), or we may even integrate it to the app.

5 Likes

It sounds good. I will try to package it as a CodeMirror module once I figure out what a standard npm package looks like.

You can get the packaged plugin file *.jpl from Releases ยท SeptemberHX/joplin-plugin-enhancement ยท GitHub

1 Like

this is the best so far. waiting since years for resizing pictures. thanks so much.
btw. there is another "folder" machanism plugin: Persistent text folding in editor and also a table sorter: GitHub - hieuthi/joplin-plugin-markdown-table-sortable: Add the ability to sort rendered tables on the fly

Any plans to add this to the plugin list, so it would be installable directly from the app?

1 Like

Yes, I have noticed these two plugins before I tried to implement this one. I think 'Persistent text folding plugin' is used to fold one section under a header, but I just want to fold the mermaid code block;

And the 'joplin-plugin-markdown-table-sortable' aims to sort markdown table. This plugin tries to format the table: make it aligned by '|' character in the editor. This plugin also helps to navigate between cells, add row/column, and remove column in the editor.

Not sure I published the plugin in the right way. I just followed Official Joplin plugin repository is now ready! If you are developing a plugin please read on and run npm publish minutes ago.

2 Likes

Which cookie I've to copy to use the Readcube Papers part?

Bildschirmfoto 2022-05-21 um 12.59.35

Not sure which one exactly. When I inspect the Papers' webapp, all the four cookies are used in each requests to the Papers' server. But I am sure that the first three are set after signing in, so I guess we only need the first three.

For me, I copied all the four cookies.

If you are trying to use the Papers feature, please make sure that you get the plugin >= v0.6.2. Some incompatible changes were happened.