Skip to content

MDC 提取器

¥MDC Extractor

支持从 MDC(Markdown 组件) 语法中提取类。

¥Support extracting classes from MDC (Markdown Components) syntax.

安装

¥Installation

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

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

它将在 .md .mdc.markdown 文件上应用提取,以提取类的内联 props 使用。例如

¥It will apply the extraction on .md .mdc and .markdown files, to extract inline props usage of classes. For example

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

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

![image](/image.png)

{.w-32.h-32}

将提取 text-2xlfont-boldtext-blue-500w-32h-32 类。

¥The text-2xl, font-bold, text-blue-500, w-32, h-32 classes will be extracted.