Update cheatsheets

This commit is contained in:
ivuorinen
2024-05-19 00:15:19 +00:00
parent e51f0de5d2
commit be266d6567
2 changed files with 10 additions and 9 deletions

11
tldr/d2
View File

@@ -6,15 +6,16 @@ source: https://github.com/tldr-pages/tldr.git
# 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:
@@ -26,8 +27,8 @@ source: https://github.com/tldr-pages/tldr.git
- 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}}`