It used markdown-it and the mighty formula-parser (although nowadays there's the package hyperformula from the same folks, which claims to have "a high-performance").
Usage
To define a set of table formulas, you can add a special HTML comment in a table cell.
Formulas are calculated in the order they are written. Table cells are described using spreadsheet notation, columns designated with letters like A,B,C .. Z (and even more AA, AB etc.) and rows with integers 1,2,3 ... You can also use range notation like A1:E23. Moreover, hot-formula-parser contains also a big set of predefined functions which can be used in formulas.
Personally I do not like inline formulas in cells.
I think it's much more readable and less work to just write your formulas in a dedicated area (first line after the table). Otherwise the formatting of the table will look messy, unless you don't care how they look in markdown. (I usually format them properly.)
| Column A | Column B | Column C |
|:---------|:---------|:---------|
| 123 | 456 | 789 |
| 0 | 0 | 0 |
<!--f A3=A1+A2; B3=B1; C3=SUM(C1:C2) -->
I don't know, maybe it's even possible to support both.
Thanks. I will do it, however I need to resolve one problem and for that I suppose I need some advice.
After the table processing, I'm preparing a new note body with calculated values in all tables. As I've seen from the plugin API, I could replace the note body with this "calculated version", but so far I was not able to get expected result.
I've tried two approaches:
Your second approach would be preferable when you simply want to edit the currently opened note. But I will add a "setText" command to directly set the content of the complete note, and will also check why textSelectAll is not working.
Looks like CodeMirror object is simply missing textSelectAll command. I would propose to add following lines to app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx: