Skip to content

Commit

Permalink
d2: update page (#12799)
Browse files Browse the repository at this point in the history
  • Loading branch information
kant committed May 18, 2024
1 parent 05d8c44 commit d80f835
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pages/common/d2.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# d2

> A modern diagram scripting language that turns text to diagrams.
> Note: the output file supports SVG and PNG file formats.
> More information: <https://d2lang.com/tour/man>.
- Compile and render a D2 source file into an SVG or PNG file:
- Compile and render a D2 source file into an output file:

`d2 {{path/to/input_file.d2}} {{path/to/output_file.svg|path/to/output_file.png}}`
`d2 {{path/to/input_file.d2}} {{path/to/output_file.ext}}`

- [w]atch live changes made to a D2 source file in the default web browser:

`d2 --watch {{path/to/input_file.d2}} {{path/to/output_file.svg|path/to/output_file.png}}`
`d2 --watch {{path/to/input_file.d2}} {{path/to/output_file.ext}}`

- Format a D2 source file:

Expand All @@ -21,8 +22,8 @@

- Use a different [t]heme for the output file (list available themes first to get the desired `theme_id`):

`d2 --theme {{theme_id}} {{path/to/input_file.d2}} {{path/to/output_file.svg|path/to/output_file.png}}`
`d2 --theme {{theme_id}} {{path/to/input_file.d2}} {{path/to/output_file.ext}}`

- Make rendered diagrams look like hand [s]ketches:

`d2 --sketch true {{path/to/input_file.d2}} {{path/to/output_file.svg|path/to/output_file.png}}`
`d2 --sketch true {{path/to/input_file.d2}} {{path/to/output_file.ext}}`

0 comments on commit d80f835

Please sign in to comment.