Edit a fmrl.site page
fmrl_editSaves new content as the next revision of an existing page and checks base_rev, preventing overwrites when a newer revision exists.
Instructions
Save new content to an existing page as its next revision; earlier revisions stay readable through fmrl_get's rev. To make a new page use fmrl_publish, and to change who can read a page use fmrl_set_visibility. Pass base_rev (the rev you read): if someone saved a newer revision meanwhile, nothing is saved and the answer gives latest_rev to read first. Works on pages this key owns and on any page whose management token you were given (pass the page URL as id and the token or recovery link separately as manage_token). A private page stays private under its same key, so every existing link keeps opening it; public content carrying a recognizable credential is refused. Editing watches the page: revisions other editors make afterwards show up in fmrl_inbox, with no fmrl_watch call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | A page id or page URL, optionally with its private key (#p=). Supply recovery separately as manage_token. | |
| title | No | Page title; for a private page it titles the encrypted document only. | |
| format | No | html or md; leave out to let the server detect it, or, with content_file, to take it from the extension. A private page is always sent as HTML, rendered here from Markdown. | |
| content | No | The page's new HTML or Markdown: 2 MiB at most on a public page, roughly 1.4 MB on a private one. Give this or content_file, not both. | |
| base_rev | No | The revision you read and are editing from; the edit fails if someone saved a newer one. | |
| content_file | No | Read the new content from this page's own file instead, so a large page never passes through the model: write it with fmrl_get's to_file, edit the file, save it from there. Only <id>.md or <id>.html (or .htm, .markdown, .mdx, .txt) in the fmrl folder (~/fmrl unless FMRL_FILES_DIR says otherwise) is read, where <id> is this page's id: give its file name or its full path. 2 MiB at most. | |
| manage_token | No | A 22-character recovery token or /c/<token> link for this page. It grants management, not deletion, and is used only with the edit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| rev | No | ||
| url | No | ||
| watching | No | ||
| latest_rev | No |