Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support markdown tables in objects #1794

Closed
jfudickar opened this issue Jan 2, 2024 · 8 comments
Closed

Support markdown tables in objects #1794

jfudickar opened this issue Jan 2, 2024 · 8 comments

Comments

@jfudickar
Copy link

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

@cyborg-ts cyborg-ts added this to D2 Jan 2, 2024
@alixander
Copy link
Collaborator

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

@jfudickar
Copy link
Author

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
Copy link
Author

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.

@jfudickar
Copy link
Author

Did you have an idea how I can make the height of the lines smaller?

@alixander
Copy link
Collaborator

Tables will fall into markdown so this issue continues here: #2220

@alixander alixander closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@github-project-automation github-project-automation bot moved this to Done in D2 Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants