티스토리 뷰
https://emersonbottero.github.io/vitepress-plugin-mermaid/
https://vitepress.dev/ko/guide/what-is-vitepress
vitepress에서 mermaid를 사용할 떄는 별도의 plugin을 설치해야만 가능하다.
설치하기
pnpm add -D vitepress-plugin-mermaid mermaid //npm으로 설치하기 //npm i -D vitepress-plugin-mermaid mermaid +mermaid 11.9.0 +vitepress 1.6.4 +vitepress-plugin-mermaid 2.0.17
.vitepress/config.mts 설정하기
//.vitepress/config.mts import { defineConfig } from 'vitepress' import { withMermaid } from 'vitepress-plugin-mermaid' export default withMermaid( defineConfig({ ... }) );
확인하기
graph LR; K([...........<img src='/vitepress-plugin-mermaid/K.png' width='60' >...........])-.->G((...........<img id='git' src='/vitepress-plugin-mermaid/Octocat.png' width='50' >...........)); H([...........<img id='helm' src='/vitepress-plugin-mermaid/helm.png' width='60' >...........])-.->G G-->A; A(...........<img src='/vitepress-plugin-mermaid/argo-cd.png' width='60' >...........)-->D(...........<img src='/vitepress-plugin-mermaid/ocp.png' width='60' >...........); classDef img fill:none,color:transparent,stroke:none,borderRadius:50px class G,D,A,K,H,B img click K "https://kustomize.io/" _blank click G "http://www.github.com" "This is a link" _blank
config.mts에 예시와 같이 설정하면 정상적으로 plugins이 등록되지 않는다.
ES모듈 호환성 이슈인듯?
해결방법
동적 import 사용
// .vitepress/config.mts import { defineConfig } from 'vitepress' export default async () => { const { withMermaid } = await import('vitepress-plugin-mermaid') return withMermaid( defineConfig({ ... }) ) }
config.mts를 config.ts로 변경하기 -> 다른 모듈이나 plugin을 이미 사용하고 있을 경우 충돌될 수 있음!
수동으로 mermaid 설정
vue컴포넌트로 mermaid 사용
반응형
'공부합시다' 카테고리의 다른 글
Docker 컨테이너 서버에서 sendmail 발송하기 (0) | 2025.05.28 |
---|---|
Bitwarden-cli 사용하기 (0) | 2024.08.22 |
TDD AAA 패턴 (0) | 2024.07.04 |
Oracle 시퀀스(Sequence)와 Identity Column (0) | 2024.05.22 |
VIM 명령어 (0) | 2023.07.07 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- eloquent-observer
- l5-swagger-response
- exception-test
- bitwarden-cli
- 정의
- addMonthWithoutOverflow
- aaa패턴
- Python
- Laravel
- addMonth
- msmtp
- 자바스크립트
- redis
- observer 매개변수 전달하기
- vim
- graphql
- 라라벨
- password-manager
- vitepress-plugin-mermaid
- 메일
- MySQL
- 정규식
- laravel-kafka
- POP3
- l5-swagger
- graphql-php
- php
- django
- 컨테이너내에서 메일 발송하기
- vitepress
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
글 보관함