wiki-vitepress
microsoft/skills
이 패키지는 위키 마크다운을 다크 테마가 적용된 VitePress 정적 사이트, 클릭 시 확대 기능이 있는 다크 모드 Mermaid 다이어그램, 그리고 프로덕션 빌드 출력물로 변환합니다.
...모든 것을 확장하십시오Wiki VitePress 패키저
생성된 위키 마크다운 파일을 다크 테마와 상호작용이 가능한 Mermaid 다이어그램이 포함된 세련된 VitePress 정적 사이트로 변환합니다.
활성화 시점
- 사용자가 "사이트 구축" 또는 "VitePress로 패키징"을 요청할 때
- 사용자가
/deep-wiki:build명령어를 실행할 때 - 사용자가 생성된 위키 페이지에서 브라우저로 볼 수 있는 HTML 출력을 원할 때
VitePress 스캐폴딩
wiki-site/ 디렉터리에 다음 구조를 생성합니다:
wiki-site/
├── .vitepress/
│ ├── config.mts
│ └── theme/
│ ├── index.ts
│ └── custom.css
├── public/
├── [생성된 .md 페이지]
├── package.json
└── index.md
구성 요구 사항 (config.mts)
vitepress-plugin-mermaid의withMermaid래퍼 사용- 다크 모드 전용 테마의 경우
appearance: 'dark'로설정 - 카탈로그 구조에 따라
themeConfig.nav및themeConfig.sidebar를구성하십시오 - Mermaid 구성에서 다크 테마 변수를 다음과 같이 설정해야 합니다:
mermaid: {
theme: 'dark',
themeVariables: {
primaryColor: '#1e3a5f',
primaryTextColor: '#e0e0e0',
primaryBorderColor: '#4a9eed',
lineColor: '#4a9eed',
secondaryColor: '#2d4a3e',
tertiaryColor: '#2d2d3d',
background: '#1a1a2e',
mainBkg: '#1e3a5f',
nodeBorder: '#4a9eed',
clusterBkg: '#16213e',
titleColor: '#e0e0e0',
edgeLabelBackground: '#1a1a2e'
}
}
다크 모드 Mermaid: 3계층 수정
레이어 1: 테마 변수 (config.mts 내)
위와 같이 mermaid.themeVariables를 통해 설정합니다.
레이어 2: CSS 재정의 (custom.css)
!important을 사용하여 Mermaid SVG 요소를 지정합니다:
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon { fill: #1e3a5f !important; stroke: #4a9eed !important; }
.mermaid .edgeLabel { background-color: #1a1a2e !important; color: #e0e0e0 !important; }
.mermaid text { fill: #e0e0e0 !important; }
.mermaid .label { color: #e0e0e0 !important; }
레이어 3: 인라인 스타일 대체 (theme/index.ts)
Mermaid의 인라인 스타일 속성은 모든 설정을 덮어씁니다. onMounted와 폴링을 사용하여 이를 대체하세요:
import { onMounted } from 'vue'
// setup() 내부
onMounted(() => {
let attempts = 0
const fix = setInterval(() => {
document.querySelectorAll('.mermaid svg [style]').forEach(el => {
const s = (el as HTMLElement).style
if (s.fill && !s.fill.includes('#1e3a5f')) s.fill = '#1e3a5f'
if (s.stroke && !s.stroke.includes('#4a9eed')) s.stroke = '#4a9eed'
if (s.color) s.color = '#e0e0e0'
})
if (++attempts >= 20) clearInterval(fix)
}, 500)
})
enhanceApp() 대신 onMounted와 함께 setup()을 사용하세요. SSR 중에는 DOM이 존재하지 않습니다.
Mermaid 다이어그램의 클릭 확대/축소 기능
각 .mermaid 컨테이너를 클릭 시 전체 화면 모달을 여는 래퍼로 감싸세요:
document.querySelectorAll('.mermaid').forEach(el => {
el.style.cursor = 'zoom-in'
el.addEventListener('click', () => {
const modal = document.createElement('div')
modal.className = 'mermaid-zoom-modal'
modal.innerHTML = el.outerHTML
modal.addEventListener('click', () => modal.remove())
document.body.appendChild(modal)
})
})
모달 CSS:
.mermaid-zoom-modal {
position: fixed; inset: 0;
background: rgba(0,0,0,0.9);
display: flex; align-items: center; justify-content: center;
z-index: 9999; cursor: zoom-out;
}
.mermaid-zoom-modal .mermaid { transform: scale(1.5); }
후처리 규칙
VitePress 빌드 전에 모든 .md 파일을 스캔하여 다음을 수정합니다:
- 다음으로 대체:
다음으로(Vue 템플릿 컴파일러 호환성) - 코드 펜스 외부의 백틱 안에 있는
제네릭 매개변수를 코드 펜스 밖의 백틱으로 감싸주세요 - 모든 페이지에
제목과설명이포함된 YAML 프론트매터가 있는지 확인
빌드
cd wiki-site && npm install && npm run docs:build
출력 결과는 wiki-site/.vitepress/dist/에 저장됩니다 .
알려진 문제점
- Mermaid는 비동기 방식으로 렌더링됩니다.
onMounted가호출될 때 SVG는 존재하지 않으므로, 폴링해야 합니다. isCustomElement컴파일러 옵션은사용 시 더 심각한 크래시가 발생하므로 — 절대 사용하지 마십시오- Mermaid의 Node 텍스트는 특이도가 가장 높은 인라인
스타일을사용합니다 — CSS만으로는 이 문제를 해결할 수 없습니다 enhanceApp()은문서가존재하지 않는 SSR 중에 실행됩니다.setup()만 사용하십시오.
---
name: wiki-vitepress
description: Packages generated wiki Markdown into a VitePress static site with dark theme, dark-mode Mermaid diagrams with click-to-zoom, and production build output.
license: MIT
---
# Wiki VitePress Packager
Transform generated wiki Markdown files into a polished VitePress static site with dark theme and interactive Mermaid diagrams.
## When to Activate
- User asks to "build a site" or "package as VitePress"
- User runs the `/deep-wiki:build` command
- User wants a browsable HTML output from generated wiki pages
## VitePress Scaffolding
Generate the following structure in a `wiki-site/` directory:
```
wiki-site/
├── .vitepress/
│ ├── config.mts
│ └── theme/
│ ├── index.ts
│ └── custom.css
├── public/
├── [generated .md pages]
├── package.json
└── index.md
```
## Config Requirements (`config.mts`)
- Use `withMermaid` wrapper from `vitepress-plugin-mermaid`
- Set `appearance: 'dark'` for dark-only theme
- Configure `themeConfig.nav` and `themeConfig.sidebar` from the catalogue structure
- Mermaid config must set dark theme variables:
```typescript
mermaid: {
theme: 'dark',
themeVariables: {
primaryColor: '#1e3a5f',
primaryTextColor: '#e0e0e0',
primaryBorderColor: '#4a9eed',
lineColor: '#4a9eed',
secondaryColor: '#2d4a3e',
tertiaryColor: '#2d2d3d',
background: '#1a1a2e',
mainBkg: '#1e3a5f',
nodeBorder: '#4a9eed',
clusterBkg: '#16213e',
titleColor: '#e0e0e0',
edgeLabelBackground: '#1a1a2e'
}
}
```
## Dark-Mode Mermaid: Three-Layer Fix
### Layer 1: Theme Variables (in config.mts)
Set via `mermaid.themeVariables` as shown above.
### Layer 2: CSS Overrides (`custom.css`)
Target Mermaid SVG elements with `!important`:
```css
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon { fill: #1e3a5f !important; stroke: #4a9eed !important; }
.mermaid .edgeLabel { background-color: #1a1a2e !important; color: #e0e0e0 !important; }
.mermaid text { fill: #e0e0e0 !important; }
.mermaid .label { color: #e0e0e0 !important; }
```
### Layer 3: Inline Style Replacement (`theme/index.ts`)
Mermaid inline `style` attributes override everything. Use `onMounted` + polling to replace them:
```typescript
import { onMounted } from 'vue'
// In setup()
onMounted(() => {
let attempts = 0
const fix = setInterval(() => {
document.querySelectorAll('.mermaid svg [style]').forEach(el => {
const s = (el as HTMLElement).style
if (s.fill && !s.fill.includes('#1e3a5f')) s.fill = '#1e3a5f'
if (s.stroke && !s.stroke.includes('#4a9eed')) s.stroke = '#4a9eed'
if (s.color) s.color = '#e0e0e0'
})
if (++attempts >= 20) clearInterval(fix)
}, 500)
})
```
Use `setup()` with `onMounted`, NOT `enhanceApp()` — DOM doesn't exist during SSR.
## Click-to-Zoom for Mermaid Diagrams
Wrap each `.mermaid` container in a clickable wrapper that opens a fullscreen modal:
```typescript
document.querySelectorAll('.mermaid').forEach(el => {
el.style.cursor = 'zoom-in'
el.addEventListener('click', () => {
const modal = document.createElement('div')
modal.className = 'mermaid-zoom-modal'
modal.innerHTML = el.outerHTML
modal.addEventListener('click', () => modal.remove())
document.body.appendChild(modal)
})
})
```
Modal CSS:
```css
.mermaid-zoom-modal {
position: fixed; inset: 0;
background: rgba(0,0,0,0.9);
display: flex; align-items: center; justify-content: center;
z-index: 9999; cursor: zoom-out;
}
.mermaid-zoom-modal .mermaid { transform: scale(1.5); }
```
## Post-Processing Rules
Before VitePress build, scan all `.md` files and fix:
- Replace `<br/>` with `<br>` (Vue template compiler compatibility)
- Wrap bare `<T>` generic parameters in backticks outside code fences
- Ensure every page has YAML frontmatter with `title` and `description`
## Build
```bash
cd wiki-site && npm install && npm run docs:build
```
Output goes to `wiki-site/.vitepress/dist/`.
## Known Gotchas
- Mermaid renders async — SVGs don't exist when `onMounted` fires. Must poll.
- `isCustomElement` compiler option for bare `<T>` causes worse crashes — do NOT use it
- Node text in Mermaid uses inline `style` with highest specificity — CSS alone won't fix it
- `enhanceApp()` runs during SSR where `document` doesn't exist — use `setup()` only
모든 파일
0개 파일wiki-vitepress 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/deep-wiki/skills/wiki-vitepress # Copy SKILL.md to your .claude/skills/ directory
복사





집
