Skip to content

Commit 2152fc2

Browse files
wip
1 parent 591c438 commit 2152fc2

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed
File renamed without changes.

.vitepress/config/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig, type DefaultTheme } from 'vitepress';
33
const nav: DefaultTheme.NavItem[] = [
44
{ text: 'ガイド', link: '/ja/guides/get-started' },
55
{ text: 'リファレンス', link: '/ja/references/syntax' },
6+
{ text: 'AiScriptを試す', link: '/ja/playground' },
67
];
78

89
const guideNav: DefaultTheme.SidebarItem[] = [

.vitepress/pages/Playground.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div :class="$style.playgroundRoot">
3+
<div :class="$style.playgroundHeader">a</div>
4+
</div>
5+
</template>
6+
7+
<script setup lang="ts">
8+
9+
</script>
10+
11+
<style module>
12+
.playgroundRoot {
13+
display: grid;
14+
height: 100%;
15+
max-height: 100%;
16+
}
17+
18+
</style>

.vitepress/scripts/playground-transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function createPlaygroundTransformer(): ShikiTransformer {
2323
},
2424
postprocess: (html, options) => {
2525
if (options.lang !== 'aiscript' || !options.meta?.__raw?.includes('playground') || codeRaw == null) return;
26-
return `${html}<Playground code="${escapeHtml(codeRaw)}"></Playground>`;
26+
return `${html}<CodeBlockPlayground code="${escapeHtml(codeRaw)}"></CodeBlockPlayground>`;
2727
},
2828
};
2929
}

.vitepress/theme/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { h } from 'vue'
33
import type { Theme } from 'vitepress'
44
import DefaultTheme from 'vitepress/theme'
55
import './style.css'
6-
import Playground from '../components/Playground.vue'
6+
import CodeBlockPlayground from '../components/CodeBlockPlayground.vue'
7+
import Playground from '../pages/Playground.vue'
78

89
export default {
910
extends: DefaultTheme,
@@ -13,6 +14,8 @@ export default {
1314
})
1415
},
1516
enhanceApp({ app, router, siteData }) {
16-
app.component('Playground', Playground);
17+
app.component('CodeBlockPlayground', CodeBlockPlayground);
18+
19+
app.component('playground', Playground);
1720
}
1821
} satisfies Theme

docs/ja/playground.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
layout: playground
3+
---

0 commit comments

Comments
 (0)