You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,21 @@ const config = {
87
87
// Required: A DOM element ID to render superdoc into
88
88
selector:'#superdoc',
89
89
90
-
// Optional: Initial document mode: viewing, editing. Defaults to viewing
90
+
// Optional: Initial document mode: viewing, suggesting,editing. Defaults to editing
91
91
documentMode:'editing',
92
92
93
+
// Optional: User role: editor, suggester, viewer. Defaults to editor
94
+
role:'editor',
95
+
93
96
// Required: Documents list with one document
94
97
documents: [
95
98
{
96
99
id:'my-doc-id', // Required: This document's ID. This is also used as the room name in collaboration.
97
100
type:'docx', // Required: 'pdf', 'docx' or 'html'
98
-
data: fileObject, // Optional: A JS File object of your doc, pdf or html file.
101
+
102
+
// Document content - provide EITHER data OR url:
103
+
data: fileObject, // Option 1: A JS File/Blob object of your document
104
+
url:'https://example.com/document.docx', // Option 2: URL to fetch the document from
99
105
},
100
106
],
101
107
@@ -144,6 +150,24 @@ const config = {
144
150
};
145
151
```
146
152
153
+
## Document Modes and Roles
154
+
155
+
SuperDoc supports different document modes and user roles to control editing capabilities:
156
+
157
+
### Document Modes
158
+
159
+
-**editing** - Full document editing capabilities
160
+
-**viewing** - Read-only mode with no editing allowed
161
+
-**suggesting** - Track changes mode where edits are shown as suggestions
162
+
163
+
### User Roles
164
+
165
+
-**editor** - Users with full editing capabilities who can access all document modes
166
+
-**suggester** - Users who can only make suggestions (track changes) but cannot directly edit
167
+
-**viewer** - Users with read-only access who can only view the document
168
+
169
+
The user's role restricts which document modes they can access. For example, a user with the "viewer" role will always be in viewing mode regardless of the requested document mode.
0 commit comments