zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.18k stars 1.9k forks source link

[Feature Request] Spreadsheets embedded in notes like notion #1841

Open surajsharma opened 3 years ago

surajsharma commented 3 years ago

I would very much like if I could have a spreadsheet inside a note. can volunteer to add the PR myself if encouraged

zadam commented 3 years ago

Hi, I have thought about that since yeah, it would be pretty cool. Developing spreadsheet is probably way too much to do in this project so we'd have to use some existing library. There's a bunch of them with a range of features and licenses. Some of them are pretty small and light (e.g. jSpreadsheet), some of them very large and complex (AG Grid).

It would be good to start with thinking about which features are we actually targetting.

surajsharma commented 3 years ago

oh jSpreadsheet used to be called jExcel, they have since changed their name, I have used this in another project, yes it is pretty small and efficient at what it does.

aihuasxy commented 3 years ago

Luckysheet is another alterative js sheet, looks cool! https://github.com/mengshukeji/Luckysheet

surajsharma commented 3 years ago

definitely a great find, how could one go about adding it in? if you could give a basic outline, I will try and make a PR

chee commented 3 years ago

Will a spreadsheet be a new type of note? And will the data from it be usable in a script note?

surajsharma commented 3 years ago

Yes, and Yes ... i think?

zadam commented 3 years ago

Will a spreadsheet be a new type of note

Probably yes even though it does also have disadvantages. On one hand I like how e.g. CKeditor does it in their paid plugin that it integrates into the larger document. On the other hand especially for e.g. script processing it's better to have tables separate. It might be possible to still include the table from a separate note into the text document via "include note" but then it will be probably read only in the text document and editable only from the spreadsheet note.

And will the data from it be usable in a script note?

Ideally the spreadsheet data would be JSON and thus easy to process in the script.

definitely a great find, how could one go about adding it in? if you could give a basic outline, I will try and make a PR

Experimentation is great, but otherwise I'm not likely to accept such a PR so quickly. For me adding a spreadsheet plugin is a big commitment regarding the features, data format, long term viability. So I'd like to do some serious research into available libraries first and figure out what would be the best.

martinkoutecky commented 3 years ago

One thing I love about notion's spreadsheets is that they are light-weight databases, so there's a column type which links to some other table, and one selects the values in this column to be rows of the linked table. (Similar as Airtable or Seatable.) This is incredibly helpful and once you see it, quite natural (and addictive). Not sure any of the mentioned plugins have this kind of functionality, and how it would play out in Trilium, but it would be super cool to have something like that.

surajsharma commented 3 years ago

and how it would play out in Trilium

oh thats nice! i didn't know Notion had such a feature. Trilium could certainly do with this! However, it might not be for the same reasons or same purposes even. The idea here is not to make Trilium more like Notion but to augment the feature list, in a way that is consistent with the software's essence (how much a knowledge base should mimic personal organizer?) . Honestly, when I opened this issue, I was merely looking for a simple spreadsheet note type without the bells and whistles.

to @zadam's notes above, i definitely agree, not a trivial decision. JSON is the way to go definitely and also, writing such a plugin from scratch can be considered if there is some extra benefit from doing it.

chee commented 3 years ago

I think that relates to this issue: https://github.com/zadam/trilium/issues/822

zadam commented 3 years ago

One thing I love about notion's spreadsheets is that they are light-weight databases, so there's a column type which links to some other table, and one selects the values in this column to be rows of the linked table. (Similar as Airtable or Seatable.)

If I understand this correctly then this is supported by some of the more advanced plugins within one spreadsheet between different lists (so just like in Excel).

My goals here are rather modest - the chosen plugin should work in Trilium mostly as designed and its integration into Trilium should be mainly a question of data storage (versioning, sync etc.) I don't plan advanced integration between spreadsheet and rest of Trilium, even basic things like being able to link a note or image from a spreadsheet will be probably challenging. This also depends on the plugin architecture - i.e. is it itself pluggable or do I need to hard-fork it to change things?

surajsharma commented 3 years ago

I don't plan advanced integration between spreadsheet and rest of Trilium, even basic things like being able to link a note or image from a spreadsheet will be probably challenging.

indeed, but i think spreadsheet-to-spreadsheet connectivity should still be relatively less complex to implement. i really don't like notion for some odd reason even though all these entrepreneur types swear by it these days...

Rsose commented 3 years ago

Wow great idea! If we can directly implement some simple math formulas in Trilium Notes inside that would be very nice. Optimize the Table function by adding a spreadsheet to it, so that the data table can be fully implemented in Trilium Notes. Just think of using Trilium tables to generate all kinds of calculation data tables(or another way to realize it),it will be better to manage my spreadsheets, cos I use excel to generate them, the main problem is that the files is more difficult to manage up. Sometimes I generate a lot of excel files, after a while it is easy to forget where they put! I recently wanted to submit a similar ISSUE and found that it was mentioned in this question. If there is no spreadsheet in Trilium, I need to generate it from Excel and import it to trilium.That's a lot of steps, not convenient. Of course, the best choice is to put them in trilium 👍

lucamarletta commented 2 years ago

I'd love this feature too. I'd like as well the possibility to save it as all formats as for other notes,: md, pdf ecc.. I could take notes of some simple bills, just like that. If one needs a complex table with Math formulas can just open LibreOffice.

good-praxis commented 2 years ago

For the time being, is there a way to programmatically generate a dynamic table in CKEditor? Say, I want a table that aggregates all child notes with their promoted attributes visible to compare? although sorting on click and the like is out of the question

zadam commented 2 years ago

@good-praxis Scripting would be a way to achieve this.

finzzz commented 2 years ago

Rather than reinventing new stuff, is it possible to integrate it with something like nocodb or baserow?

ghost commented 1 year ago

Any updates?

TheOneValen commented 1 year ago

Rather than reinventing new stuff, is it possible to integrate it with something like nocodb or baserow?

Intergation with nocodb. e.g. via the api would be awesome.

jwest75674 commented 1 year ago

My use case would benefit from the ability to add a spreadsheet into an existing text note, like how we can add a table of varying row counts and column counts.

Specifically, when taking notes, I often need to do some simple math to keep everything clear later of how I can do specific numbers or with a calculator open independently. It would be great to get the math done inside a table!

In its simplest form, adding the ability to do basic arithmetic to the existing table functionality would be enough for my needs, and could avoid some of the complexity some of the previously proposed paths would likely entail. Basic stuff, multiplication, division, addition, subtraction, etc.

zadam commented 1 year ago

Recently also discussed in https://github.com/zadam/trilium/issues/410