富内容编辑器在理想情况下,应该能生成干净、语义明确的文档,同时仍然让用户易于理解。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.