add support of inline configuration
This commit is contained in:
parent
0dfdf72c10
commit
da8083fc80
2 changed files with 9 additions and 1 deletions
|
@ -40,6 +40,14 @@ Then run the `wd2` script
|
||||||
wd2 -w path/to/your/file.d2
|
wd2 -w path/to/your/file.d2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also use inline style to configure d2
|
||||||
|
|
||||||
|
```d2
|
||||||
|
# layout: elk; theme: 101; pad: 5
|
||||||
|
|
||||||
|
x -> y -> z
|
||||||
|
```
|
||||||
|
|
||||||
# Limitation
|
# Limitation
|
||||||
|
|
||||||
You have to restart the watch server when you change the `layout` / `theme` /
|
You have to restart the watch server when you change the `layout` / `theme` /
|
||||||
|
|
2
wd2
2
wd2
|
@ -48,7 +48,7 @@ function parse_args() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_attr_value() {
|
function get_attr_value() {
|
||||||
head -n3 "$d2_input_file" | grep "$1" | awk '{ print $3 }'
|
head -n3 "$d2_input_file" | grep "$1" | awk -F"$1: " '{ print $2 }' | cut -d';' -f1
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
|
|
Loading…
Reference in a new issue