d2
d2 copied to clipboard
markdown: Tables
Currently tables within markdown are not supported. Need to hand-measure these https://github.com/terrastruct/d2/blob/master/d2renderers/textmeasure/markdown.go
sql_table shape won't suffice because it doesn't support multiple columns
https://discord.com/channels/1039184639652265985/1039184640285610147/1054867819256361060
perhaps d2 should have a native shape type for this. sql_table_data
. seems quite common in practice for people to want to show a sample
I would name it not sql_data_table because it could be handy to use it for multiple purpose. But I would be happy to see something like this!!
ohhh wait, we can just use grid with 0 gap for these! @gavin-ts . that'd be a great use case
https://github.com/terrastruct/d2/pull/1178
that could work but it might be tricky to fit it into other markdown elements. I wonder why it isn't currently working, we may just need to update the measurement logic to consider tables correctly
to be clear, for this issue I think we are talking about:
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
producing:
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
no i was just talking about representing tables in general. if we have such an option natively in D2, there's no need or a much lower priority to support it in markdown
oh okay that makes sense with the comment about having a native shape for tables
I think a gap: 0
grid with rows and columns specified does indeed cover the table scenario
I want to draw diagrams similar to this: Sample
Currently I'm using PlantUML but I'm thinking of having an additional option using D2.
https://github.com/jfudickar/json2puml
https://play.d2lang.com/?l=&script=yk3NzbeqyU3hsilJTMpJteOyKSmysylJsUvLz09KLLLRL0mxs9EvKbLjstGHqqjh4gIEAAD__w%3D%3D&