# Sharing and live editing

**Click `Private`; the link is on your clipboard.** The header says `Private` until you do. One click mints an unlisted read-only URL (`/s/<token>`, high-entropy, unrelated to the document id, never indexed), copies it, and opens a popover that says what happened. The toggle then reads `✓ Shared`, so a document never has to be clicked to find out who can see it. The link button beside it (🔗) copies the same link again whenever you need it.

**Click `Shared` to stop sharing.** It revokes the link with no confirmation, and sharing again mints a *different* URL, which is how a link that spread too far gets killed. The controls never move when clicked, so two quick clicks in the same place share and then unshare. ⌘K lists the same action as `Share document` or `Unshare document`, and `⌘⇧L` does whichever one the row says.

The shared page renders the document with the same editor in read-only trim and keeps `Copy Markdown` (the canonical Markdown, not a reconstruction). Revoked, deleted and never-existed links all show the same neutral "This document isn't shared anymore."

Sharing is for accounts. An anonymous visitor's Share routes through signup and comes back to the popover, one click from a link: creating an account is not a decision to publish, so nothing is shared until you click again.

## Two links, two powers

While a document is shared, a second toggle sits beside `Shared`: `Read-only` or `Editable`. Clicking `Read-only` mints a **second, independent** link (`/e/<token>`) and copies it. Anyone holding it can edit the document in a real editor, with no account and no invitation. The view link stays view-only, and a view token opens nothing but the read-only page. The toggle then reads `Editable`, the link button copies the edit link, and the popover lists the edit link first with `View only` beneath it. ⌘K offers the same toggle as `Make editable` or `Make read-only`. It offers `Make editable` on a private document too, which shares it and opens it for editing in one step.

Clicking `Editable` revokes the edit link and leaves the view link alone. Clicking `Shared` revokes both: "nobody but me" cannot mean "except the people already typing". Re-minting either one produces a fresh URL, which is how a leaked link dies.

Deleting the document kills both links along with it, and there is no re-minting that: a shared link outlives the sharing toggle, not the document. See [Accounts and saving](/docs/accounts-and-saving).

## Editing live

While an edit link exists, everyone on the document edits **live**: keystrokes propagate in well under a second, remote carets carry the other person's name, and small chips in the header say who else is here (`Owner`, `Guest 1`). Two people typing in the same paragraph merge rather than overwrite. Markdown stays the stored, exportable copy, written from the merged document by whichever client is caught up.

A guest gets the document and nothing else: no owner email, no document id, no account menu, no login links, and a title they can read but not change. The edit page is never indexed and never cached, so revoking bites on the next request.

## Nothing is overwritten silently

Every save names the revision it was built on and the server accepts only a match, so two tabs that both edited end in a question ("this document changed in another tab or device", with `Use latest` and `Keep mine`) rather than in a lost paragraph. Whichever way that is answered, the version it displaces is kept: `Keep mine` archives the other one on the server, and both branches keep a copy in this browser.

## Not in this version

Roles, named collaborators, expiring links and a collaborative title. Turning editing on or off reloads the page rather than swapping editors in place (a moment after the last click, so a quick second click can take the first back without one), a guest's identity does not survive their reload, the title is the owner's alone, and nothing in the product browses the archived versions yet.
