MDsveX README

The project's README from github.com/pngwn/MDsveX. As one markdown file: README.md.

mdsvex

A Markdown preprocessor for Svelte. Markdown in Svelte.

mdsvex.com

Packages

This is a monorepo containing mdsvex and any supporting packages. Each repo has its own readme with more details.

Contributing

Contributions are welcome. This repo uses changesets to manage changelogs and versioning. All pull requests need an accompanying changeset file (PRs to the documentation website do not need a changeset file). If you know how changesets work then feel free to add one with the appropriate packages, versions and a description of the change. If you don't know how changesets work, don't worry about it, I am happy to add one (a little robot will also add some details to the PR when you open it as well, if you want to learn more).

MDsveX (pngwn/MDsveX)

Searching Database…

3.1K ·GitHub
这是什么?mdsvex 是 Svelte 的 Markdown 预处理器——它让你在 Svelte 项目里直接写 Markdown,并在构建时把 Markdown 转换成 Svelte 组件。
它是加到我 Svelte 项目里的库,还是一个需要单独运行的应用?它是一个库:把 mdsvex 包加到 Svelte 项目中,作为预处理器接入构建流程即可——没有需要单独运行的应用。
我怎么把它装到项目里?从 npm 安装 mdsvex 包作为开发依赖,然后在 Svelte 配置中把它注册为预处理器;文档网站 mdsvex.com 上有完整的安装配置指南。
我在用 Svelte 搭博客或内容网站,它能给我带来什么?你用 Markdown 写内容,同时在同一个项目里使用 Svelte 组件;mdsvex 会在构建过程中编译 Markdown,这也是 Svelte 博客的典型做法。
这个仓库里除了 mdsvex 本身还有什么?它是一个 monorepo:除了 mdsvex,还有文档网站、svelte-parse(把 Svelte 组件解析成 svast AST)、svast(一套带 TypeScript 类型定义的 AST 规范)、svast-stringify(把 svast AST 转回 Svelte 组件)以及 svast-utils。
svast 是什么?是一套 AST 规范,附带的 TypeScript 类型定义。配套的包都围绕它构建:svelte-parse 从 Svelte 组件生成 svast 树,svast-stringify 再把这样的树转换回 Svelte 组件。
使用它需要懂编译器或 AST 吗?不需要——svast、svelte-parse、svast-stringify 和 svast-utils 都是幕后的配套包;作为使用者,你只要把 mdsvex 预处理器加进项目,然后写 Markdown 就行。
What are similar projects?babel, marked, acorn, markdown-it, nextra, mitosis, postcss, oxc
Creator
pngwn
Size
16.5 MB
Stars
3.1K
Age
7y
Commits · 90 Days