Skip to content

Commit c1cac16

Browse files
committed
update man
1 parent 019b47d commit c1cac16

File tree

1 file changed

+102
-3
lines changed

1 file changed

+102
-3
lines changed

docs/tour/man.md

+102-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ NAME
1414
d2 – compiles and renders d2 diagrams into svgs.
1515
1616
SYNOPSIS
17-
d2 [--watch false] [--theme 0] file.d2 [file.svg | file.png]
17+
d2 [--watch false] [--theme 0] [--salt string] file.d2
18+
[file.svg | file.png]
1819
d2 layout [name]
1920
d2 fmt file.d2 ...
21+
d2 play file.d2
22+
d2 validate file.d2
2023
2124
DESCRIPTION
2225
d2 compiles and renders file.d2 to file.svg | file.png.
@@ -88,7 +91,7 @@ OPTIONS
8891
--animate-interval 0
8992
If given, multiple boards are packaged as 1 SVG which
9093
transitions through each board at the interval (in
91-
milliseconds). Can only be used with SVG exports.
94+
milliseconds). Can only be used with SVG and GIF exports.
9295
9396
--browser true
9497
Browser executable that watch opens. Setting to 0 opens no
@@ -125,11 +128,30 @@ OPTIONS
125128
out and exiting. When rendering a large diagram, it is
126129
recommended to increase this value.
127130
131+
--check false
132+
Check that the specified files are formatted correctly.
133+
134+
--salt string
135+
Add a salt value to ensure the output uses unique IDs. This
136+
is useful when generating multiple identical diagrams to be
137+
included in the same HTML doc, so that duplicate id's do not
138+
cause invalid HTML. The salt value is a string that will be
139+
appended to IDs in the output..
140+
128141
-h, --help Print usage information and exit.
129142
130143
-v, --version
131144
Print version information and exit.
132145
146+
--stdout-format string
147+
Set the output format when writing to stdout. Supported
148+
formats are: png, svg. Only used when output is set to stdout
149+
(-).
150+
151+
--no-xml-tag false
152+
Omit XML tag (<?xml ...?>) from output SVG files. Useful when
153+
generating SVGs for direct HTML embedding.
154+
133155
SUBCOMMANDS
134156
layout Lists available layout engine options with short help.
135157
@@ -140,11 +162,88 @@ SUBCOMMANDS
140162
themes Lists available themes.
141163
142164
fmt file.d2 ...
143-
Format all passed files.
165+
Format all passed files
166+
167+
play file.d2
168+
Opens the file in playground, an online web viewer
169+
(https://play.d2lang.com)
170+
171+
validate file.d2
172+
Validates file.d2
173+
174+
ENVIRONMENT VARIABLES
175+
Many flags can also be set with environment variables.
176+
177+
D2_WATCH
178+
See -w[atch] flag.
179+
180+
D2_LAYOUT
181+
See -l[ayout] flag.
182+
183+
D2_THEME
184+
See -t[heme] flag.
185+
186+
D2_DARK_THEME
187+
See --dark-theme flag.
188+
189+
D2_PAD See --pad flag.
190+
191+
D2_CENTER
192+
See --center flag.
193+
194+
D2_SKETCH
195+
See -s[ketch] flag.
196+
197+
D2_BUNDLE
198+
See -b[undle] flag.
199+
200+
D2_FORCE_APPENDIX
201+
See --force-appendix flag.
202+
203+
D2_FONT_REGULAR
204+
See --font-regular flag.
205+
206+
D2_FONT_ITALIC
207+
See --font-italic flag.
208+
209+
D2_FONT_BOLD
210+
See --font-bold flag.
211+
212+
D2_FONT_SEMIBOLD
213+
See --font-semibold flag.
214+
215+
D2_ANIMATE_INTERVAL
216+
See --animate-interval flag.
217+
218+
D2_TIMEOUT
219+
See --timeout flag.
220+
221+
D2_CHECK
222+
See --check flag.
223+
224+
DEBUG See -d[ebug] flag.
225+
226+
IMG_CACHE
227+
See --img-cache flag.
228+
229+
HOST See -h[ost] flag.
230+
231+
PORT See -p[ort] flag.
232+
233+
BROWSER
234+
See --browser flag.
235+
236+
D2_STDOUT_FORMAT
237+
See --stdout-format flag.
238+
239+
D2_NO_XML_TAG
240+
See --no-xml-tag flag.
144241
145242
SEE ALSO
146243
d2plugin-tala(1)
147244
148245
AUTHORS
149246
Terrastruct Inc.
247+
248+
macOS 14.1 March 12, 2025 macOS 14.1
150249
```

0 commit comments

Comments
 (0)