Skip to content

docs: show sources for referenced files #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Use TutorialKit's React components for fun and profit.
---
import PackageManagerTabs from '@components/Tabs/PackageManagerTabs.astro'
import { Code } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
import themeCSS from '@tutorialkit/astro/default-theme.css?raw';

import Example from '@components/react-examples/Example.astro';
Expand All @@ -17,6 +18,7 @@ import sourceExampleSimpleEditor from '@components/react-examples/ExampleSimpleE
import sourceExampleFileTree from '@components/react-examples/ExampleFileTree?raw';
import sourceExampleCodeMirrorEditor from '@components/react-examples/ExampleCodeMirrorEditor?raw';
import sourceExampleTerminal from '@components/react-examples/ExampleTerminal?raw';
import sourceUseWebcontainer from "@components/react-examples/hooks/useWebcontainer?raw";

You can reuse TutorialKit's React components in your own applications. They are designed to work well with the [WebContainer API][webcontainers].

Expand Down Expand Up @@ -74,6 +76,17 @@ See a full example on [StackBlitz][stackblitz-example].

## Components

These examples have references to the following files:

<Tabs syncKey="referenced-files">
<TabItem label="hooks/useTheme.ts">
<Code code={"export function useTheme() {\n return 'light';\n}"} lang="ts" class="limit-code-height" />
</TabItem>

<TabItem label="hooks/useWebcontainer.ts">
<Code code={sourceUseWebcontainer} lang="ts" class="limit-code-height" />
</TabItem>
</Tabs>

### `FileTree`

Expand Down