Skip to content

Commit d5e4f99

Browse files
msakrejdaivanreese
authored andcommitted
Fix some hyperlinks
1 parent 0c10799 commit d5e4f99

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

content/docs/reference/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A document is the "unit of change" in automerge. It's like a combination of a JS
2121

2222
Like a JSON object, an automerge document is a map from strings to values, where the values can be maps, arrays, or simple types like strings or numbers. See the [data model](/docs/reference/documents/) section for more details.
2323

24-
Like a git repository, an automerge document has a history made up of commits. Every time you make a change to a document you are adding to the history of the document. The combination of this history and some rules about how to handle conflicts means that any two automerge documents can always be merged. See [merging](/docs/reference/under-the-hood/merge_rules.md) for the gory details.
24+
Like a git repository, an automerge document has a history made up of commits. Every time you make a change to a document you are adding to the history of the document. The combination of this history and some rules about how to handle conflicts means that any two automerge documents can always be merged. See [merging](/docs/reference/under-the-hood/merge-rules) for the gory details.
2525

2626
### Repositories
2727

content/docs/reference/documents/rich-text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ console.log(Automerge.marks(doc, ["text"]))
3232

3333
Here we can see that the bold span applies to the "hello".
3434

35-
It is up to your application to decide what different mark names mean, but if you are interested in interoperability consider adopting our [rich text schema](../../under-the-hood/rich_text_schema).
35+
It is up to your application to decide what different mark names mean, but if you are interested in interoperability consider adopting our [rich text schema](../../under-the-hood/rich-text-schema).
3636

3737
## Block Markers
3838

39-
Block markers are maps which are inserted inline in the text. They are used to divide text into structural roles such as paragraphs, headings, or code blocks. The underlying primitive of a block marker is very flexible, so specific editor integrations can use it however they like. The `automerge-prosemirror` bindings use the [rich text schema](../../under-the-hood/rich_text_schema).
39+
Block markers are maps which are inserted inline in the text. They are used to divide text into structural roles such as paragraphs, headings, or code blocks. The underlying primitive of a block marker is very flexible, so specific editor integrations can use it however they like. The `automerge-prosemirror` bindings use the [rich text schema](../../under-the-hood/rich-text-schema).
4040

4141
Block markers can be created using `Automerge.splitBlock` and updated using `Automerge.updateBlock` and you can find the active block at a given index using `Automerge.block`.
4242

content/docs/reference/repositories/dochandles.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: DocHandles
33
template: docs
44
---
55

6-
Once you have a `Repo` with a `NetworkAdapter` and a `StorageAdapter` you can get down to the business of creating and working with [`DocHandle`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)s.
6+
Once you have a `Repo` with a `NetworkAdapter` and a `StorageAdapter` you can get down to the business of creating and working with [`DocHandle`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.DocHandle.html)s.
77

88
It's useful to understand a little about why we need a `DocHandle`. `@automerge/automerge` documents are fairly inert data structures. You can create a document, you can mutate it, you can generate sync messages to send elsewhere and you can receive sync messages from elsewhere. None of this is very "live" though. Because the document has no concept of a network, or of storage, you can't say "every time I change a document, tell everyone else about it and save the change to storage". This "live document" is what a `DocHandle` is. A `DocHandle` is a wrapper around a document managed by a `Repo`. It provides the following kinds of "liveness":
99

