Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cli: add format flag to support PNG output to stdout - #2291

Merged
alixander merged 3 commits into
d2lang:masterfrom
Maricaya:output-png
Jan 17, 2025
Merged

cli: add format flag to support PNG output to stdout #2291
alixander merged 3 commits into
d2lang:masterfrom
Maricaya:output-png

Conversation

@Maricaya

Copy link
Copy Markdown
Contributor

Add --format flag to enable PNG output to stdout, allowing users to pipe D2 diagram output in PNG format to other tools.

Changes:

  • Add format flag support for PNG output to stdout
  • Add test cases for format flag handling
  • Update getOutputFormat to handle format flags properly

Example usage:

d2 input.d2 --stdout-format png -

Test: ./make.sh test

image

@Maricaya Maricaya changed the title cli: add format flag to support PNG output to stdout (same as https://github.com/terrastruct/d2/pull/2257) cli: add format flag to support PNG output to stdout Jan 14, 2025
@Maricaya

Maricaya commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

hi @alixander I am so sorry. I accidentally messed up the last PR during the git rebase, so I created a new PR to fix it. the last one is
#2257

@alixander alixander left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 lgtm. Thank you for doing this!

@alixander
alixander merged commit 6f0287d into d2lang:master Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants