跳到正文
Skillpedia
网站与界面(前端)40k · #7276

markstream-install

它能做什么

这个工具可以帮你安装和配置 Markstream。Markstream 是一个程序,能够在使用 Vue、React、Svelte 等技术构建的网站和应用中展示格式化文本(比如 AI 聊天中的内容)。它会确保只安装必要的部分,从而保障安全。

适用场景

  • ✓在 AI 聊天中添加格式化文本显示功能。
  • ✓在 Vue、React、Svelte 等项目中安装 Markstream。
  • ✓修复 Markstream 的安装或样式问题。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/markstream-install/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/markstream-install/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在 Nuxt 项目中为 Vue 3 安装 Markstream,并支持代码高亮和数学公式。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会先检查你的项目使用的是哪种技术(Vue、React 等),以及你需要哪些额外功能。然后,它会安装对应的 Markstream 包,并配置样式和显示模式。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Install

Integrate the appropriate Markstream package into an existing application without installing unnecessary optional dependencies or weakening its security defaults.

Read references/scenarios.md before choosing packages or peers.

When to Use

Use this skill when the user asks to:

  • add streaming Markdown rendering to an AI chat or document interface;
  • install Markstream in Vue, Nuxt, React, Next.js, Svelte, Angular, or Vue 2;
  • repair a broken Markstream installation, missing styles, or SSR failure;
  • replace another Markdown renderer with Markstream;
  • choose between static, smooth-streaming, and externally parsed AST input.

Workflow

1. Inspect the host application

Before changing dependencies, inspect:

  • the framework and version in package.json;
  • the package manager lockfile;
  • whether the application uses SSR;
  • reset, Tailwind, UnoCSS, or design-system styles;
  • required optional features: code highlighting, enhanced File/Diff surfaces, Monaco, Mermaid, D2, infographic blocks, or KaTeX.

Do not assume the Vue package is correct merely because the source repository is named markstream-vue. Select the framework-specific package from the scenario table.

2. Install the smallest dependency set

Install exactly one framework package. Add optional peers only when the requested UI uses their feature.

Examples:

npm install markstream-vue
npm install markstream-react
npm install markstream-svelte
npm install markstream-angular
npm install markstream-vue2

Preserve the repository's existing package manager. Do not install every optional peer preemptively.

3. Wire styles in the correct order

Import application resets before Markstream styles. Import package CSS explicitly; do not rely on component imports to inject it.

For Tailwind or UnoCSS, use the relevant package subpath in a component layer:

@import 'markstream-vue/index.css' layer(components);

Use the matching package name for React, Svelte, Angular, or Vue 2. If math rendering is enabled, also import:

@import 'katex/dist/katex.min.css';

Vue CLI 4 and other Webpack 4-based Vue 2 applications cannot resolve package export maps. In those projects, import the published file directly:

import 'markstream-vue2/dist/index.css'

4. Add the smallest working renderer

Prefer content for static documents and most streaming chat interfaces. Markstream's built-in smooth streaming can pace irregular token delivery without requiring the host to maintain an AST.

For Vue 3 chat surfaces, start with:

<MarkdownRender
  mode="chat"
  :content="markdown"
  :final="false"
  smooth-streaming="auto"
  :fade="false"
  typewriter
/>

For completed chat history, keep the same renderer mode and switch pacing off:

<MarkdownRender
  mode="chat"
  :content="markdown"
  :final="true"
  :smooth-streaming="false"
  :fade="true"
  :typewriter="false"
/>

In React, Svelte, and Angular, use the equivalent camelCase or framework binding syntax. Keep smoothStreaming="auto", fade=false, and typewriter=true while streaming; use smoothStreaming=false and typewriter=false for completed history.

Use nodes plus final only when a worker, shared AST store, custom transform, or another application layer already owns parsing.

5. Handle framework-specific boundaries

  • In Nuxt, keep browser-only optional peers behind client boundaries.
  • In Next.js, use the root markstream-react entry inside a 'use client' component for live SSE or WebSocket streams. Use markstream-react/next for SSR-first HTML with hydration, or markstream-react/server for server-only rendering.
  • Use markstream-svelte only with Svelte 5.
  • Confirm the Angular application meets the current markstream-angular version requirement.
  • In Vue 3, use mode="chat" for AI chat, mode="docs" for rich documents, and mode="minimal" for lightweight non-chat surfaces.
  • For long Vue 3 conversations or an existing message virtualizer, consult the Markstream performance guide before adding a second virtualizer.

6. Preserve safe defaults

HTML policy defaults to safe, and Mermaid uses strict mode. Do not broaden either setting unless the user explicitly identifies a trusted legacy surface that requires it. Scope any exception to that surface.

7. Validate

…

常见问题

什么是 Markstream?

Markstream 是一个库,可以在网页应用中高效地展示格式化文本,比如由人工智能生成的内容。

为什么需要为我的框架(Vue、React 等)选择特定的包?

每个框架都有自己的特点。安装正确的包可以确保 Markstream 与你的项目技术完美配合,不会产生冲突,也不会带来不必要的依赖。

什么是“可选依赖”?

这些是 Markstream 可能提供的额外功能,比如代码高亮或公式支持。这个工具只会安装你明确需要的部分,让项目更轻量,也更安全。

详情

作者的原始描述

Install and configure Markstream streaming Markdown renderers for Vue, React, Svelte, Angular, Nuxt, and Vue 2 applications. Use for package selection, minimal peer dependencies, CSS order, SSR boundaries, streaming mode, and renderer setup.

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7276
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能