Skip to content

Commit 35e46f5

Browse files
authored
Merge pull request #250 from terrastruct/0.6.9
0.6.9
2 parents 4bd0f57 + 7112cbc commit 35e46f5

File tree

171 files changed

+24326
-23176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+24326
-23176
lines changed

ci/render.sh

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ _bespoke() {
3333
sh_c d2 --sketch ./static/bespoke-d2/grid-nested-connections.d2 ./static/img/generated/grid-nested-connections.svg2
3434

3535
sh_c d2 --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/classes-3.d2 ./static/img/generated/classes-3.svg2
36+
37+
sh_c d2 -c --pad 50 ./static/bespoke-d2/styles-animated.d2 ./static/img/generated/styles-animated.svg2
3638
}
3739

3840
main() {

docs/releases/0.6.9.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#### Features 🚀
2+
3+
- Animations: `style.animated: true` is supported on shapes [#2250](https://github.com/terrastruct/d2/pull/2250)
4+
- Connections now support `link` [#1955](https://github.com/terrastruct/d2/pull/1955)
5+
- Vars: vars in markdown blocks are substituted [#2218](https://github.com/terrastruct/d2/pull/2218)
6+
- Markdown: Github-flavored tables work in `md` blocks [#2221](https://github.com/terrastruct/d2/pull/2221)
7+
- Render: adds box arrowheads [#2227](https://github.com/terrastruct/d2/issues/2227)
8+
- `d2 fmt` now supports a `--check` flag [#2253](https://github.com/terrastruct/d2/pull/2253)
9+
- CLI: PNG output to stdout is supported using `--stdout-format png -` [#2291](https://github.com/terrastruct/d2/pull/2291)
10+
- Globs: `&connected` and `&leaf` filters are implemented [#2299](https://github.com/terrastruct/d2/pull/2299)
11+
- CLI: add --no-xml-tag for direct HTML embedding [#2302](https://github.com/terrastruct/d2/pull/2302)
12+
- CLI: `play` cmd added for opening d2 input in online playground [#2242](https://github.com/terrastruct/d2/pull/2242)
13+
14+
#### Improvements 🧹
15+
16+
- Composition: links pointing to own board are purged [#2203](https://github.com/terrastruct/d2/pull/2203)
17+
- Syntax: reserved keywords must be unquoted [#2231](https://github.com/terrastruct/d2/pull/2231)
18+
- Latex: Backslashes in Latex blocks do not escape [#2232](https://github.com/terrastruct/d2/pull/2232)
19+
- This is a breaking change. Previously Latex blocks required escaping the backslash. So
20+
for older D2 versions, you should remove the excess backslashes.
21+
- Links: non-http url scheme links are supported (e.g. `x.link: vscode://file/`) [#2237](https://github.com/terrastruct/d2/issues/2237)
22+
- Compiler: reserved keywords with missing values error instead of silently doing nothing [#2251](https://github.com/terrastruct/d2/pull/2251)
23+
- Render: SVG outputs conform to stricter HTML standards, e.g. no duplicate ids [#2273](https://github.com/terrastruct/d2/issues/2273)
24+
- Themes: theme names are consistently cased [#2322](https://github.com/terrastruct/d2/pull/2322)
25+
- Nears: constant nears avoid collision with edge routes [#2327](https://github.com/terrastruct/d2/pull/2327)
26+
27+
#### Bugfixes ⛑️
28+
29+
- Imports: fixes using substitutions in `icon` values [#2207](https://github.com/terrastruct/d2/pull/2207)
30+
- Markdown: fixes ampersands in URLs in markdown [#2219](https://github.com/terrastruct/d2/pull/2219)
31+
- Globs: fixes edge case where globs with imported boards would create empty boards [#2247](https://github.com/terrastruct/d2/pull/2247)
32+
- Sequence diagrams: fixes alignment of notes when self messages are above it [#2264](https://github.com/terrastruct/d2/pull/2264)
33+
- Null: fixes `null`ing a connection with absolute syntax [#2318](https://github.com/terrastruct/d2/issues/2318)
34+
- Gradients: works with connection fills [#2326](https://github.com/terrastruct/d2/pull/2326)
35+
- Latex: fixes backslashes doubling on successive parses [#2328](https://github.com/terrastruct/d2/pull/2328)

docs/releases/intro.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
:::info Latest
44

5-
Version: [0.6.8](/releases/0.6.8) (released November 07, 2024)
5+
Version: [0.6.9](/releases/0.6.9) (released February 04, 2025)
66

7-
Downloads: [Assets](https://github.com/terrastruct/d2/releases/tag/v0.6.8)
7+
Downloads: [Assets](https://github.com/terrastruct/d2/releases/tag/v0.6.9)
88

99
:::
1010

docs/tour/connections.md

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ To override the default arrowhead shape or give a label next to arrowheads, defi
109109
- Can be further styled as `style.filled: true`.
110110
- `circle`
111111
- Can be further styled as `style.filled: true`.
112+
- `box`
113+
- Can be further styled as `style.filled: true`.
112114
- `cf-one`, `cf-one-required` (cf stands for crows foot)
113115
- `cf-many`, `cf-many-required`
114116
:::

docs/tour/globs.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import GlobsRecursive from '@site/static/d2/globs-recursive.d2';
1010
import GlobsRecursive2 from '@site/static/d2/globs-recursive-2.d2';
1111
import GlobsFilter from '@site/static/d2/globs-filter.d2';
1212
import GlobsFilter2 from '@site/static/d2/globs-filter-2.d2';
13+
import GlobsFilter3 from '@site/static/d2/globs-filter-3.d2';
1314
import GlobsFilterGlobValue from '@site/static/d2/globs-filter-glob-value.d2';
1415
import GlobsInverseFilter from '@site/static/d2/globs-inverse-filter.d2';
1516
import GlobsNested from '@site/static/d2/globs-nested.d2';
@@ -119,14 +120,28 @@ diagramming: it only applies to non-container (AKA leaf) shapes.
119120

120121
## Filters
121122

122-
Use `&` to filter what globs target.
123+
Use `&` to filter what globs target. You may use any reserved keyword to filter on.
123124

124125
<CodeBlock className="language-d2">
125126
{GlobsFilter}
126127
</CodeBlock>
127128

128129
<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-filter.svg2')}}></div>
129130

131+
### Property filters
132+
133+
Aside from reserved keywords, there are special property filters for more specific
134+
targeting.
135+
136+
- `connected: true|false`
137+
- `leaf: true|false`
138+
139+
<CodeBlock className="language-d2">
140+
{GlobsFilter3}
141+
</CodeBlock>
142+
143+
<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-filter-3.svg2')}}></div>
144+
130145
### Filters on array values
131146

132147
If the filtered attribute has an array value, the filter will match if it matches any

docs/tour/grid-diagrams.md

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import GridUnaligned from '@site/static/d2/grid-unaligned.d2';
1111
import GridAligned from '@site/static/d2/grid-aligned.d2';
1212
import GridPadding1 from '@site/static/d2/grid-padding-1.d2';
1313
import GridPadding2 from '@site/static/d2/grid-padding-2.d2';
14+
import MdTable from '@site/static/d2/md-table.d2';
1415

1516
# Grid Diagrams
1617

@@ -140,6 +141,17 @@ Setting `grid-gap` is equivalent to setting both `vertical-gap` and `horizontal-
140141
{Table}
141142
</CodeBlock>
142143

144+
:::info
145+
You may find it easier to just use Markdown tables though, especially if there are
146+
duplicate cells.
147+
148+
<CodeBlock className="language-d2">
149+
{MdTable}
150+
</CodeBlock>
151+
152+
<div className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/md-table.svg2')}}></div>
153+
:::
154+
143155
### Gap size 0
144156

145157
## Connections

docs/tour/interactive.md

-8
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,3 @@ Try clicking on each.
4949

5050
<div
5151
className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/links.svg2')}}></div>
52-
53-
:::info
54-
If you are using the Terrastruct app, you can link to other boards through their path.
55-
```d2
56-
x.link: Overview.My Service.Stuff
57-
```
58-
:::
59-

docs/tour/style.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import StylesFont from '@site/static/d2/styles-font.d2';
1616
import StylesFontSize from '@site/static/d2/styles-font-size.d2';
1717
import StylesFontColor from '@site/static/d2/styles-font-color.d2';
1818
import StylesTableColor from '@site/static/d2/styles-table-color.d2';
19-
import StylesAnimated from '@site/static/d2/styles-animated.d2';
19+
import StylesAnimated from '@site/static/bespoke-d2/styles-animated.d2';
2020
import StylesTextDecoration from '@site/static/d2/styles-text-decoration.d2';
2121
import StylesTextTransform from '@site/static/d2/styles-text-transform.d2';
2222
import StylesRoot from '@site/static/d2/styles-root.d2';

docs/tour/troubleshoot.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* [It won't compile a specific label or value](#it-wont-compile-a-specific-label-or-value)
44
* [The text is rendered too wide/long](#the-text-is-rendered-too-widelong)
55
* [Connections look cluttered](#connections-look-cluttered)
6-
* [I can't use reserved keywords](#i-cant-use-reserved-keywords)
6+
* [Reserved keywords as regular keys](#reserved-keywords-as-regular-keys)
77
* [My diagram is breaking with HTML in Markdown](#my-diagram-is-breaking-with-html-in-markdown)
88
* [Markdown SVGs won't render in certain SVG viewers](#markdown-svgs-wont-render-in-certain-svg-viewers)
99
* [My SVG isn't interactive when I embed into HTML](#my-svg-isnt-interactive-when-i-embed-into-html)
@@ -34,14 +34,13 @@ D2 adds a minimal amount of padding to shapes past the label dimensions. When a
3434
many connections, increasing dimensions will give it more surface area for the connections
3535
to route aesthetically to.
3636

37-
## I can't use reserved keywords
37+
## Reserved keywords as regular keys
3838

39-
We're working on a better system here to escape reserved keywords, but for now you can
40-
relabel:
39+
If you'd like to use a reserved keyword as a key, just quote it:
4140

4241
```d2
4342
x: {
44-
width_: width
43+
"width": width
4544
}
4645
```
4746

i18n/ko/docusaurus-plugin-content-docs/current/tour/style.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import StylesFont from '@site/static/d2/styles-font.d2';
1616
import StylesFontSize from '@site/static/d2/styles-font-size.d2';
1717
import StylesFontColor from '@site/static/d2/styles-font-color.d2';
1818
import StylesTableColor from '@site/static/d2/styles-table-color.d2';
19-
import StylesAnimated from '@site/static/d2/styles-animated.d2';
19+
import StylesAnimated from '@site/static/bespoke-d2/styles-animated.d2';
2020
import StylesTextDecoration from '@site/static/d2/styles-text-decoration.d2';
2121
import StylesTextTransform from '@site/static/d2/styles-text-transform.d2';
2222
import StylesRoot from '@site/static/d2/styles-root.d2';

sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const sidebars = {
169169
link: { type: "doc", id: "releases/intro" },
170170
items: [
171171
"releases/intro",
172+
"releases/0.6.9",
172173
"releases/0.6.8",
173174
"releases/0.6.7",
174175
"releases/0.6.6",

src/theme/Footer/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Footer() {
3131
Created by <img src="/img/terrastruct_logo.svg" />
3232
</span>
3333
</a>
34-
|<span>© 2024 Terrastruct, Inc.</span>
34+
|<span>© 2025 Terrastruct, Inc.</span>
3535
</div>
3636
<div className="Footer__Mobile">
3737
<div className="Footer__Mobile--Bar">

static/d2/styles-animated.d2 static/bespoke-d2/styles-animated.d2

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ direction: right
22
x -> y: hi {
33
style.animated: true
44
}
5+
x.style.animated: true

static/d2/globs-filter-3.d2

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**: {
2+
&connected: true
3+
style.fill: yellow
4+
}
5+
6+
**: {
7+
&leaf: true
8+
style.stroke: red
9+
}
10+
11+
container: {
12+
a -> b
13+
}
14+
c

static/d2/links.d2

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ x: I'm a Mac {
44
y: And I'm a PC {
55
link: https://microsoft.com
66
}
7-
x -> y: gazoontite
7+
x -> y: gazoontite {
8+
link: https://google.com
9+
}

static/d2/md-table.d2

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
savings: ||md
2+
| Month | Savings | Expenses | Balance |
3+
| -------- | ------- | -------- | ------- |
4+
| January | $250 | $150 | $100 |
5+
| February | $80 | $200 | -$120 |
6+
| March | $420 | $180 | $240 |
7+
||

static/d2/text-2.d2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plankton -> formula: will steal
22
formula: {
33
equation: |latex
4-
\lim_{h \\rightarrow 0 } \frac{f(x+h)-f(x)}{h}
4+
\lim_{h \rightarrow 0 } \frac{f(x+h)-f(x)}{h}
55
|
66
}

0 commit comments

Comments
 (0)