markbind icon indicating copy to clipboard operation
markbind copied to clipboard

Better support for tables

Open damithc opened this issue 6 years ago • 10 comments

Current: we support GFMD syntax for tables Suggestions for improvements:

  • Ability to use more complex tables such as merged cells e.g., https://www.npmjs.com/package/markdown-it-multimd-table
  • Ability to create a table based on content in a csv file
  • Ability to sort columns
  • Ability to specify larger amounts and different varieties of content for a cell (e.g., a panel within a cell)

damithc avatar Jun 26 '19 12:06 damithc

just a note: markdown-it-multimd-table's multiline feature (using \ to continue lines) is wildly incompatible with our current process unfortunately, as we parse html before markdown. It would require a significant architectural change and breaking footnotes to accomodate it. It is toggleable though, so if the other features have no conflict we could still look to replace gfmd table with it

ang-zeyu avatar Jun 12 '20 12:06 ang-zeyu

I think asciidoc has a more powerful tables syntax. Of course unlikely we can reuse their parser but we can get some inspiration for the syntax.

Would using our own tag (like <puml>) to surround the table content allow us to use an entirely different syntax and parse it at a later stage? Not sure about the technical side but I had a feeling that @crphang was aiming for that kind of flexibility to use different syntax schemes for different components.

damithc avatar Jun 12 '20 12:06 damithc

unfortunately not as well, as you'd end up still having to parse the html inside the tag. (since tables can contain html) The ability to treat custom tags like script/style tags is more apt for an proprietary syntax, like puml.

ang-zeyu avatar Jun 12 '20 13:06 ang-zeyu

unfortunately not as well, as you'd end up still having to parse the html inside the tag. (since tables can contain html) The ability to treat custom tags like script/style tags is more apt for an proprietary syntax, like puml.

Yes, that's true.

damithc avatar Jun 12 '20 13:06 damithc

possible with processing order change in #1403

ang-zeyu avatar Dec 06 '20 10:12 ang-zeyu

Will work on adding a table component that has a "src" attribute pointing to relative path to then csv file. Will try make the component to extensible.

yiwen101 avatar Feb 15 '24 16:02 yiwen101

I will look into enabling asciidoc syntax for tables. It seems possible with the current pipeline.

Tim-Siu avatar Feb 27 '24 10:02 Tim-Siu

I am currently working on a baseline implementation that puts ASciidoc tables in a special tag like <table-pro>. It will then be processed by a plugin that works similarly to the PlantUML support. Users will have to download Asciidoctor first and then the plugin will use Asciidoctor to generate HTML from the Asciidoc syntax.

Tim-Siu avatar Mar 04 '24 04:03 Tim-Siu

Users will have to download Asciidoctor first and then the plugin will use Asciidoctor to generate HTML from the Asciidoc syntax.

It's best if users don't have do to extra work for this, unless unavoidable.

damithc avatar Mar 04 '24 07:03 damithc

As discussed with Prof. Damith, the two features of priority would be:

  1. Making table sortable.
  2. Adding filtering functionality.

More specifically, filtering refers to having a search bar for the table. A specific use case would be the student progress page for CS2103/T.

Tim-Siu avatar Mar 11 '24 14:03 Tim-Siu