summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-11-25 11:25:00 -0700
committert <t@tjp.lol>2026-11-25 11:25:13 -0700
commit205b1d26b5be40424eace945a73867bdfefe90ce (patch)
tree74f51369662d6d065b218f8ba32bf32760eb4596 /README.md
parentd85d5e98868a4ee0dda6d3faf666996cdb18f998 (diff)
Anchor ghosts and alternatives to surrounding text, not byte offsets
Ghosted text and alternatives are saved with context from the text around them, so an outside edit no longer sends the whole file to raw Markdown. A ghost with no clear place goes to Overflow. An alternatives group that cannot be matched is dropped; its text is not kept. HTML comments show dimmed in place, with their delimiters hidden until the caret enters them. Ctrl+/ on a comment uncomments it. Comments are left out of Lab and AI requests, except the one an alternatives target sits in. The metadata moves to format v3. Builds before this one show v3 files as raw Markdown, so install this build before saving.
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 22 insertions, 9 deletions
diff --git a/README.md b/README.md
index a48e577..2a382cd 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ write_away "my draft.md" # open an existing file
| ← → ↑ ↓ with the pointer on underlined text | Flip through its versions. Typing gives the arrows back to the caret. |
| Delete with the pointer on underlined text | Throw out the version showing. |
| Ctrl+] and Ctrl+[ | Flip the group the caret is in, without the pointer. |
-| Ctrl+/ | Ghost the selection or the word. On ghosted text, revive it. |
+| Ctrl+/ | Ghost the selection or the word. On ghosted text or an HTML comment, revive it. |
| Ctrl+Shift+X | Stash the selection, or the paragraph, in Overflow. |
| Ctrl+Shift+D | Show or hide Overflow. Drag its left divider to resize it; closing and reopening keeps the width. |
| Ctrl+Return | Move Overflow's selection, or its paragraph, to the caret in the page. |
@@ -73,6 +73,8 @@ Fenced code blocks (three or more backticks or tildes, with an optional language
YAML frontmatter is shown the same way, with its `---` lines as the fences. It counts only when the first line is `---` and a later line of `---` or `...` closes it; its contents are not parsed.
+HTML comments (`<!-- … -->`) look like ghosts: dimmed, formatted, with the delimiters hidden until the caret is in the comment or against it. Saving leaves them where they are, as they are. Ctrl+/ on one takes its delimiters away, which publishes the text; a selection that touches any comment or ghost brings all of them back rather than ghosting the rest. A comment that starts a line can run over many, blank ones included. Anywhere else, including indented or in a list or a quote, it must close on its own line. What is never closed, or stands in code or frontmatter, stays as written. So do Write_Away’s own comments when it can’t use them.
+
## The Lab
Choose **Lab** in the bottom bar or press **Ctrl+Shift+L** (also in the Write menu); the shortcut leaves read mode if needed. During a review, use **Ctrl+Shift+N** for Next, **Ctrl+Shift+K** for Keep, **Ctrl+Shift+P** for Apply rest, and **Ctrl+Shift+O** for Discard/Original. The in-window chooser has six editing passes and a row of trim strengths. Use the arrow keys to move, Return to choose, or Escape to go back to the draft. A pass can mark weak, long, or convoluted sentences, changes of tone, or filler. Punctuation and typo fixes are proposals until you apply them. **Next** visits the next passage; **Keep** leaves it alone.
@@ -81,7 +83,7 @@ The four trims aim for about 10%, 20%, 30%, or 50%. They ghost proposed cuts usi
## Inference (optional)
-Choose **Write_Away → Inference…**, or configure it on your first `??`. For alternatives, the request sends the target, its paragraph and the variants already tried. Choosing a Lab pass sends the numbered draft text (including ghosted words, not Overflow or unselected alternatives). Ordinary editing and saving make no requests. The app asks for five word alternatives or three longer ones. A robot marker identifies suggestions. Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Google Interactions are available via libpantograph. Use HTTPS for remote endpoints.
+Choose **Write_Away → Inference…**, or configure it on your first `??`. For alternatives, the request sends the target, its paragraph and the variants already tried. HTML comments in the paragraph are left out, unless the target is in one or runs over one. Choosing a Lab pass sends the numbered draft text (including ghosted words, not HTML comments, Overflow or unselected alternatives). Ordinary editing and saving make no requests. The app asks for five word alternatives or three longer ones. A robot marker identifies suggestions. Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Google Interactions are available via libpantograph. Use HTTPS for remote endpoints.
The key is **not in Keychain**: it is stored unencrypted in `~/Library/Application Support/Write_Away/inference.json`, mode `0600`. Save an empty key to remove it. The other settings live in the `local.write-away` preferences domain. When upgrading from a differently named build, re-enter your inference settings or copy your existing `inference.json` into this directory with mode `0600`.
@@ -90,7 +92,7 @@ The key is **not in Keychain**: it is stored unencrypted in `~/Library/Applicati
```markdown
<!-- overflow
(Stashed paragraphs.)-->
-<!-- write_away {"v":2,"groups":[],"ghosts":[{"at":31,"text":" Maybe cut this."}],"visible_sha256":"9cb2aa331991f33454e5e5339c985df756e0bbaaed21ad2c0207b327641a92d0"} -->
+<!-- write_away {"v":3,"groups":[],"ghosts":[{"at":31,"text":" Maybe cut this.","before":"# A draft\n\nThe tension is real.","after":"\n","alone":[12,null],"together":true}]} -->
# A draft
@@ -114,7 +116,7 @@ closes it, and the rest of the draft follows their blank line.
---
title: A draft
---
-<!-- write_away {"v":2,"groups":[…]} -->
+<!-- write_away {"v":3,"groups":[…]} -->
# A draft
@@ -127,11 +129,22 @@ go first as before.
Files record UTF-8 byte offsets into the restored editor body. While editing, ghosts are attributes on the text itself; Save computes fresh offsets. A fully ghosted alternative stays ghosted when swapped. If a replacement crosses a ghost boundary, revive the ghosted part first: Write_Away won’t guess which words in another version should be hidden.
-If a file has ghosts and its visible
-bytes change outside Write_Away (even just a newline), Write_Away opens the original
-Markdown as-is, with its comments intact, rather than guessing where to put the ghosts.
-Without ghosts, alternatives can still follow matching text after an outside edit.
-Legacy Overflow trailers and v1 records are supported. For drafts saved under an earlier app name, change only the identifier on the metadata comment to `write_away` before opening; leave its JSON and the draft text unchanged.
+The file can be edited elsewhere. Each ghost and each group of alternatives is saved with up
+to 32 bytes of the text on either side, and opens where those still match: at its old offset,
+or else in the one place that has both sides, or enough of either to have been the only such
+text when it was saved. A group’s showing version is part of what has to match.
+
+A ghost with no clear place opens in Overflow instead. Overflow opens to show it and the piece
+counts as changed; the next save makes the move permanent, even if the old surroundings come
+back later. Until then the file is untouched. A group with no clear place, or that shared text
+with such a ghost, is dropped without a word: the page keeps what the file says, and the next
+save forgets the other versions.
+
+v1 and v2 files still open, and save as v3, which earlier releases show as plain
+Markdown. v2 didn’t save surroundings, so if its visible bytes were changed elsewhere all its
+ghosts open in Overflow, and a group follows its showing version only to the same offset or the
+only place it occurs. v1 files whose ghosts no longer fit, and any file whose comments are
+malformed, open as they are. Legacy Overflow trailers are supported. For drafts saved under an earlier app name, change only the identifier on the metadata comment to `write_away` before opening; leave its JSON and the draft text unchanged.
## Not here yet