d2
d2 copied to clipboard
Support markdown tables in objects
I want to document content of json files with D2.
In plantuml I can use something like this: `@startuml
class "rocket Falcon 1" as 5e9d0d95eda69955f709d1eb << (R,orange) hardware >> { rocket |= attribute |= value | | active | false | | boosters | 0 | | company | SpaceX | | cost_per_launch | 6700000 | | country | Republic of the Marshall Islands | | first_flight | 2006-03-24 | | id | 5e9d0d95eda69955f709d1eb | | name | Falcon 1 | | stages | 2 | | success_rate_pct | 40 | | type | rocket | } class "payload" as payload_5e9d0d95eda69955f709d1eb_1 << (P,orange) hardware >> { payload |= attribute |= value | | option_1 | composite fairing | } 5e9d0d95eda69955f709d1eb --> payload_5e9d0d95eda69955f709d1eb_1:payloads
@enduml`
In D2 there is as far as I can see in the moment an option to use markdown tables
This would be very helpful.
Further Idea's can be found here : https://github.com/jfudickar/json2puml
You can just repurpose tables for this: https://d2lang.com/tour/sql-tables/
or just use JSON blocks directly: https://play.d2lang.com/?script=qrBSqMkqzs_jqlbITS0qqrRSSM4oyiwuyU0sVqjlquECBAAA__8%3D&
Does that work? @jfudickar
I thought about that before, but sadly not. That was the same way I started with plantuml.
But I need the option to have more then two columns. And I'm not shure what happens with the sqltable if you would have a long value (which will then be the datatype).
One other example you can see here: https://github.com/jfudickar/json2puml/blob/main/documentation/images/spacex_launch/spacex_launch_latest.launch-crew-rocket.png
@jfudickar Can you use grids?
https://play.d2lang.com/?script=dMzhSsQwEATg__sUQ38KHjYB8fZlStLbq5E0PZLdAxHfXRIQEfTf7A7zvbWjMKYJHwRsNV0et3BjPH1f65FtL43hCXg4NX3PcopHvjCuITchAm6hStFfnVYTAuZlZkyYCHA_0feor9WaLvewmu1dCao1RVP5G3KMaLUsmnZZmqyDdAwpWyrSBusYKV47dg_Z_oE8Y352Y-4Z5zHsvxfvz87TJ30FAAD__w%3D%3D&
In principle yes, I will have to look into. For example can I make the height of the rows smaller, this is very space consuming and not so good to read.
Did you have an idea how I can make the height of the lines smaller?
https://play.d2lang.com/?script=dM9RasMwEATQf51i8GegoZZKafYyRnY2toosB2k3pYTcvUhgSqH5G42YB_tZtkToOtwNMOdwfpn9lfC6v6Yt6poKwe1N3r4K4c0Ah2OR78jHcYtnwsXHwsYAV585yZ8_ycoG6Iee0KEzgP2NrkZZshYZbn5SXaviRXIYVfh_yBJGzWmQsPJQeGqkJXCaQ-LSWEsI46ViNx_1CeQI_bttc0c4tWHtPpw72Xr0gXBfOMyLEPqHeZifAAAA__8%3D&
i want to write a table in Markdown because I find Markup problematic on D2. https://play.d2lang.com/?l=&script=SsvPT0osquZSUEgvykzRLcovL7ZSMLSG8ZPzc0pz81CE0hMLrBQMQNzcFKuaBC4FBZuSxKScVIWk_KKU1CJbJUMlheTUnJzigsTkzLx0WyUDCL8gMSUFzDdWsgNrKrKzKUmxqwABG_2SFPJ5-iVFoyYOahP1wSkEzEwq0qcFnVDDpaBQywUIAAD__w%3D%3D&