Skip to content

Commit

Permalink
Merge pull request #225 from terrastruct/fix-imports
Browse files Browse the repository at this point in the history
fix imports docs. bump version
  • Loading branch information
alixander authored Sep 2, 2024
2 parents c4e9351 + 1a7130a commit 86fd4f5
Show file tree
Hide file tree
Showing 168 changed files with 2,878 additions and 2,025 deletions.
4 changes: 2 additions & 2 deletions docs/tour/imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pagination_next: tour/imports-use-cases
---
import CodeBlock from '@theme/CodeBlock';
import ImportsTargeted from '@site/static/d2/imports-targeted.d2';
import ImportsTargetedPeople from '@site/static/d2/imports-targeted-people.d2';
import People from '@site/static/d2/people.d2';

# Syntax

Expand Down Expand Up @@ -91,7 +91,7 @@ just want to show some relations between managers, you can import a specific obj

`people.d2`
<CodeBlock className="language-d2-incomplete">
{ImportsTargetedPeople}
{People}
</CodeBlock>

:::info
Expand Down
4 changes: 2 additions & 2 deletions docs/tour/model-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pagination_next: tour/modular-classes
---
import CodeBlock from '@theme/CodeBlock';
import ImportsMVModels from '@site/static/d2/imports-mv-models.d2';
import Models from '@site/static/d2/models.d2';
import ImportsMVAccessView from '@site/static/d2/imports-mv-access-view.d2';
import ImportsMVSSHView from '@site/static/d2/imports-mv-ssh-view.d2';

Expand All @@ -13,7 +13,7 @@ different views.

## `models.d2`
<CodeBlock className="language-d2-incomplete">
{ImportsMVModels}
{Models}
</CodeBlock>

## `access-view.d2`
Expand Down
4 changes: 2 additions & 2 deletions docs/tour/modular-classes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CodeBlock from '@theme/CodeBlock';
import ImportsClasses from '@site/static/d2/imports-classes.d2';
import Classes from '@site/static/d2/classes.d2';
import ImportsClassesMain from '@site/static/d2/imports-classes-main.d2';

# Modular classes
Expand All @@ -8,7 +8,7 @@ This pattern mirrors web development, separating HTML and CSS.

## `classes.d2`
<CodeBlock className="language-d2-incomplete">
{ImportsClasses}
{Classes}
</CodeBlock>

## `main.d2`
Expand Down
8 changes: 4 additions & 4 deletions docs/tour/nested-composition.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CodeBlock from '@theme/CodeBlock';
import ImportsNested from '@site/static/bespoke-d2/imports-nested.d2';
import ImportsNestedServiceB from '@site/static/d2/imports-nested-serviceB.d2';
import ImportsNestedData from '@site/static/d2/imports-nested-data.d2';
import ServiceB from '@site/static/bespoke-d2/serviceB.d2';
import Data from '@site/static/bespoke-d2/data.d2';

# Nested composition

Expand All @@ -20,12 +20,12 @@ readable.

### `serviceB.d2`
<CodeBlock className="language-d2-incomplete">
{ImportsNestedServiceB}
{ServiceB}
</CodeBlock>

### `data.d2`
<CodeBlock className="language-d2-incomplete">
{ImportsNestedData}
{Data}
</CodeBlock>

## Render of `overview.d2`
Expand Down
8 changes: 4 additions & 4 deletions docs/tour/version-visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pagination_next: tour/imported-template
---
import CodeBlock from '@theme/CodeBlock';
import ImportsVVHistory from '@site/static/d2/imports-vv-history.d2';
import ImportsVVUsersCurrent from '@site/static/d2/imports-vv-users-current.d2';
import ImportsVVUsersV01 from '@site/static/d2/imports-vv-users-v0.1.d2';
import UsersCurrent from '@site/static/d2/users-current.d2';
import UsersV01 from '@site/static/d2/users-v0.1.d2';

# Version visualization

Expand All @@ -20,12 +20,12 @@ diagram is modularized with imports, such a visualization is easy to whip up.

- `users.d2` (latest version, 0.2)
<CodeBlock className="language-d2-incomplete">
{ImportsVVUsersCurrent}
{UsersCurrent}
</CodeBlock>

