Skip to content

Commit 338b236

Browse files
committed
docs: update cannon docs to include source code
1 parent 9c29d5a commit 338b236

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

apps/astro-docs/src/content/docs/cannon/debug.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: Debug
33
description: Details about the Angular Three Cannon Debug
44
---
55

6-
import CannonSampleDebug from '../../../components/cannon/sample-debug';
6+
import { Tabs, TabItem, Code } from '@astrojs/starlight/components';
7+
import CannonSampleDebug, { content } from '../../../components/cannon/sample-debug?includeContent';
78

89
`angular-three-cannon/debug` provides a debug experience for Cannon.js physics engine using `cannon-es-debugger`. This
910
allows us to visualize how Cannon _sees_ the 3D scene graph.
@@ -74,6 +75,13 @@ injectBox(
7475

7576
### Example
7677

77-
<div class="h-96 w-full border border-dashed border-accent-500 rounded">
78-
<CannonSampleDebug client:only />
79-
</div>
78+
<Tabs>
79+
<TabItem label="Preview">
80+
<div class="h-96 w-full border border-dashed border-accent-500 rounded">
81+
<CannonSampleDebug client:only />
82+
</div>
83+
</TabItem>
84+
<TabItem label="Code">
85+
<Code code={content} lang="angular-ts" />
86+
</TabItem>
87+
</Tabs>

apps/astro-docs/src/content/docs/cannon/how-it-works.mdx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: How it works
33
description: How Angular Three Cannon works
44
---
55

6-
import CannonSample from '../../../components/cannon/sample';
6+
import { Tabs, TabItem, Code } from '@astrojs/starlight/components';
7+
import CannonSample, { content } from '../../../components/cannon/sample?includeContent';
78

89
### Import `NgtcPhysics` from `angular-three-cannon`
910

@@ -88,6 +89,15 @@ export class Box {
8889

8990
### Example
9091

91-
<div class="h-96 w-full border border-dashed border-accent-500 rounded">
92-
<CannonSample client:only />
93-
</div>
92+
<Tabs>
93+
<TabItem label="Preview">
94+
<div class="h-96 w-full border border-dashed border-accent-500 rounded">
95+
<CannonSample client:only />
96+
</div>
97+
</TabItem>
98+
<TabItem label="Code">
99+
<Code code={content} lang="angular-ts" />
100+
</TabItem>
101+
</Tabs>
102+
103+

0 commit comments

Comments
 (0)