Skip to content

Commit aece23b

Browse files
hackerwinsclaude
andauthored
Improve grammar and readability (#286)
Improve documentation grammar and readability - Convert passive voice to active voice for clearer instructions - Fix sentence structure for better readability - Correct typos (e.g., "disconneted" -> "disconnected") - Standardize imperative mood for instructions - Remove redundant phrases (e.g., "in order to" -> "to") - Fix article usage and punctuation - Improve consistency across SDK documentation Files updated: - docs/index.mdx - docs/getting-started/*.mdx - docs/js-sdk.mdx - docs/ios-sdk.mdx - docs/android-sdk.mdx - docs/cli.mdx - docs/devtools.mdx - docs/admin-api.mdx - docs/self-hosted-server.mdx - docs/glossary.mdx - docs/advanced/security.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3d9cb88 commit aece23b

File tree

15 files changed

+232
-256
lines changed

15 files changed

+232
-256
lines changed

docs/admin-api.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ order: 90
55

66
## Admin API
77

8-
Yorkie Admin API allows developers to interact programmatically with their Yorkie documents without using Yorkie SDK. It is convenient for managing documents in server-side applications.
8+
The Yorkie Admin API allows developers to interact programmatically with their Yorkie documents without using the Yorkie SDK. It is convenient for managing documents in server-side applications.
99

1010
The API is implemented using [Connect protocol](https://connectrpc.com/docs/protocol/), which means all requests are made using HTTP POST method to a specific service endpoint. The API accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.
1111

@@ -26,8 +26,7 @@ curl '{{API_ADDR}}/yorkie.v1.AdminService/ListProjects' \
2626

2727
#### POST /yorkie.v1.AdminService/CreateDocument
2828

29-
This endpoint creates a new document in the specified project. If `initial_root`
30-
is provided, it will be used as the initial content of the document. Otherwise, an empty document will be created.
29+
This endpoint creates a new document in the specified project. If `initial_root` is provided, it is used as the initial content of the document. Otherwise, an empty document is created.
3130

3231
##### Request
3332

@@ -99,10 +98,9 @@ curl '{{API_ADDR}}/yorkie.v1.AdminService/UpdateDocument' \
9998

10099
#### POST /yorkie.v1.AdminService/ListDocuments
101100

102-
This endpoint returns a list of documents in a project. There is a pagination mechanism to retrieve documents in batches.
103-
You can provide the `previous_id` of the last document in the previous page to get the next page of documents.
101+
This endpoint returns a list of documents in a project. A pagination mechanism allows you to retrieve documents in batches. Provide the `previous_id` of the last document in the previous page to get the next page of documents.
104102

105-
If you want to get the root of the document, you can set the `include_root` parameter to `true`.
103+
To include the root of each document in the response, set the `include_root` parameter to `true`.
106104

107105
##### Request
108106

@@ -328,7 +326,7 @@ curl '{{API_ADDR}}/yorkie.v1.AdminService/SearchDocuments' \
328326

329327
#### POST /yorkie.v1.AdminService/GetChannels
330328

331-
This endpoint retrieves channel information without requiring an SDK client to attach to the channels. It returns the session count (number of connected clients) for the specified channels.
329+
This endpoint retrieves channel information without requiring an SDK client to attach to the channels. It returns the session count (the number of connected clients) for the specified channels.
332330

333331
Channels support [hierarchical keys using periods (`.`) as separators](/docs/js-sdk#hierarchical-channel-keys). When `include_sub_path` is enabled, the session count includes all clients connected to sub-level channels.
334332

docs/advanced/resources.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ yorkie project update [project-name] \
6969
#### MaxSubscribersPerDocument
7070

7171
Limits how many clients can subscribe (watch for changes) to a single document simultaneously. Set to `0` for unlimited subscribers.
72-
Unlike attachments limits, this setting controls event streaming clients that receive updates without actively editing the document.
72+
Unlike attachment limits, this setting controls event streaming clients that receive updates without actively editing the document.
7373

7474
```bash
7575
yorkie project update [project-name] \

docs/advanced/security.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Each project in Yorkie can have its own allowed origins settings, which can be m
2121

2222
### Auth Webhook
2323

24-
The Auth Webhook provides fine-grained access control by validating client requests through an external authentication server. This allows you to enforce custom authorization logic, ensuring that only authorized users can access and modify Yorkie documents.
24+
The Auth Webhook provides fine-grained access control by validating client requests through an external authentication server. This allows you to enforce custom authorization logic, ensuring only authorized users can access and modify Yorkie documents.
2525

2626
<Mermaid
2727
chart={`sequenceDiagram
@@ -49,17 +49,17 @@ The authentication process follows these steps:
4949

5050
##### 1. Configure the Auth Webhook
5151

52-
You can easily set up the Auth Webhook via the the [Dashboard]({{DASHBOARD_PATH}}):
52+
You can set up the Auth Webhook via the [Dashboard]({{DASHBOARD_PATH}}):
5353
- Go to the Project Settings page.
5454
- Set the webhook URL and define which methods require authentication.
5555

5656
<Image alt="setting auth-webhook" src="/assets/images/docs/auth-webhook-dashboard.png" width={1300} height={840} style={{ maxWidth: '1000px' }} />
5757

58-
Alternatively, you can configure the webhook using the Yorkie CLI. See updating the project for details. Refer to the [updating the project](/docs/cli#updating-the-project).
58+
Alternatively, configure the webhook using the Yorkie CLI. See [Updating the Project](/docs/cli#updating-the-project) for details.
5959

6060
##### 2. Client Configuration
6161

62-
To provide authentication tokens dynamically, use the `authTokenInjector` option when creating a Yorkie client:
62+
Provide authentication tokens dynamically using the `authTokenInjector` option when creating a Yorkie client:
6363

6464
```javascript
6565
const client = new yorkie.Client({
@@ -109,7 +109,7 @@ HTTP Status Codes:
109109

110110
##### 5. Error Handling and Recovery
111111

112-
Yorkie handles authentication failures based on the webhook response and HTTP status codes:
112+
Yorkie handles authentication failures based on the webhook response and HTTP status codes.
113113

114114
| Status Code | Meaning | Action Taken |
115115
|------------|---------|--------------|
@@ -118,9 +118,9 @@ Yorkie handles authentication failures based on the webhook response and HTTP st
118118
| 403 Permission Denied | The token is valid but lacks the required permissions (allowed: false) | The request is rejected with `codes.PermissionDenied` |
119119

120120
##### Token Refresh & Retry Behavior
121-
For `PushPull`(realtime sync) and `WatchDocuments`:
122-
- Yorkie automatically retries the request after refreshing the token.
121+
For `PushPull` (realtime sync) and `WatchDocuments`:
122+
- Yorkie automatically retries the request after refreshing the token
123123
- Notifies via [`document.subscribe('auth-error')`](/docs/js-sdk#documentsubscribeauth-error)
124124

125125
For other API calls:
126-
- The system does not automatically retry; the client must manually handle the `codes.Unauthenticated` error and retry the request.
126+
- The system does not automatically retry; the client must manually handle the `codes.Unauthenticated` error and retry the request

docs/android-sdk.mdx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ order: 50
55

66
## Android SDK
77

8-
Through Yorkie Android SDK, you can efficiently build collaborative applications. On the client-side implementation, you can create Documents that are automatically synced with remote peers with minimal effort.
8+
The Yorkie Android SDK enables you to efficiently build collaborative applications. On the client side, you can create documents that automatically sync with remote peers with minimal effort.
99

1010
If you want to install the SDK, refer to the [Getting Started with Android SDK](/docs/getting-started/with-android-sdk).
1111

1212
### Client
1313

14-
`Client` is a normal client that can communicate with the server. It has Documents and sends changes of the Document from local to the server to synchronize with other replicas in remote.
14+
`Client` is a normal client that communicates with the server. It holds documents and sends local changes to the server to synchronize with other replicas.
1515

1616
#### Creating a Client
1717

@@ -31,7 +31,7 @@ val client = Client(
3131
3232
#### Activating a Client
3333

34-
Activates the client by registering it with the server. The server assigns a unique client ID that is used to distinguish different clients. After activation, the client is ready to attach documents and communicate with the server.
34+
Activate the client by registering it with the server. The server assigns a unique client ID that distinguishes different clients. After activation, the client is ready to attach documents and communicate with the server.
3535

3636
```kotlin
3737
scope.launch {
@@ -72,7 +72,7 @@ scope.launch {
7272

7373
#### Attaching Documents
7474

75-
Attaches a document to the client. Once attached, the client will synchronize the document with the server and other clients. You can set initial presence data and choose the synchronization mode.
75+
Attach a document to the client. Once attached, the client synchronizes the document with the server and other clients. You can set initial presence data and choose the synchronization mode.
7676

7777
**Parameters:**
7878
- `document`: The document to attach
@@ -93,7 +93,7 @@ scope.launch {
9393

9494
#### Detaching Documents
9595

96-
Detaches a document from the client. The client will no longer synchronize the document with the server. This is important for garbage collection to clean up CRDT tombstones.
96+
Detach a document from the client. The client no longer synchronizes the document with the server. This is important for garbage collection to clean up CRDT tombstones.
9797

9898
**Parameters:**
9999
- `document`: The document to detach
@@ -107,7 +107,7 @@ scope.launch {
107107

108108
#### Synchronizing Documents
109109

110-
Manually pushes local changes to the server and pulls remote changes. Useful when using `Manual` sync mode or when you need to force synchronization.
110+
Manually push local changes to the server and pull remote changes. This is useful when using `Manual` sync mode or when you need to force synchronization.
111111

112112
**Parameters:**
113113
- `document`: Specific document to sync. If `null`, syncs all attached documents (optional)
@@ -126,7 +126,7 @@ scope.launch {
126126

127127
#### Changing Synchronization Mode
128128

129-
Changes the synchronization mode of an attached document. This allows you to dynamically control how the document synchronizes with the server.
129+
Change the synchronization mode of an attached document. This allows you to dynamically control how the document synchronizes with the server.
130130

131131
**Yorkie offers four SyncModes:**
132132
- `Client.SyncMode.Realtime`: Local changes are automatically pushed to the server, and remote changes are pulled from the server.
@@ -148,7 +148,7 @@ client.changeSyncMode(document, Client.SyncMode.Realtime)
148148

149149
#### Broadcasting Messages
150150

151-
Broadcasts a message to other clients subscribed to the document. This is useful for sending ephemeral messages that don't need to be stored in the document (e.g., notifications, alerts, or temporary states).
151+
Broadcast a message to other clients subscribed to the document. This is useful for sending ephemeral messages that don't need to be stored in the document, such as notifications, alerts, or temporary states.
152152

153153
**Parameters:**
154154
- `document`: The document to broadcast to
@@ -168,7 +168,7 @@ scope.launch {
168168

169169
#### Removing Documents
170170

171-
Permanently removes a document from the server. This operation is irreversible and will delete the document for all clients.
171+
Permanently remove a document from the server. This operation is irreversible and deletes the document for all clients.
172172

173173
**Parameters:**
174174
- `document`: The document to remove
@@ -181,7 +181,7 @@ scope.launch {
181181

182182
#### Deactivating a Client
183183

184-
Deactivates the client and disconnects from the server. All attached documents will be detached automatically.
184+
Deactivate the client and disconnect from the server. All attached documents are detached automatically.
185185

186186
**Parameters:**
187187
- `keepalive`: If `true`, ensures the deactivation request completes even if the app terminates (optional, default: `false`)
@@ -219,12 +219,12 @@ val client = Client(
219219

220220
### Document
221221

222-
`Document` is a primary data type in Yorkie, which provides a JSON-like updating experience that makes it easy to represent your application's model.
223-
A `Document` can be updated without being attached to the client, and its changes are automatically propagated to other clients when the `Document` is attached to the `Client` or when the network is restored.
222+
`Document` is the primary data type in Yorkie, providing a JSON-like updating experience that makes it easy to represent your application's model.
223+
A `Document` can be updated without being attached to the client, and its changes automatically propagate to other clients when the `Document` is attached to the `Client` or when the network is restored.
224224

225225
#### Creating a Document
226226

227-
Creates a new document instance with a unique key. The document can be modified locally before being attached to a client.
227+
Create a new document instance with a unique key. The document can be modified locally before being attached to a client.
228228

229229
**Parameters:**
230230
- `key`: Unique identifier for the document
@@ -234,12 +234,11 @@ Creates a new document instance with a unique key. The document can be modified
234234
val document = Document(Document.Key("my-document"))
235235
```
236236

237-
> The document key is used to identify the Document in Yorkie. It is a string that can be freely defined by the user.
238-
> However, it is allowed to use only `a-z`, `A-Z`, `0-9`, `-`, `.`, `_`, `~` and must be between 4-120 characters.
237+
> The document key identifies the Document in Yorkie. It is a string that you can freely define, but it can only contain `a-z`, `A-Z`, `0-9`, `-`, `.`, `_`, `~` and must be between 4 and 120 characters.
239238
240239
#### Attaching a Document
241240

242-
Attaches the document to a client. Once attached, the document will be synchronized with the server and other clients. You can set initial presence and choose the sync mode.
241+
Attach the document to a client. Once attached, the document synchronizes with the server and other clients. You can set initial presence and choose the sync mode.
243242

244243
```kotlin
245244
scope.launch {
@@ -268,7 +267,7 @@ when (document.status) {
268267

269268
#### Updating a Document
270269

271-
Updates the document structure and/or presence. The updater function provides access to the document root and presence. Changes are automatically synchronized with other clients when attached.
270+
Update the document structure and/or presence. The updater function provides access to the document root and presence. Changes automatically synchronize with other clients when attached.
272271

273272
**Parameters:**
274273
- `message`: Optional description of the change
@@ -288,7 +287,7 @@ scope.launch {
288287

289288
**getRoot()**
290289

291-
Returns a proxy of the document's root object that you can use to read values.
290+
Return a proxy of the document's root object that you can use to read values.
292291

293292
```kotlin
294293
scope.launch {
@@ -300,7 +299,7 @@ scope.launch {
300299

301300
**getValueByPath()**
302301

303-
Gets a value at a specific JSON path. The path must start with `$` which represents the document root.
302+
Get a value at a specific JSON path. The path must start with `$`, which represents the document root.
304303

305304
**Parameters:**
306305
- `path`: JSON path (e.g., `$.user.name`, `$.todos[0]`)
@@ -314,7 +313,7 @@ scope.launch {
314313

315314
**toJson()**
316315

317-
Converts the entire document to a JSON string representation.
316+
Convert the entire document to a JSON string representation.
318317

319318
```kotlin
320319
val json = document.toJson()
@@ -356,7 +355,7 @@ scope.launch {
356355

357356
**events(targetPath)**
358357

359-
Subscribe to changes for a specific path in the document. Only events affecting the target path or its nested values will be emitted.
358+
Subscribe to changes for a specific path in the document. Only events affecting the target path or its nested values are emitted.
360359

361360
**Parameters:**
362361
- `targetPath`: JSON path to subscribe to (e.g., `$.todos`, `$.user.name`)
@@ -379,7 +378,7 @@ scope.launch {
379378

380379
#### Changing Synchronization Mode
381380

382-
Changes how the document synchronizes with the server. See the [Client Changing Synchronization Mode](#changing-synchronization-mode) section for available modes and their descriptions.
381+
Change how the document synchronizes with the server. See the [Client Changing Synchronization Mode](#changing-synchronization-mode) section for available modes and their descriptions.
383382

384383
```kotlin
385384
// Enable automatic synchronization of both local and remote changes
@@ -400,7 +399,7 @@ scope.launch {
400399

401400
#### Detaching a Document
402401

403-
Detaches the document from the client. The document will no longer be synchronized with the server. This is important for efficient garbage collection to remove [CRDT tombstones](https://crdt.tech/glossary).
402+
Detach the document from the client. The document no longer synchronizes with the server. This is important for efficient garbage collection to remove [CRDT tombstones](https://crdt.tech/glossary).
404403

405404
```kotlin
406405
scope.launch {
@@ -414,7 +413,7 @@ Yorkie provides several JSON-based data types that can be used to model your app
414413

415414
#### JsonObject
416415

417-
`JsonObject` is a key-value data structure, similar to a JSON object or Kotlin Map. It can contain any JSON-compatible values including other objects, arrays, primitives, and custom CRDT types.
416+
`JsonObject` is a key-value data structure similar to a JSON object or Kotlin Map. It can contain any JSON-compatible values, including other objects, arrays, primitives, and custom CRDT types.
418417

419418
**Creating and Using JsonObject:**
420419

@@ -464,7 +463,7 @@ scope.launch {
464463

465464
#### JsonArray
466465

467-
`JsonArray` is an ordered collection of values, similar to a JSON array or Kotlin List. It supports adding, removing, and accessing elements by index.
466+
`JsonArray` is an ordered collection of values similar to a JSON array or Kotlin List. It supports adding, removing, and accessing elements by index.
468467

469468
**Creating and Using JsonArray:**
470469

@@ -541,7 +540,7 @@ scope.launch {
541540

542541
#### JsonText
543542

544-
`JsonText` is a specialized CRDT type for collaborative text editing. It supports text operations like insert, delete, and styling, making it ideal for building rich text editors.
543+
`JsonText` is a specialized CRDT type for collaborative text editing. It supports text operations such as insert, delete, and styling, making it ideal for building rich text editors.
545544

546545
**Creating and Editing Text:**
547546

@@ -649,7 +648,7 @@ document.events.filterIsInstance<Document.Event.PresenceChanged.Others>().collec
649648

650649
#### JsonCounter
651650

652-
`JsonCounter` is a CRDT type that supports atomic increment and decrement operations. It automatically resolves conflicts when multiple clients modify the counter simultaneously.
651+
`JsonCounter` is a CRDT type that supports atomic increment and decrement operations, automatically resolving conflicts when multiple clients modify the counter simultaneously.
653652

654653
**Creating and Using Counter:**
655654

@@ -699,7 +698,7 @@ JsonCounter is ideal for:
699698

700699
#### JsonTree
701700

702-
`JsonTree` is a CRDT-based tree structure designed for representing hierarchical document structures like HTML or XML. It's ideal for building rich text editors with complex formatting (e.g., ProseMirror, Quill).
701+
`JsonTree` is a CRDT-based tree structure designed for representing hierarchical document structures such as HTML or XML. It is ideal for building rich text editors with complex formatting (such as ProseMirror or Quill).
703702

704703
**Creating a Tree:**
705704

@@ -837,7 +836,7 @@ scope.launch {
837836

838837
### Presence
839838

840-
Presence is a feature that allows you to share the temporary state of online users in real-time. Unlike document data, presence information is not stored permanently and is only maintained while users are connected. This makes it ideal for showing user cursors, selections, online status, or any other ephemeral user state.
839+
Presence allows you to share the temporary state of online users in real-time. Unlike document data, presence information is not stored permanently and is only maintained while users are connected. This makes it ideal for showing user cursors, selections, online status, or any other ephemeral user state.
841840

842841
#### Setting Initial Presence
843842

@@ -875,7 +874,7 @@ scope.launch {
875874

876875
#### Updating Presence
877876

878-
You can update presence at any time using `document.updateAsync()`. The `presence` parameter in the updater function is a `Presence` instance.
877+
Update presence at any time using `document.updateAsync()`. The `presence` parameter in the updater function is a `Presence` instance.
879878

880879
**Function Signature:**
881880

@@ -905,7 +904,7 @@ scope.launch {
905904

906905
**Merge Behavior:**
907906

908-
Presence changes are merged, not replaced. Only the specified keys are updated:
907+
Presence changes are merged, not replaced. Only the specified keys are updated.
909908

910909
```kotlin
911910
// Initial presence: { "name": "Alice", "color": "blue" }
@@ -952,7 +951,7 @@ scope.launch {
952951

953952
#### Presence Events
954953

955-
Presence events notify you when users join, leave, or update their presence. These events are part of `Document.Event.PresenceChanged`.
954+
Presence events notify you when users join, leave, or update their presence. These events are part of `Document.Event.PresenceChanged`:
956955

957956
##### MyPresence Events
958957

0 commit comments

Comments
 (0)