- `users.d2` (0.1)
<CodeBlock className="language-d2-incomplete">
{ImportsVVUsersV01}
{UsersV01}
</CodeBlock>

Since you want how `users.d2` looked like at `v0.1`, you use `git` to get that version:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion static/bespoke-d2/imports-nested.d2
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ serviceA -> serviceB
serviceB.link: layers.serviceB

layers: {
serviceB: @../d2/imports-nested-serviceB
serviceB: @serviceB
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ stripe.customer id -> data
data.link: layers.data

layers: {
data: @imports-nested-data
data: @data
}
File renamed without changes.
2 changes: 1 addition & 1 deletion static/d2/imports-classes-main.d2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
...@imports-classes
...@classes
user.class: person
error.class: [base; error]
modal.class: [base; med]
Expand Down
2 changes: 1 addition & 1 deletion static/d2/imports-mv-access-view.d2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
...@imports-mv-models
...@models
it -> vpn -> postgres
2 changes: 1 addition & 1 deletion static/d2/imports-mv-ssh-view.d2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
...@imports-mv-models
...@models
it -> postgres: ssh, bypassing VPN
2 changes: 1 addition & 1 deletion static/d2/imports-targeted.d2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
...@imports-targeted-people.management
...@people.management
joe -> donuts: loves
jan -> donuts: brings
4 changes: 2 additions & 2 deletions static/d2/imports-vv-history.d2
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
direction: right
Users 1: Users Table (v0.1) {
...@"imports-vv-users-v0.1"
...@"users-v0.1"
}

Users 2: Users Table (current) {
...@imports-vv-users-current
...@users-current
}

Users 1 -> Users 2
1 change: 1 addition & 0 deletions static/d2/imports-mv-models.d2 → static/d2/models.d2
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
postgres: {
shape: cylinder
icon: https://icons.terrastruct.com/dev%2Fpostgresql.svg
icon.near: bottom-center
}
it: IT Guy {
shape: person
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion static/img/generated/animated.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.5-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1882 494"><svg id="d2-svg" width="1882" height="494" viewBox="11 11 1882 494"><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1882 494"><svg id="d2-svg" width="1882" height="494" viewBox="11 11 1882 494"><style type="text/css"><![CDATA[
.d2-1872084757 .text {
font-family: "d2-1872084757-font-regular";
}
Expand Down
Binary file modified static/img/generated/cat.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion static/img/generated/chicken.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.5-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 314 465"><svg id="d2-svg" width="314" height="465" viewBox="-106 -66 314 465"><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 314 465"><svg id="d2-svg" width="314" height="465" viewBox="-106 -66 314 465"><style type="text/css"><![CDATA[
.d2-4130279961 .text {
font-family: "d2-4130279961-font-regular";
}
Expand Down
4 changes: 2 additions & 2 deletions static/img/generated/classes-1.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.5-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 409 186"><svg id="d2-svg" class="d2-3478011237" width="409" height="186" viewBox="-1 -1 409 186"><rect x="-1.000000" y="-1.000000" width="409.000000" height="186.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 409 186"><svg id="d2-svg" class="d2-3478011237" width="409" height="186" viewBox="-1 -1 409 186"><rect x="-1.000000" y="-1.000000" width="409.000000" height="186.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-3478011237 .text-mono {
font-family: "d2-3478011237-font-mono";
}
Expand Down Expand Up @@ -161,7 +161,7 @@
.d2-3478011237 .color-AA4{color:#45475A;}
.d2-3478011237 .color-AA5{color:#313244;}
.d2-3478011237 .color-AB4{color:#45475A;}
.d2-3478011237 .color-AB5{color:#313244;}.appendix text.text{fill:#CDD6F4}.md{--color-fg-default:#CDD6F4;--color-fg-muted:#BAC2DE;--color-fg-subtle:#A6ADC8;--color-canvas-default:#1E1E2E;--color-canvas-subtle:#313244;--color-border-default:#CBA6f7;--color-border-muted:#CBA6f7;--color-neutral-muted:#313244;--color-accent-fg:#CBA6f7;--color-accent-emphasis:#CBA6f7;--color-attention-subtle:#BAC2DE;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-B2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-B3{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-B4{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-B5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B6{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AA2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-AA4{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AA5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AB4{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AB5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N1{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N6{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N7{fill:url(#streaks-darker);mix-blend-mode:lighten}.light-code{display: none}.dark-code{display: block}}]]></style><g id="MyClass"><g class="shape" ><rect x="0.000000" y="0.000000" width="407.000000" height="184.000000" class=" stroke-N1 fill-N7" style="stroke-width:2;" /><rect x="0.000000" y="0.000000" width="407.000000" height="92.000000" class="class_header fill-N1" /><text x="203.500000" y="53.750000" class="text-mono fill-N7" style="text-anchor:middle;font-size:24px;">MyClass</text><text x="10.000000" y="120.000000" class="text-mono fill-B2" style="text-anchor:start;font-size:20px">+</text><text x="30.000000" y="120.000000" class="text-mono fill-N1" style="text-anchor:start;font-size:20px">field</text><text x="387.000000" y="120.000000" class="text-mono fill-AA2" style="text-anchor:end;font-size:20px">[]string</text><line x1="0.000000" x2="407.000000" y1="138.000000" y2="138.000000" class=" stroke-N1" style="stroke-width:1" /><text x="10.000000" y="166.000000" class="text-mono fill-B2" style="text-anchor:start;font-size:20px">+</text><text x="30.000000" y="166.000000" class="text-mono fill-N1" style="text-anchor:start;font-size:20px">method(a uint64)</text><text x="387.000000" y="166.000000" class="text-mono fill-AA2" style="text-anchor:end;font-size:20px">(x, y int)</text></g></g><mask id="d2-3478011237" maskUnits="userSpaceOnUse" x="-1" y="-1" width="409" height="186">
.d2-3478011237 .color-AB5{color:#313244;}.appendix text.text{fill:#CDD6F4}.md{--color-fg-default:#CDD6F4;--color-fg-muted:#BAC2DE;--color-fg-subtle:#A6ADC8;--color-canvas-default:#1E1E2E;--color-canvas-subtle:#313244;--color-border-default:#CBA6f7;--color-border-muted:#CBA6f7;--color-neutral-muted:#313244;--color-accent-fg:#CBA6f7;--color-accent-emphasis:#CBA6f7;--color-attention-subtle:#BAC2DE;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-B2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-B3{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-B4{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-B5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B6{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AA2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-AA4{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AA5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AB4{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-AB5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N1{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N2{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N5{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N6{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N7{fill:url(#streaks-darker);mix-blend-mode:lighten}.light-code{display: none}.dark-code{display: block}}]]></style><g id="MyClass"><g class="shape" ><rect x="0.000000" y="0.000000" width="407.000000" height="184.000000" class=" stroke-N1 fill-N7" style="stroke-width:2;" /><rect x="0.000000" y="0.000000" width="407.000000" height="92.000000" class="class_header fill-N1" /><text x="203.500000" y="50.500000" class="text-mono fill-N7" style="text-anchor:middle;font-size:24px;">MyClass</text><text x="10.000000" y="120.000000" class="text-mono fill-B2" style="text-anchor:start;font-size:20px">+</text><text x="30.000000" y="120.000000" class="text-mono fill-N1" style="text-anchor:start;font-size:20px">field</text><text x="387.000000" y="120.000000" class="text-mono fill-AA2" style="text-anchor:end;font-size:20px">[]string</text><line x1="0.000000" x2="407.000000" y1="138.000000" y2="138.000000" class=" stroke-N1" style="stroke-width:1" /><text x="10.000000" y="166.000000" class="text-mono fill-B2" style="text-anchor:start;font-size:20px">+</text><text x="30.000000" y="166.000000" class="text-mono fill-N1" style="text-anchor:start;font-size:20px">method(a uint64)</text><text x="387.000000" y="166.000000" class="text-mono fill-AA2" style="text-anchor:end;font-size:20px">(x, y int)</text></g></g><mask id="d2-3478011237" maskUnits="userSpaceOnUse" x="-1" y="-1" width="409" height="186">
<rect x="-1" y="-1" width="409" height="186" fill="white"></rect>
</mask></svg></svg>
Loading

0 comments on commit 86fd4f5

Please sign in to comment.