+
+
https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8f85-0bbfca0c6e2a.mp4
@@ -33,9 +38,8 @@ https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8
- Contributing
- License
- Related
- - VSCode extension
- - Vim extension
- - Language docs
+ - Official plugins
+ - Community plugins
- Misc
- FAQ
@@ -206,13 +210,11 @@ let us know and we'll be happy to include it here!
- **Telegram bot**: [https://github.com/meinside/telegram-d2-bot](https://github.com/meinside/telegram-d2-bot)
- **Postgres importer**: [https://github.com/zekenie/d2-erd-from-postgres](https://github.com/zekenie/d2-erd-from-postgres)
-### Language docs
-
-[https://github.com/terrastruct/d2-docs](https://github.com/terrastruct/d2-docs)
-
### Misc
-- [https://github.com/terrastruct/text-to-diagram-site](https://github.com/terrastruct/text-to-diagram-site)
+- **Comparison site**: [https://github.com/terrastruct/text-to-diagram-site](https://github.com/terrastruct/text-to-diagram-site)
+- **Playground**: [https://github.com/terrastruct/d2-playground](https://github.com/terrastruct/d2-playground)
+- **Language docs**: [https://github.com/terrastruct/d2-docs](https://github.com/terrastruct/d2-docs)
## FAQ
diff --git a/ci/release/Dockerfile b/ci/release/Dockerfile
new file mode 100644
index 000000000..d195fa05b
--- /dev/null
+++ b/ci/release/Dockerfile
@@ -0,0 +1,18 @@
+# https://hub.docker.com/repository/docker/terrastruct/d2
+FROM debian:latest
+
+ARG TARGETARCH
+
+COPY ./d2-*-linux-$TARGETARCH.tar.gz /tmp
+RUN mkdir -p /usr/local/lib/d2 \
+ && tar -C /usr/local/lib/d2 -xzf /tmp/d2-*-linux-"$TARGETARCH".tar.gz \
+ && /usr/local/lib/d2/d2-*/scripts/install.sh \
+ && rm -Rf /tmp/d2-*-linux-"$TARGETARCH".tar.gz
+
+WORKDIR /root/src
+EXPOSE 8080
+ENV PORT 8080
+ENV HOST 0.0.0.0
+ENV BROWSER false
+
+ENTRYPOINT ["/usr/local/bin/d2"]
diff --git a/ci/release/README.md b/ci/release/README.md
index 4530983e4..4f8b1a56d 100644
--- a/ci/release/README.md
+++ b/ci/release/README.md
@@ -2,7 +2,7 @@
## _install.sh
-The template for the install script in the root of the repository.
+The template for the install script in the root of the d2 repository.
### gen_install.sh
@@ -23,12 +23,12 @@ it depends on from ../sub/lib.
> variables as we must compile d2 directly on each release target to include dagre.
> See https://github.com/terrastruct/d2/issues/31
-Use `--host-only` to build only the release for the host's OS-ARCH pair.
+Use `--host-only` to build only the release for the host's `$OS-$ARCH` pair.
### build_docker.sh
Helper script called by build.sh to build D2 on each linux runner inside Docker.
-The Dockerfile is in ./builders/Dockerfile
+The Dockerfile is in ./linux/Dockerfile
### _build.sh
diff --git a/ci/release/aws/ensure.sh b/ci/release/aws/ensure.sh
new file mode 100755
index 000000000..d78d58162
--- /dev/null
+++ b/ci/release/aws/ensure.sh
@@ -0,0 +1,545 @@
+#!/bin/sh
+set -eu
+. "$(dirname "$0")/../../../ci/sub/lib.sh"
+cd -- "$(dirname "$0")/../../.."
+
+help() {
+ cat <
-We recommend using [MSYS2](https://www.msys2.org/) or [Git
-Bash](https://gitforwindows.org/#bash) (Git Bash is based on MSYS2) for an improved
-terminal experience.
+See [MSYS2](https://www.msys2.org/) or [Git Bash](https://gitforwindows.org/#bash) (Git
+Bash is based on MSYS2).
MSYS2 provides a unix style shell environment that is native to Windows (unlike
[Cygwin](https://www.cygwin.com/)). MSYS2 allows `install.sh` to work, enables automatic
@@ -216,9 +209,23 @@ under plain Windows.
aka Windows Subsystem for Linux if that's what you prefer. Installation is just like any
other Linux system.
+## Docker
+
+https://hub.docker.com/repository/docker/terrastruct/d2
+
+We publish `amd64` and `arm64` images based on `debian:latest` for each release.
+
+Example usage:
+
+```sh
+echo 'x -> y' >helloworld.d2
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/root/src" \
+ -p 127.0.0.1:8080:8080 terrastruct/d2 --watch helloworld.d2
+# Visit http://127.0.0.1:8080
+```
+
## Coming soon
-- Docker image
- rpm and deb packages
- with repositories and standalone
- homebrew core
diff --git a/docs/assets/playground_button.png b/docs/assets/playground_button.png
new file mode 100644
index 000000000..d4e496af0
Binary files /dev/null and b/docs/assets/playground_button.png differ
diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go
index 7c627be74..b9c2399f1 100644
--- a/e2etests/regression_test.go
+++ b/e2etests/regression_test.go
@@ -40,6 +40,18 @@ b.1 -> b.1`,
a: A
b: B`,
},
+ {
+ name: "sequence_diagram_name_crash",
+ script: `foo: {
+ shape: sequence_diagram
+ a -> b
+}
+foobar: {
+ shape: sequence_diagram
+ c -> d
+}
+foo -> foobar`,
+ },
}
runa(t, tcs)
diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go
index 29eeb130b..76f4cf12a 100644
--- a/e2etests/stable_test.go
+++ b/e2etests/stable_test.go
@@ -917,12 +917,13 @@ y: {
}
}
-x -> y: {
+x -> y: in style {
style: {
stroke: green
opacity: 0.5
stroke-width: 2
stroke-dash: 5
+ fill: lavender
}
}
`,
@@ -1041,6 +1042,7 @@ size S -> size M: custom 15 {
}
size XXXL -> custom 64: custom 48 {
style.font-size: 48
+ style.fill: lavender
}
`,
}, {
@@ -1481,6 +1483,36 @@ a.note: "just\na\nlong\nnote\nhere"`,
script: `shape: sequence_diagram
alice -> bob: what does it mean to be well-adjusted
bob -> alice: The ability to play bridge or golf as if they were games
+`,
+ },
+ {
+ name: "markdown_stroke_fill",
+ script: `
+container.md: |md
+# a header
+
+a line of text and an
+
+ {
+ indented: "block",
+ of: "json",
+ }
+
+walk into a bar.
+| {
+ style.stroke: darkorange
+}
+
+container -> no container
+
+no container: |md
+they did it in style
+|
+
+no container.style: {
+ stroke: red
+ fill: "#CEEDEE"
+}
`,
},
}
diff --git a/e2etests/testdata/regression/dagre_special_ids/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_special_ids/dagre/sketch.exp.svg
index 1fcf71c22..f7a7922d5 100644
--- a/e2etests/testdata/regression/dagre_special_ids/dagre/sketch.exp.svg
+++ b/e2etests/testdata/regression/dagre_special_ids/dagre/sketch.exp.svg
@@ -18,7 +18,10 @@ width="1427" height="568" viewBox="-100 -100 1427 568">nn
-gg
-ee
-nn
+gg
+ee
+nn
-gg
-ee
-nn
+gg
+ee
+Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:
-Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:
-Note: This document is itself written using Markdown; you
+ Note: This document is itself written using Markdown; you
can see the source for it by adding '.text' to the URL. Note: This document is itself written using Markdown; you
+ Note: This document is itself written using Markdown; you
can see the source for it by adding '.text' to the URL. List items may consist of multiple paragraphs. Each subsequent
+ List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab: Another item in the same list. List items may consist of multiple paragraphs. Each subsequent
+ List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab: Another item in the same list. Festivity Level 1: Your guests are chatting amiably with each other. Festivity Level 1: Your guests are chatting amiably with each other. they did it in style a line of text and an walk into a bar. Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, Lorem ipsum dolor sit amet, consectetur adipiscing elit, a line of text and an a line of text and an a line of text and an a line of text and an A paragraph is simply one or more consecutive lines of text, separated
+ A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line -- a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs. A paragraph is simply one or more consecutive lines of text, separated
+ A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line -- a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs. Here is an example of AppleScript: Here is an example of AppleScript: A code block continues until it reaches a line that is not indented
(or the end of the article). Here is an example of AppleScript: Here is an example of AppleScript: A code block continues until it reaches a line that is not indented
(or the end of the article).
Overview
-
Overview
-
+
+
+
+
+
+
@@ -805,7 +805,10 @@ sit amet, consectetuer adipiscing elit.
@@ -805,7 +805,10 @@ sit amet, consectetuer adipiscing elit.
Markdown: Syntax
-Markdown: Syntax
+Markdown: Syntax
-Markdown: Syntax
+Every frustum longs to be a cone
+Every frustum longs to be a cone
Every frustum longs to be a cone
+Every frustum longs to be a cone
a header
+
+{
+ indented: "block",
+ of: "json",
+}
+
+
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{
+
-{
fenced: "block",
of: "json",
}
{
+
-{
fenced: "block",
of: "json",
}
-{
indented: "block",
of: "json",
}
-{
indented: "block",
of: "json",
}
codecodecodecodetell application "Foo"
beep
end tell
tell application "Foo"
beep
end tell