理想情况下,富文本编辑器应当生成干净、语义明确的文档,同时又要便于用户理解。ProseMirror 试图弥合两者之间的差距:一端是像 Markdown 或 XML 那样显式、无歧义的内容,另一端是传统的所见即所得(WYSIWYG)编辑器。
Rich content editors should, ideally, produce clean, semantically meaningful documents while still being easy for users to understand. ProseMirror tries to bridge the gap between editing explicit, unambiguous content like Markdown or XML, and classical WYSIWYG editors.
为此,它针对比纯 HTML 约束更多、结构更严谨的文档,实现了一套所见即所得风格的编辑界面。你可以自定义编辑器所创建文档的形状与结构,并根据应用的需要对它进行调整。
It does this by implementing a WYSIWYG-style editing interface for documents more constrained and structured than plain HTML. You can customize the shape and structure of the documents your editor creates, and tailor them to your application's needs.
特性
Features
-
协同编辑
Collaborative editing
ProseMirror 从一开始就为协同编辑提供了从底层构建的、稳固可靠的内置支持,可让多人实时编辑同一份文档。
ProseMirror has built-in, ground-up, rock solid support for collaborative editing, where multiple people work on the same document in real time.
-
可扩展的 schema
Extensible schemas
文档 schema 允许你编辑具有自定义结构的文档,而无需从头编写自己的编辑器。
Document schemas allow editing documents with a custom structure without writing your own editor from scratch.
-
模块化
Modular
模块化的架构确保你只加载所需的代码,并且可以按需替换系统中的部分组件。
A modular architecture makes sure you only load the code you need, and can replace parts of the system as needed.
-
可插拔
Pluggable
插件系统让你能方便地启用额外功能,并以便捷的形式打包自己的扩展。
A plugin system allows you to easily enable additional functionality, and package your own extensions in a convenient format.
-
函数式
Functional
整体上函数式、不可变的架构,使 ProseMirror 易于集成到现代 Web 应用中,也能让你有把握地实现复杂行为。
A largely functional and immutable architecture makes it easy to integrate ProseMirror into modern web apps, and confidently implement complex behavior.
-
不预设立场
Unopinionated
核心库小巧而通用,为构建各种截然不同的编辑器提供了基础。
The core library is small and generic, providing a base onto which very different types of editors can be built.
关于
About
ProseMirror 是开源的,法律上你可以自由地将其用于商业用途。不过,编写、维护、为这样一个项目提供支持并搭建基础设施,需要付出大量的工作与精力。因此……
ProseMirror is open source, and you are legally free to use it commercially. Yet, writing, maintaining, supporting, and setting up infrastructure for such a project takes a lot of work and energy. Therefore...
如果你正用 ProseMirror 盈利,那么按照社会惯例,你应当为它的维护提供资助。 从这里开始。
If you are using ProseMirror to make profit, there is a social expectation that you help fund its maintenance. Start here.
ProseMirror 在 Forgejo 上开发,欢迎参与贡献。
ProseMirror is being developed on Forgejo. Contributions are welcome.
安装 ProseMirror 最简便的方式是通过 npm。可以先看看示例上手。
The easiest way to install ProseMirror is with npm. Take a look at the examples to get started.
该库可在较新版本的 Firefox、Chrome、Safari 和 Edge 上运行,也支持 Internet Explorer 11。
The library works on recent versions of Firefox, Chrome, Safari, and Edge, as well as on Internet Explorer 11.
讨论项目或提问,最好在论坛上进行;发现 bug 请通过 issue 跟踪器 报告。我们希望成为一个包容、友好的社区。为明确这一点,我们制定了一份行为准则,适用于围绕本项目的所有交流。
Discussing the project, or asking questions, is best done on the forum. Bugs should be reported through the issue tracker. We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
赞助者
Sponsors
软件的初期开发由这 414 位出色的个人与组织众筹支持。
Initial development of the software was crowd-funded by these 414 excellent individuals and organizations.
后续的开发由以下公司赞助支持:
Ongoing development is supported by these companies:

