Page 1 of 2

"Table" - Format

Posted: 21.09.2023 14:24
by Schlammkrabbe
Hello,

I have the following issue: There is a good amout of file formats (most notably .csv) which use plain-text to store table-data.
This always results in one out of two:
- If no formatting other than the separator is used, the files are unreadable with common text-editors, despite being plain-text, because the columns are not aligned.
- If (usually whitespace-) formatting is used to make it readable then the effort to maintain formatting quickly explodes with filesize to the point where files must be written through some formatting-script.

So what i'd like is a text-editor capable of displaying plain-text-table-files as actual tables, given a separator. It does not need to be fancy, we have Excel for fancy. Simply lining up the separators vertically would be enough. Since i already use CudaText and like it very much i was wondering if it's possible to implement such a feature. Preferably such that it can be associated with a lexer and supporting arbitrary separators.

Re: "Table" - Format

Posted: 21.09.2023 16:38
by main Alexey
such aligning is not possible, Cud is not a table-editor, sorry.
this table-editing will need big rework of the editor base.
but we have the plugin 'CSV Helper' which makes nice coloring of CSV and TSV (tab-separated values) files.

Re: "Table" - Format

Posted: 21.09.2023 20:22
by miro.matas
possible via Markdown + some plugins…

Re: "Table" - Format

Posted: 22.09.2023 10:13
by main Alexey
Markdown don't allow aligned editing of table, none of text formats allow this of course.

Re: "Table" - Format

Posted: 22.09.2023 10:41
by Schlammkrabbe
I feared it would be beyond a simple plugin or easy rework...
I'll have to keep looking then. Or try writing something myself.

Re: "Table" - Format

Posted: 22.09.2023 10:57
by main Alexey
what you can do with plugin API: make a _modal_ dialog (over the editor) which can have 'listview' control (looks like a table). listview control don't give the editing of table cells, only viewing. so dialog will be very limited.

Im not sure we need the 'grid' control in our API, noone was needing that. 'grid' control is much much more good for tables and gives the editing.

'grid' control is what the 'Edit / Char Map' dialog is using.

Re: "Table" - Format

Posted: 30.09.2023 09:28
by SamC
miro.matas wrote: 21.09.2023 20:22 possible via Markdown + some plugins…
Hello, I can't find the plugin "Markdown Table Format" which is used in the video. Is it a published plugin for cudatext?
Thanks!

Re: "Table" - Format

Posted: 30.09.2023 09:31
by main Alexey
Plugin 'Markdown Table Format' was converted to CudaFormatter's formatter: 'Markdown Tables'.

Re: "Table" - Format

Posted: 30.09.2023 10:58
by SamC
main Alexey wrote: 30.09.2023 09:31 Plugin 'Markdown Table Format' was converted to CudaFormatter's formatter: 'Markdown Tables'.
Got it!
Is it possible to make this formater avilable for .txt format too? I can change the lexer at bottom, but if there is a more convenient way to use the formatter for more than one lexer?
Thanks!

Re: "Table" - Format

Posted: 30.09.2023 12:29
by main Alexey
1. why to use MARKDOWN formatter for .txt format? txt format is some random data.
2. but you can do it.

- install lexer "Text with indentation"
- assign Markdown formatter to this lexer. do it in the formatter's install.inf file (folder py/cuda_fmt_markdown_table).

Code: Select all

[fmt1]
caption=Markdown Table Format
method=do_format
lexers=Markdown,Text with indentation
config=cuda_markdown_table_format.json