"Table" - Format

Schlammkrabbe
Posts: 2
Joined: 21.09.2023 14:03

"Table" - Format

Post 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.
main Alexey
Posts: 2269
Joined: 25.08.2021 18:15

Re: "Table" - Format

Post 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.
miro.matas
Posts: 67
Joined: 26.08.2013 06:16

Re: "Table" - Format

Post by miro.matas »

possible via Markdown + some plugins…
Attachments
1min08sec.zip
(4.84 MiB) Downloaded 78 times
main Alexey
Posts: 2269
Joined: 25.08.2021 18:15

Re: "Table" - Format

Post by main Alexey »

Markdown don't allow aligned editing of table, none of text formats allow this of course.
Schlammkrabbe
Posts: 2
Joined: 21.09.2023 14:03

Re: "Table" - Format

Post 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.
main Alexey
Posts: 2269
Joined: 25.08.2021 18:15

Re: "Table" - Format

Post 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.
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: "Table" - Format

Post 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!
main Alexey
Posts: 2269
Joined: 25.08.2021 18:15

Re: "Table" - Format

Post by main Alexey »

Plugin 'Markdown Table Format' was converted to CudaFormatter's formatter: 'Markdown Tables'.
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: "Table" - Format

Post 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!
main Alexey
Posts: 2269
Joined: 25.08.2021 18:15

Re: "Table" - Format

Post 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
Post Reply