Core Concepts
Component Architecture
Understand the core React component hierarchy of OpenPress: from the outermost Workspace, to a single Press publication, down to a specific Page Frame.
The core philosophy of OpenPress is to treat a “document” as a React component tree. This allows you to compose document content using declarative syntax, just like developing a web page or application.
Why componentize a document?
Traditional WYSIWYG editors, while intuitive, often fall short when dealing with complex typesetting, cross-page logic, or design systems. Transforming a document into a component tree brings fundamental advantages:
- Precise Structural Control: Both human authors and AI Agents can control the document’s structure through precise markup syntax, eliminating ambiguity in typesetting.
- High Reusability: Complex design patterns can be encapsulated into independent components and reused across different documents or projects, ensuring visual consistency.
- Separation of Logic and Content: The page’s geometry, pagination logic, and actual content are separated. This makes it easy for the same content to adapt to different output formats.
Core Hierarchical Model
To solve various needs ranging from a single document to a massive document library, OpenPress defines three levels of abstraction:
Workspace
The workspace is the foundation of the entire project. Conceptually, it represents a complete contextual environment. A single workspace can contain multiple different publications, such as the PDF of an annual report and its corresponding launch presentation. The workspace is responsible for managing shared configurations and resources across publications.
Press
A Press is an “independent document” as recognized by a reader. It determines the fundamental attributes of this document, such as the title, page size (e.g., A4 or 16:9), and the source of the content.
Internally, the Press acts as a “typesetting engine.” It needs to understand the length of the content and, upon export (like saving as a PDF), dynamically calculate how the content should flow across pages to generate the correct number of pages.
Frame
A Frame is a physical surface on a page. You can think of it as different areas on a canvas.
Some frames are static and singular, such as the cover or back cover of a book; their content and layout are fixed. Another type of frame is responsible for carrying dynamically flowing content (such as the body text of a document). This type of frame collaborates with the Press’s typesetting engine to automatically generate new physical pages to continue the content when it exceeds a single page.
Through the composition of these three levels, OpenPress can describe any document structure, from a simple social media card to a complex multi-page report, in a consistent and highly extensible manner.