mdx README

The project's README from github.com/mdx-js/mdx. As one markdown file: README.md.

MDX

Markdown for the component era

Build Coverage Sponsors Backers Chat

MDX is an authorable format that lets you seamlessly write JSX in your markdown documents. You can import components, such as interactive charts or alerts, and embed them within your content. This makes writing long-form content with components a blast. 🚀

import {Chart} from './snowfall.js'
export const year = 2013

# Last year’s snowfall

In {year}, the snowfall was above average.
It was followed by a warm spring which caused
flood conditions in many of the nearby rivers.

<Chart year={year} color="#fcb32c" />

See § What is MDX for more info on the format. See § Playground to try it out.

What is this?

This GitHub repository contains several packages for compiling the MDX format to JavaScript, integrating with bundlers such as webpack and Rollup, and for using it with frameworks such as React, Preact, and Vue.

See § Getting started for how to integrate MDX into your project.

Security

See § Security on our site for information.

Contribute

See § Contribute on our site for ways to get started. See § Support for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

Sponsor

See § Sponsor on our site for how to help financially.

Vercel

Motif

HashiCorp

GitBook

Gatsby

Netlify

Coinbase

ThemeIsle

Expo

Boost Note

Markdown Space

Holloway


You?

License

MIT © Compositor and Vercel

mdx (mdx-js/mdx)

Searching Database…

19.8K ·GitHub
这是干什么的?MDX 是一种可撰写的内容格式,让你能在 Markdown 文档里直接写 JSX——可以导入交互图表、提示框之类的组件,并直接嵌入到正文中。
那 MDX 到底是文件格式、库,还是应用?它是一种格式加一套 JavaScript 工具链:这个仓库包含多个能把 MDX 编译成 JavaScript 的包,所以它是装进你项目里用的,而不是一个独立运行的应用。
怎么把 MDX 加到现有项目里?先安装相关包,再把编译器接入你的打包工具;README 会根据不同的搭建方式,指引你去看 mdxjs.com 上的入门指南。
它支持哪些框架和打包工具?它提供了 webpack、Rollup 等打包工具的集成,还有配合 React、Preact 和 Vue 使用的包。
MDX 会在内容文件里嵌入可运行的代码,安全上有什么要注意的?README 在这方面没有细讲,它把安全相关的信息放在了 MDX 官网的一个专门板块里。
写 MDX 必须是 React 开发者吗?不需要——它的基础就是普通 Markdown,写作者可以照常用自己的流程;添加交互组件才是开发者的事,而且这个项目认为用组件来写长篇内容非常爽。
能不能不装任何东西就试用 MDX?可以——MDX 官网上有一个 Playground,你可以在浏览器里直接体验这种格式,然后再把它接入项目。
MDX 是成熟项目还是新东西?很成熟:这个仓库创建于 2017 年 12 月,大约有 19.8k 星标,该格式由 Compositor 和 Vercel 以 MIT 许可证发布。
What are similar projects?mitosis, core, react-markdown, svgr, tamagui, tiptap, rspack, tsrx
Creator
mdx-js
Size
43.6 MB
Stars
19.8K
Age
8y
Commits · 90 Days