A wrapper over d2 which allows to use additional configs from d2 file
Find a file
2022-12-12 14:40:52 +03:00
.gitignore initial commit 2022-12-12 14:32:40 +03:00
flake.lock initial commit 2022-12-12 14:32:40 +03:00
flake.nix initial commit 2022-12-12 14:32:40 +03:00
README.md fix docs 2022-12-12 14:40:52 +03:00
wd2 initial commit 2022-12-12 14:32:40 +03:00

Wrapped d2

A wrapper over d2 which allows to use `layout`, `theme`, `pad` attributes from d2 file. All arguments will be passed to the d2 cli, but these additional configs overwrite cli arguments with the same name.

Install

Nix Flake

This repo is also packaged via Nix flakes, the package is available through the default flake output github:pleshevskiy/wd2 with the path bin/wd2.

You can enable flakes support in your nix configuration, and then run nix profile install github:pleshevskiy/wd2 to get wd2 installed. You can also use this repository as a flake input and add its output to your own flake-managed systemwide or home configuration.

Other

Copy wd2 script to /usr/local/bin folder.

Usage

Create a d2 file with additional configs at the top.

# layout: elk
# theme: 101
# pad: 5

x -> y -> z

Then run the wd2 script

wd2 -w path/to/your/file.d2