10-
- Whenever you change the document using [`DocHandle.change`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html#change) or [`DocHandle.changeAt`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html#changeAt) the changes will be saved to the attached `StorageAdapter` and sent to any connected `NetworkAdapter`s
10+
- Whenever you change the document using [`DocHandle.change`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.DocHandle.html#change) or [`DocHandle.changeAt`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.DocHandle.html#changeat) the changes will be saved to the attached `StorageAdapter` and sent to any connected `NetworkAdapter`s
1111
- Whenever a change is received from a connected peer the `DocHandle` will fire a "change" event
1212
- There is a concept of an ephemeral message, which you can send using `DocHandle.broadcast`. Whenever a `DocHandle` receives an ephemeral message it will fire a `"ephemeral-message"` event
1313
- You can wait for a `DocHandle` to be loaded, or to be retrieved from another peer
@@ -17,11 +17,11 @@ It's useful to understand a little about why we need a `DocHandle`. `@automerge/
1717

1818
## Creating a `DocHandle`
1919

20-
This is the easy one, just call [`Repo.create`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.Repo.html#create). This creates a new document, stores it, and then enqueues messages to all connected peers informing them of the new document.
20+
This is the easy one, just call [`Repo.create`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.Repo.html#create). This creates a new document, stores it, and then enqueues messages to all connected peers informing them of the new document.
2121

2222
## Waiting for a `DocHandle`
2323

24-
Typically you are _not_ creating a new document, but working with an existing one. Maybe the document URL was stored in `localStorage`, maybe the URL was in the hash fragment of the browser, etc. In this case you use [`Repo.find`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.Repo.html#find) to lookup the document. This means the `DocHandle` can be in several different states, to understand this we'll first look at the states in detail, then some convenience methods `DocHandle` exposes for waiting for different states.
24+
Typically you are _not_ creating a new document, but working with an existing one. Maybe the document URL was stored in `localStorage`, maybe the URL was in the hash fragment of the browser, etc. In this case you use [`Repo.find`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.Repo.html#find) to lookup the document. This means the `DocHandle` can be in several different states, to understand this we'll first look at the states in detail, then some convenience methods `DocHandle` exposes for waiting for different states.
2525

2626
### `DocHandle` states
2727

@@ -65,7 +65,7 @@ Note that every state can transition to `DELETED`, either via `DocHandle.delete`
6565

6666
One other point to note is that a `DocHandle` can be unavailable because we didn't have it in storage and no peers responded to our request for it, but then another peer comes online and sends us sync messages for the document and so it transitions to `READY`.
6767

68-
You can check what state a handle is in using [`DocHandle.inState`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html#inState).
68+
You can check what state a handle is in using [`DocHandle.inState`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.DocHandle.html#instate).
6969

7070
### Waiting for a handle to be ready
7171

content/docs/reference/repositories/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ template: docs
55

66
`@automerge/automerge` provides a JSON-like CRDT and a sync protocol, but this still leaves a lot of plumbing to do to use it in an application. [`@automerge/automerge-repo`](https://www.npmjs.com/package/@automerge/automerge-repo) is that plumbing.
77

8-
The entry point for an `automerge-repo` based application is to create a [`Repo`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.Repo.html), passing it some form of [`StorageAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.StorageAdapter.html) - which knows how to save data locally - and zero or more [`NetworkAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.NetworkAdapter.html)s, which know how to talk to other peers running `automerge-repo`.
8+
The entry point for an `automerge-repo` based application is to create a [`Repo`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.Repo.html), passing it some form of [`StorageAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.StorageAdapter.html) - which knows how to save data locally - and zero or more [`NetworkAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.NetworkAdapter.html)s, which know how to talk to other peers running `automerge-repo`.
99

1010
For example, this snippet creates a `Repo` which listens for websocket connections and stores data in the local file system:
1111

@@ -23,7 +23,7 @@ const repo = new Repo({
2323
});
2424
```
2525

26-
A `Repo` is a little like a database. It allows you to create and request [`DocHandle`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)s. Once you have a `DocHandle` you can make changes to it and listen for changes received from other peers.
26+
A `Repo` is a little like a database. It allows you to create and request [`DocHandle`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.DocHandle.html)s. Once you have a `DocHandle` you can make changes to it and listen for changes received from other peers.
2727

2828
```typescript
2929
let doc = repo.create();

content/docs/reference/repositories/networking.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ title: Networking
33
template: docs
44
---
55

6-
There are many ways to talk to other peers. In `automerge-repo` this is captured by the [`NetworkAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.NetworkAdapter.html) interface. Unlike `StorageAdapter`s a repository can have many (or zero) `NetworkAdapter`s.
6+
There are many ways to talk to other peers. In `automerge-repo` this is captured by the [`NetworkAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.NetworkAdapter.html) interface. Unlike `StorageAdapter`s a repository can have many (or zero) `NetworkAdapter`s.
77

88
"network" is quite a broad term in `automerge-repo`. It really means "any other instance of `Repo` which I am communicating with by message passing". This means that as well as network adapters for obvious things like websockets, we also implement network adapters for less traditional channels such as [`MessageChannel`](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel) or [`BroadcastChannel`](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel).
99

1010
## Websockets
1111

12-
The websocket `NetworkAdapter` has two parts. This is because the websocket protocol requires a server and a client. The parts are named `NodeWSServerAdapter` and `BrowserWebsocketClientAdapter`, but don't take these names too seriously, they will both work in a browser or in Node.
12+
The websocket `NetworkAdapter` has two parts. This is because the websocket protocol requires a server and a client. The parts are named `WebSocketServerAdapter` and `WebSocketClientAdapter`, but don't take these names too seriously, they will both work in a browser or in Node.
1313

1414
### Server
1515

16-
The server side of the adapter is [`NodeWSServerAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo_network_websocket.NodeWSServerAdapter.html), which should be used in combination with the [`ws`](https://www.npmjs.com/package/ws) library.
16+
The server side of the adapter is [`WebSocketServerAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo-network-websocket.WebSocketServerAdapter.html), which should be used in combination with the [`ws`](https://www.npmjs.com/package/ws) library.
1717

1818
```typescript
1919
import { WebSocketServer } from "ws";
20-
import { NodeWSServerAdapter } from "@automerge/automerge-repo-network-websocket";
20+
import { WebSocketServerAdapter } from "@automerge/automerge-repo-network-websocket";
2121

2222
const wss = new WebSocketServer({ port: 8080 });
23-
const adapter = new NodeWSServerAdapter(wss);
23+
const adapter = new WebSocketServerAdapter(wss);
2424
```
2525

2626
#### Usage with `express`
@@ -29,7 +29,7 @@ Often you aren't running the websocket server as a standalone thing but instead
2929

3030
```typescript
3131
import { WebSocketServer } from "ws";
32-
import { NodeWSServerAdapter } from "@automerge/automerge-repo-network-websocket";
32+
import { WebSocketServerAdapter } from "@automerge/automerge-repo-network-websocket";
3333
import express from "express";
3434

3535
const wss = new WebSocketServer({ noServer: true });
@@ -39,23 +39,23 @@ server.on("upgrade", (request, socket, head) => {
3939
wss.emit("connection", socket, request);
4040
});
4141
});
42-
const adapter = new NodeWSServerAdapter(wss);
42+
const adapter = new WebSocketServerAdapter(wss);
4343
server.listen(8080);
4444
```
4545

4646
### Client
4747

48-
The client side of the connection is [`BrowserWebsocketClientAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo_network_websocket.BrowserWebSocketClientAdapter.html).
48+
The client side of the connection is [`WebSocketClientAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo-network-websocket.WebSocketClientAdapter.html).
4949

5050
```typescript
51-
import { BrowserWebSocketClientAdapter } from "@automerge/automerge-repo-network-websocket";
51+
import { WebSocketClientAdapter } from "@automerge/automerge-repo-network-websocket";
5252

53-
const network = new BrowserWebSocketClientAdapter("ws://localhost:3030");
53+
const network = new WebSocketClientAdapter("ws://localhost:3030");
5454
```
5555

5656
## MessageChannel
5757

58-
[`@automerge/automerge-repo-network-messagechannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge_repo_network_messagechannel.html) is a `NetworkAdapter` for communicating between processes within the same browser using a [`MessageChannel`](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
58+
[`@automerge/automerge-repo-network-messagechannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge-repo-network-messagechannel.html) is a `NetworkAdapter` for communicating between processes within the same browser using a [`MessageChannel`](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
5959

6060
```typescript
6161
import { MessageChannelNetworkAdapter } from "@automerge/automerge-repo-network-messagechannel";
@@ -75,7 +75,7 @@ const right = new Repo({
7575

7676
## BroadcastChannel
7777

78-
[`@automerge/automerge-repo-network-broadcastchannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge_repo_network_broadcastchannel.html) is a `NetworkAdapter` for communicating between processes in the same browser using a [`BroadcastChannel`](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel). This will in general be quite inefficient because the sync protocol is point-to-point so even though `BroadcastChannel` is a _broadcast_ channel, we still have to duplicate each message for every peer in the channel. It's better to use `MessageChannel` if you can, but `BroadcastChannel` is good in a pinch.
78+
[`@automerge/automerge-repo-network-broadcastchannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge-repo-network-broadcastchannel.html) is a `NetworkAdapter` for communicating between processes in the same browser using a [`BroadcastChannel`](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel). This will in general be quite inefficient because the sync protocol is point-to-point so even though `BroadcastChannel` is a _broadcast_ channel, we still have to duplicate each message for every peer in the channel. It's better to use `MessageChannel` if you can, but `BroadcastChannel` is good in a pinch.
7979

8080
```typescript
8181
import { BroadcastChannelNetworkAdapter } from "@automerge/automerge-repo-network-broadcastchannel";

content/docs/reference/repositories/storage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Storage
33
template: docs
44
---
55

6-
In `automerge-repo` "storage" refers to any implementation of [`StorageAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.StorageAdapter.html). You _can_ run a `Repo` without a `StorageAdapter` but it will be entirely transient and will have to load all its data from remote peers on every restart.
6+
In `automerge-repo` "storage" refers to any implementation of [`StorageAdapter`](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo.StorageAdapter.html). You _can_ run a `Repo` without a `StorageAdapter` but it will be entirely transient and will have to load all its data from remote peers on every restart.
77

88
`StorageAdapter` is designed to be safe to use concurrently, that is to say it is safe to have multiple `Repo`s talking to the same storage.
99

@@ -19,13 +19,13 @@ import { IndexedDBStorageAdapter } from "@automerge/automerge-repo-storage-index
1919
const storage = new IndexedDBStorageAdapter()
2020
```
2121

22-
You can customize the object database and object store the storage uses, see [the docs](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo_storage_indexeddb.IndexedDBStorageAdapter.html#constructor)
22+
You can customize the object database and object store the storage uses, see [the docs](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo-storage-indexeddb.IndexedDBStorageAdapter.html#constructor)
2323

24-
As noted above, this is safe for concurrent use so you can have multiple tabs pointing at the same storage. Note that they will not live update (you may want to use a [`MessageChannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge_repo_network_messagechannel.html) or [`BroadcastChannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge_repo_network_broadcastchannel.html) based `NetworkAdapter` for that) but on refresh the concurrent changes will be merged as per the normal merge rules.
24+
As noted above, this is safe for concurrent use so you can have multiple tabs pointing at the same storage. Note that they will not live update (you may want to use a [`MessageChannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge-repo-network-messagechannel.html) or [`BroadcastChannel`](https://automerge.org/automerge-repo/modules/_automerge_automerge-repo-network-broadcastchannel.html) based `NetworkAdapter` for that) but on refresh the concurrent changes will be merged as per the normal merge rules.
2525

2626
## File system
2727

28-
[`@automerge/automerge-repo-storage-nodefs`](https://www.npmjs.com/package/@automerge/automerge-repo-storage-nodefs) is a `StorageAdapter` which stores its data in a directory on the local filesystem. The location can be customized as per [the docs](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo_storage_nodefs.NodeFSStorageAdapter.html#constructor)
28+
[`@automerge/automerge-repo-storage-nodefs`](https://www.npmjs.com/package/@automerge/automerge-repo-storage-nodefs) is a `StorageAdapter` which stores its data in a directory on the local filesystem. The location can be customized as per [the docs](https://automerge.org/automerge-repo/classes/_automerge_automerge-repo-storage-nodefs.NodeFSStorageAdapter.html#constructor)
2929

3030
```typescript
3131
import { NodeFSStorageAdapter } from "@automerge/automerge-repo-storage-nodefs";

0 commit comments

Comments
 (0)