Skip to content

MDC Extractor

รองรับการแยก classes จากไวยากรณ์ MDC (Markdown Components)

Installation

bash
pnpm add -D @unocss/extractor-mdc
bash
yarn add -D @unocss/extractor-mdc
bash
npm install -D @unocss/extractor-mdc
bash
bun add -D @unocss/extractor-mdc
ts
import extractorMdc from '@unocss/extractor-mdc'
import { defineConfig } from 'unocss'

export default defineConfig({
  extractors: [
    extractorMdc(),
  ],
})

มันจะใช้การแยกบนไฟล์ .md .mdc และ .markdown เพื่อแยกการใช้งาน props แบบ inline ของ classes ตัวอย่างเช่น

md
# Title{.text-2xl.font-bold}

Hello [World]{.text-blue-500}

![image](/image.png){.w-32.h-32}

classes text-2xl, font-bold, text-blue-500, w-32, h-32 จะถูกแยกออกมา

Released under the MIT License.