updates plug with all sorts of awesome improvements

This commit is contained in:
2026-11-09 13:09:09 +01:00
parent a92d6f8871
commit 3afdb6d67f
553 changed files with 22780 additions and 13155 deletions
+118 -38
View File
@@ -7,36 +7,38 @@ Plak is a native macOS notepad with one long page of plain text. It has no files
### 1.1 The page
- There is one page. It grows at the bottom, without limit.
- The page is one plain text: you can click anywhere and type, and you can select across paragraphs. There is no markdown rendering: `# title` or `**bold**` show as you type them. Only images (1.7), code blocks and tables (1.8) render.
- The text sits in one reading column, about 68 characters wide, in the centre of the window.
- The text sits in one reading column in the centre of the window. The column is about 68 characters wide by default; ⌘. and ⌘, make it wider or narrower, from 40 to 160 characters in steps of 8. The window width still caps it.
- A **block** is a run of lines without a blank line in it. Blocks exist only for the created date (1.6); you do not see them as boxes.
- A line that starts with one `=` directly followed by a title is a **bookmark** (1.11).
### 1.2 Open the app
- Plak has no Dock icon and is not in ⌘Tab. It lives in the menu bar: the menu bar icon has a menu with Show Plak, Hide Plak and Quit Plak.
- ⌘P, from any app on any desktop, shows the window on the current desktop, also over an app in fullscreen. Plak takes ⌘P from every other app on purpose.
- ⌘P is a toggle: while you are in plak (plak is in front and its window is visible), ⌘P hides plak and you are back in the app you came from. Esc does the same.
- Plak has no Dock icon and is not in ⌘Tab. It lives in the menu bar: the menu bar icon has a menu with Show Plak (⌘N), Hide Plak, a separator, Plak Help, a separator, and Quit Plak. Plak Help adds the help text at the end of the page (1.13).
- ⌘N, from any app on any desktop, shows the window on the current desktop, also over an app in fullscreen. Plak takes ⌘N from every other app on purpose.
- ⌘N is a toggle: while you are in plak (plak is in front and its window is visible), ⌘N hides plak and you are back in the app you came from. Esc does the same.
- When plak is not running, you start it from Spotlight or Finder.
- Plak opens scrolled to the bottom, with the caret at the end of the text.
- The end of the text is always in the vertical middle of the window. To make this possible, the page has empty space below the text of half the window height. This is also true when the page is empty or short.
- You can type or paste at once, without a click.
- When plak is already running and you open it again from Spotlight or Finder, it shows scrolled to the end, as at a launch. ⌘P and Show Plak in the menu bar bring it back to the front without a scroll.
- Opening plak (Spotlight, ⌘P, Show Plak) always brings it in front of other apps, with the caret ready. It does not stay on top: click another app and that app comes in front.
- When plak is already running and you open it again from Spotlight or Finder, it shows scrolled to the end, as at a launch. ⌘N and Show Plak in the menu bar bring it back to the front without a scroll.
- Opening plak (Spotlight, ⌘N, Show Plak) always brings it in front of other apps, with the caret ready. It does not stay on top: click another app and that app comes in front.
### 1.3 Type and paste
- Typing and editing work as in any Mac text field, anywhere on the page.
- While you type, the caret never goes lower than 20% of the window height above the bottom edge. When it would go lower, the page scrolls so that the caret sits on that 20% line, and you see as much of the text above as possible. The page does not scroll while the caret stays above that line. At launch the end still starts in the middle (1.2); typing then moves the caret down to the 20% line.
- A paste of rich text inserts only its plain text.
- A click in the empty space below the text puts the caret at the end of the text.
- A **link** is a web or mail address in the text (`https://…`, `plak.app`, `jo@example.com`). It looks like normal text. Hold ⌘ and move the pointer over it: it is underlined and the pointer is the hand. ⌘-click opens it in the default browser or mail app; the caret does not move.
### 1.4 Save
- Plak saves the page to the page file about 0.5 seconds after you stop typing, and again when you quit and when plak goes to the background.
- The page file is plain text, saved exactly as you typed it. Blank lines are kept, also several in a row. Plak adds only three kinds of line: the date line above a block (1.6), the image line (1.7) and the fence lines around a code block or table (1.8).
- If plak cannot write the page file, a small message shows at the top of the window, and plak tries again on the next change. Plak never loses the text in memory.
- If the page file does not exist, plak starts with an empty page and makes the file on the first save.
- If the page file does not exist, plak starts with the welcome text (1.13) and makes the file on the first save.
- If the page file exists but cannot be read, plak shows an alert and quits without saving, so it never overwrites the file.
### 1.5 Window
- One window. Plak remembers its size and position.
- Esc, ⌘P (while you are in plak), ⌘W, the close button and Hide Plak in the menu bar hide plak, and the app you came from comes in front again. ⌘P, Show Plak or Spotlight shows it again. ⌘Q and Quit Plak quit.
- Esc, ⌘N (while you are in plak), ⌘W, the close button and Hide Plak in the menu bar hide plak, and the app you came from comes in front again. ⌘N, Show Plak or Spotlight shows it again. ⌘Q and Quit Plak quit.
- During an input-method composition (Japanese or Chinese input, the accent popup) Esc only cancels the composition; it does not hide plak. In a code block or table, Esc acts in the object and does not hide plak either (1.8).
- The window comes to the desktop you are on, and shows over an app in fullscreen.
- The window has no toolbar and no title text. The title bar is transparent and shows the paper; the text scrolls under it.
@@ -44,11 +46,11 @@ Plak is a native macOS notepad with one long page of plain text. It has no files
### 1.6 Created date
- Each block knows when it was made: the moment you typed or pasted its first character, or dropped its image.
- When the margin left of the column is at least 120 pt wide, the date shows there, at the height of the first line of the block, right-aligned, small, in `inkMuted`. When the margin is narrower, no date shows. A click in the margin acts as a click in the text next to it.
- The page does not show the created date of every block. It shows the created date of a bookmark (1.11): the date of the block that holds the bookmark line. A click in the space beside the column acts as a click in the text next to it.
- Format: `16 okt 08:55` (Dutch month names, 24-hour time). The year is added only when it is not the current year: `3 mrt 2025 14:02`.
- When you split a block by typing a blank line inside it, both parts keep the date of the block. When you join two blocks by deleting the blank line between them, the joined block keeps the date of the upper block.
- Text you paste into a block becomes part of that block and gets no own date. A paste that starts a new block (after a blank line, or on an empty page) dates that block.
- A block without a date (text from before this feature, or text typed into page.md in another app) shows no date.
- A block without a date (text from before this feature, or text typed into page.md in another app) has no date; a bookmark in it shows its title alone.
- In the page file, the date is a comment line directly above the first line of the block: `<!-- 2026-10-16 08:55 -->`, local time. Only a line that matches this exact pattern is a date; any other comment is normal text. You never see the date line in the page.
### 1.7 Images
@@ -74,12 +76,12 @@ Plak is a native macOS notepad with one long page of plain text. It has no files
- **One object**: a code block or table is one character in the text, as an image is (1.7). PHP, JSON and XML become a code block; CSV becomes a table.
**Code block** (PHP, JSON, XML)
- **Look**: syntax colours on `codePaper`, the full column width, in OpenDyslexic Mono. Long lines wrap.
- **Look**: syntax colours on `codePaper`, the full column width, in IBM Plex Mono. Long lines wrap.
- **Edit**: click the code block to edit it in place. A caret appears inside, and the colours update while you type. Tab inserts 4 spaces.
- Esc or a click outside ends the edit. ↑ on the first line goes to the text above; ↓ on the last line goes to the text below.
**Table** (CSV)
- **Look**: a grid with thin lines in `selection`, in OpenDyslexic Mono. Each column is as wide as its content. A long value is cut off with `…`. A wide table scrolls sideways while you are in it.
- **Look**: a grid with thin lines in `rule`, in IBM Plex Mono. Each column is as wide as its content. A long value is cut off with `…`. A wide table scrolls sideways while you are in it.
- Click a cell to select it. Then:
| Keys | Action |
@@ -120,27 +122,87 @@ Plak is a native macOS notepad with one long page of plain text. It has no files
| ⌥⇧⌘V | Paste as Plain Text: no code block or table detection (1.8) |
| ⌘A | Does nothing. Plak has no Select All: the page is not meant to be cleared in one go. The Edit menu has no Select All item. |
| ⌘+ / ⌘− / ⌘0 | Text size bigger, smaller, default |
| ⌘P | Show the window, from any app on any desktop; in plak, hide it and go back to the previous app |
| ⌘. / ⌘, | Text column wider, narrower |
| ⌘N | Show the window, from any app on any desktop; in plak, hide it and go back to the previous app |
| Esc | Hide plak and go back to the previous app; during an input-method composition, cancel the composition; in a code block or table, end the edit or leave the table (1.8) |
| ⌘W | Hide plak and go back to the previous app |
| ⌘Q | Save and quit |
### 1.10 Add from other apps
Other apps, scripts and Shortcuts add to the page through the `plak://` URL scheme. Both URLs append a new block at the end of the page, with its own created date, the same way ⌘V would paste it: PHP, JSON, XML and CSV become a code block or table (1.8), and an image becomes an image (1.7). Then the window shows with the end of the page in the vertical middle, as at launch. This also works when plak is not running.
- `plak://append?text=<percent-encoded text>` appends the text. Without `text`, or with an empty one, nothing is added, but the window still shows.
- `plak://paste` appends what the pasteboard holds.
- Any other URL does nothing.
`scripts/bundle.sh --install` registers the scheme with macOS.
### 1.11 Bookmarks
- A **bookmark** is a line that starts with exactly one `=`, directly followed by a character that is neither a space nor `=`, as `=update on this`. The title is the text after the `=`, without the spaces at its end. `=` alone, `= title` (a space after the `=`), `==twice` and `== Contact ==` are no bookmarks. An `=` inside a line, or after a space, is no bookmark either.
- The `=` stays visible as you typed it. Nothing new is stored: the page file keeps the line as plain text.
- The date of a bookmark is the created date of the block that holds it (1.6), as `4 okt 07:58`. Without a created date the bookmark has only its title.
- Bookmark labels and the bookmark index are in IBM Plex Mono, at 0.75 of the text size (10 pt at 13 pt), in `inkMuted`. The rules are 1 pt lines in `bookmarkRule`.
- Plak picks one of two layouts from the space beside the column:
- **Wide**: the space on each side of the column is at least the widest label `title - date` plus 64 pt (room for its rules), but never less than 160 pt. A label counts for at most 40 characters of the label font (240 pt at 13 pt text), so one long title never keeps the window narrow; a label too long for its room ends in `…`.
- **Narrow**: any less space.
- **Wide**: right of the column, at the height of the first line of the bookmark, a rule starts 8 pt right of the column and runs to the label `title - date`; after the label a rule of 16 pt runs to the right edge of the window.
- **Wide**: the **bookmark index** sits at the top left of the window, 8 pt from the left edge and below the title bar. It holds the last 10 bookmarks of the page (the 10 lowest), one line each, `title - date`, top to bottom in page order. It stays in place while the page scrolls. The pointer over an entry is the hand. A click on an entry puts the caret at the end of that bookmark line and scrolls the line to the vertical middle. A label too long for the side space ends in `…`. When 10 lines do not fit the window height, the top of the index is cut off.
- **Narrow**: there is no bookmark index. On the last line of the bookmark, a rule runs from just after the text to the label with only the date, which ends at the right edge of the column; then a short rule continues past the column when there is room. A bookmark without a date shows nothing, and nothing shows when the line leaves no room for the date.
- The labels and the index follow every change: typing, scrolling, a window resize, ⌘+ / ⌘− and ⌘. / ⌘,.
### 1.12 Lorem text
- Type `#lorem` at the very start of a line: the moment you type the `m`, those six characters become **lorem text**. Only typing does this; a paste of `#lorem`, or `#lorem` in the page file, stays text. `#lorem` after other text on the line, or after a space, stays text too.
- Lorem text is one sentence of exactly 16 words, a blank line, a paragraph of 3 to 5 sentences, a blank line, and a second paragraph of 3 to 5 sentences. The sentences of a paragraph are joined by spaces.
- The sentences come from `lorem.txt` in the app, one sentence per line, picked at random. One insertion never uses a line twice.
- After the second paragraph come three more blocks, each after a blank line, one item per line:
- 4 Dutch telephone numbers with random digits, mobile and landline mixed: `06-12345678`, `+31 6 12345678`, `020-1234567` or `0546-123456`.
- 4 Dutch addresses, each on one line: `Kerkstraat 12, 1234 AB Gouda`. The house number is 1 to 250, sometimes with a letter (`12a`). The postcode is 4 digits from 1000 to 9999 and 2 capital letters, never `SS`, `SD` or `SA`.
- 4 e-mail addresses as `firstname.lastname@example.nl`: lower case, ASCII only (`Zoë van den Berg` becomes `zoe.vandenberg`), on `example.nl`, `example.com` or `example.org` only, so they never reach a real mailbox.
- No item shows twice in one group. The street names, cities, first names and last names come from `contacts.json` in the app; the digits, numbers and postcodes are random.
- Text after `#lorem` on that line stays after the lorem text. The caret goes to the end of the lorem text.
- ⌘Z undoes the lorem text in one step and brings back `#lorem`. The page saves, and the new blocks get a created date (1.6), as with any typing.
### 1.13 Welcome text and help text
- At the first startup of an installation the page file does not exist. Plak then starts with the **welcome text** instead of an empty page.
- The welcome text is one line: `Welcome to plak. For the docs, the tricks and the shortcuts, choose Plak Help in the menu bar icon.` It is one block, with the created date of the moment of that first startup (1.6).
- Plak writes the welcome text to the page file on the first save (1.4): when plak goes to the background, when you quit, or after the first change. From then on the page file exists, so the welcome text never comes back by itself.
- An existing page file is never replaced, also when it is empty.
- The **help text** tells what plak is for: an on-the-fly place to paste into and copy from, for text, Markdown, images, code and CSV. Then it shows the tricks: ⌘N, Esc and ⌘W, the menu bar icon, images by paste and drop, code blocks and tables, ⌥⇧⌘V, a table of the shortcuts, bookmarks, the `plak://` URLs, `#lorem`, links, and where the page file is.
- The help text comes from `help.md` in the app, next to `lorem.txt`. It is in the format of the page file: bookmark lines (1.11) are the section titles, and one fenced `json` code block and one fenced `csv` table (the shortcuts) show as objects (1.8).
- Only Plak Help in the menu bar icon adds the help text, at any time. It appends the help text at the end of the page as new blocks, the same way `plak://append` does (1.10): the `json` code block and the `csv` table become objects, every appended block gets a created date (1.6), and the window shows with the end of the page in the vertical middle. The page keeps everything above it; nothing is replaced.
- The welcome text and the help text are normal page text: you can edit or delete them.
## 2. Look
- **Paper**: a mid-tone warm paper, not bright and not dark. The start values are below; we tune them on screen.
- **Paper**: the Kade dark slate look, the same as Helder. Plak is dark only.
| Token | Value | Use |
|---|---|---|
| `paper` | `#D8D0C0` | Window and page background |
| `ink` | `#2B2621` | Text |
| `inkMuted` | `#6E655A` | Dates, `image missing` |
| `accent` | `#8A4B2A` | The caret |
| `selection` | `#B9AE98` | Selected text, the lines of a table |
| `codePaper` | `#CBC2B0` | Code block background |
| `paper` | `#101720` | Window and page background |
| `ink` | `#E4E7E6` | Text |
| `inkMuted` | `#6C7783` | Bookmark labels, the bookmark index, `image missing` |
| `accent` | `#E8913A` | The caret |
| `selection` | `#E8913A` at 22% | Selected text |
| `rule` | `#3A424C` | The lines of a table |
| `bookmarkRule` | `#6C7783` | The rules beside a bookmark label |
| `panel` | `#18202B` | The save error banner |
| `codePaper` | `#18202B` | Code block background |
- **Syntax colours** for code blocks have no start values; we tune them on screen.
- **Font**: OpenDyslexic for all text, and OpenDyslexic Mono for code blocks and tables. Both are bundled in the app. OpenDyslexic has the OFL licence (`OFL.txt`); OpenDyslexic Mono has the Bitstream Vera licence (`OpenDyslexicMono-LICENSE.txt`), both next to the files.
- **Text size** is 16 pt by default, with a line height of 1.6.
- **Syntax colours** for code blocks are the six muted colours of Helder:
| Token | Value | Use |
|---|---|---|
| `codeKeyword` | `#C3A6CE` | Keywords, and true, false and null |
| `codeString` | `#8FBFB4` | Strings, XML attribute values |
| `codeComment` | `#6C7783` | Comments |
| `codeNumber` | `#F0B476` | Numbers |
| `codeVariable` | `#BAC0C0` | PHP `$variables` |
| `codeTag` | `#C3A6CE` | XML tags, the PHP open and close tags |
| `codeAttribute` | `#BAC0C0` | XML attribute names, JSON keys |
- **Font**: IBM Plex Mono for the page text, code blocks, tables, bookmark labels and the bookmark index, and IBM Plex Sans for the save error banner. Both are bundled under the SIL Open Font License. When a face does not load, plak uses the macOS system font.
- **Text size** is 13 pt by default, with a 20 pt line (IBM Plex Mono 13/20). Code blocks and tables use the same size.
- No shadows, no borders, no scroll bar unless you scroll.
## 3. Architecture
@@ -149,17 +211,17 @@ SwiftPM package, macOS 14+, Swift 6, AppKit. No dependencies.
| Target | Contents |
|---|---|
| `PlakCore` | `PageFile`: reads the page file text into plain text plus block dates and image lines, and writes it back. Block splitting (blank lines), the date line pattern, the image line pattern, the date formatter. Fence parsing, paste detection, the CSV model, the JSON formatter and the syntax tokenizers. Pure Swift, no AppKit. |
| `PlakServices` | `PageStore`: reads and writes the page file, the debounced save. `ImageStore`: copies or writes image files into `images/` and gives back the relative path. |
| `PlakUI` | The window, the page text view, the image attachments, the code block and table attachments and their in-place editors, the date margin, paste and drop, the theme and the fonts. |
| `Plak` | The executable: the app delegate, the menu, the menu bar icon, the global ⌘P. |
| `PlakCore` | `PageFile`: reads the page file text into plain text plus block dates and image lines, and writes it back. Block splitting (blank lines), the date line pattern, the image line pattern, the date formatter. Bookmark finding, fence parsing, paste detection, the `plak://` URL parser, the CSV model, the JSON formatter and the syntax tokenizers. `LoremText`: reads `lorem.txt` (a resource of this target) and picks the lorem text. `help.md` (a resource of this target) and its loader: the help text. The welcome text: the one sentence of the first startup. Pure Swift, no AppKit. |
| `PlakServices` | `PageStore`: reads and writes the page file, the debounced save, the welcome text when the page file is missing. `ImageStore`: copies or writes image files into `images/` and gives back the relative path. |
| `PlakUI` | The window, the page text view, the image attachments, the code block and table attachments and their in-place editors, the bookmark labels and the bookmark index, paste and drop, the theme and the fonts. |
| `Plak` | The executable: the app delegate, the menu, the menu bar icon, the global ⌘N. |
### Page view
- An `NSScrollView` with one editable `NSTextView` for the whole page, the text in the reading column, and a bottom inset of half the visible height. The inset changes when the window changes size.
- An image is an `NSTextAttachment` that knows its relative path.
- A code block or table is an `NSTextAttachment` too. While you edit it, an editor view is placed over the object; when the edit ends, the editor goes away.
- The created date is a custom text attribute on every character of a block. The date of a block is the date on its first character. When a new block has no date, plak stamps it with now. Because the characters carry the date, a split keeps the date for both parts. New typing at the start of a new block must not inherit the date of the block above.
- The margin draws the dates; it is not made of views that take clicks.
- The text view draws the bookmark labels and rules; they are not views that take clicks. The bookmark index is its own view over the top left of the page, laid out by the page view controller.
### Round trip
- Read the page file, then save it without a change: the file must be the same, byte for byte, except that a trailing newline is always written and CRLF becomes LF.
@@ -193,31 +255,40 @@ scripts/bundle.sh # build/Plak.app, ad-hoc signed (--install copies it
9. `ImageStore` copies a file with its extension, writes raw image data as PNG, and makes the `images/` folder when it is missing; names follow the pattern in 1.7.
10. An image attachment is never wider than the column; a missing file gives the `image missing` placeholder and saves back as the same line.
11. Copy of a selection with an image gives the `![](images/…)` line as plain text; pasting that text gives the image again.
12. `PageStore` writes once after a burst of changes (debounce), with the latest text, and starts with an empty page when the page file is missing.
12. `PageStore` writes once after a burst of changes (debounce), with the latest text. A missing page file gives the welcome text, not an empty page (18i).
13. Fence round trip: a page file with a fenced code block and a fenced table, each with a date line above it and blank lines inside, reads and writes back the same.
14. A code block whose text holds a line that starts with ```` ``` ```` gets a longer fence, and reads back as the same text.
15. A fence without a closing line, or with a word other than `php`, `json`, `xml` or `csv`, stays normal text.
16. Paste detection gives the right kind for PHP (`<?php` and `<?=`), JSON, XML and CSV (`,`, `;` and tab). These stay text: a sentence with commas, one CSV line, lines with different field counts, invalid JSON, invalid XML.
17. CSV: quoted fields with the delimiter, quotes and line breaks inside read correctly. An unedited table writes back its original text; an edited table writes its own delimiter and quotes only where necessary.
18. JSON on one line is pretty-printed with a 2-space indent and the key order kept. Copy of a selection with a code block or table gives the fenced text; pasting that text gives the object again.
18a. Link detection finds a web or mail address that covers a character, with its range; outside an address there is no link.
18b. `URLCommand`: `plak://append?text=…` gives the percent-decoded text (a `+` stays a `+`, newlines and unicode kept), without text the empty text; `plak://paste` gives paste; another host or another scheme gives nothing.
18c. Append (1.10): on an empty page the text becomes the page; after a block it comes after a blank line as a new block with its own date line; JSON becomes a fenced `json` code block; after a text that ends with a newline only one more newline is added.
18d. Bookmarks: a line of one `=` directly followed by a title gives a bookmark with the title, trimmed at its end, and the range of its line; `=` alone, `= `, `= title`, `==twice`, `== Contact ==`, an `=` inside a line and an indented `=` give none.
18e. Bookmark layout (1.11): a wide window shows the bookmark index and the `title - date` labels right of the column; a narrow one hides the index and shows the date only, inside the column; 12 bookmarks give an index of the last 10 in page order; a click on an entry puts the caret at the end of that line; the labels and the index use IBM Plex Mono. In a 1700 pt window with a `== … ==` line and a wide table, a render of the page shows the rule, the label and the tail right of the column. One very long title does not keep a window narrow whose side space holds a label of 40 characters.
18f. Lorem text (1.12): `lorem.txt` and `contacts.json` load from the resource bundle, `lorem.txt` with at least 200 lines; with an injected generator the first sentence has exactly 16 words, each paragraph has 3 to 5 sentences, no line shows twice, and the text is 6 blocks with one blank line between each: sentence, paragraph, paragraph, phones, addresses, e-mails. Each contact group has 4 items without duplicates; the phones match a Dutch mobile or landline pattern and hold both kinds; the addresses match `^.+ \d{1,3}[a-z]?, \d{4} [A-Z]{2} .+$` with a house number of 1 to 250 and no `SS`, `SD` or `SA`; the e-mails are lower case ASCII on `example.nl`, `example.com` or `example.org`. The same seed gives the same lorem text.
18g. Typing `#lorem` at the start of a line replaces it with lorem text, keeps the text after it and puts the caret at the end; its 6 blocks get a created date. `a #lorem` and a pasted `#lorem` stay text. One undo brings back `#lorem`.
18h. Help text (1.13): `help.md` loads from the resource bundle. The `json` fence gives a code block, and the `csv` fence gives a table of 11 rows and 2 columns, with `⌘. / ⌘,` as one value. The bookmarks include `welcome to plak` and `shortcuts`. The help text reads and writes back the same (round trip). Welcome text (1.13): it is the one line `Welcome to plak. For the docs, the tricks and the shortcuts, choose Plak Help in the menu bar icon.`, in one block with the injected date.
18i. `PageStore`: a missing page file gives the welcome text, and the first flush writes the date line and the welcome sentence to the page file. An existing empty page file stays empty, and nothing is written.
### Manual checks on the running app
19. Launch with a long page: the window shows the end of the text in the vertical middle, with the caret there.
20. Launch with an empty page: the caret is in the vertical middle.
21. Click in the middle of the page and type: the text goes there. Select across two paragraphs and delete: it works as in any text field.
22. Type `# title` and `**bold**`: they show as typed, without styling.
23. In a wide window the dates show in the left margin; in a narrow window they disappear.
23. Type `=update on this` in a dated block. In a wide window the bookmark index shows at the top left and `update on this - <date>` shows right of the column, with a rule on both sides; a click on the index entry jumps to the line. In a narrow window the index goes and the date shows at the right edge of the column.
24. Paste a screenshot (⇧⌃⌘4, then ⌘V): the image shows at the caret. Backspace after it deletes it; ⌘Z brings it back.
25. Drag an image from Finder into the middle of the page: the caret shows the drop place, and the image lands there.
26. Quit and open again: text, dates and images are back; page.md holds the date lines and the `![](images/…)` lines.
27. ⌘W hides the window; ⌘P shows it again with the same scroll position.
28. Plak shows no Dock icon and is not in ⌘Tab; the menu bar icon is there. Hide Plak hides the window, Show Plak shows it.
29. Show the window on desktop 1, go to desktop 2 and press ⌘P: the window comes to desktop 2.
30. Put another app in fullscreen and press ⌘P: the window shows over it. With another app in front, press ⌘P: plak comes in front with the caret ready; click the other app and it comes in front again.
27. ⌘W hides the window; ⌘N shows it again with the same scroll position.
28. Plak shows no Dock icon and is not in ⌘Tab; the menu bar icon is there. Its menu is Show Plak (⌘N), Hide Plak, a separator, Plak Help, a separator, Quit Plak. Hide Plak hides the window, Show Plak shows it.
29. Show the window on desktop 1, go to desktop 2 and press ⌘N: the window comes to desktop 2.
30. Put another app in fullscreen and press ⌘N: the window shows over it. With another app in front, press ⌘N: plak comes in front with the caret ready; click the other app and it comes in front again.
31. Quit Plak from the menu bar icon, then open plak from Spotlight: it starts, scrolled to the end.
32. With plak running, scroll up, then open plak from Spotlight: it shows scrolled to the end. Do it again after ⌘W: the same. Scroll up and press ⌘P, or use Show Plak: the scroll position stays.
32. With plak running, scroll up, then open plak from Spotlight: it shows scrolled to the end. Do it again after ⌘W: the same. Scroll up and press ⌘N, or use Show Plak: the scroll position stays.
33. Move the pointer into the top 28 pt of the window, also after a scroll, a resize, and with another app in front: it is the arrow, and press and drag moves the window. Below the strip it is the text cursor.
34. In another app, press ⌘P, then Esc: plak hides and the other app is in front with its caret ready. Do it again with ⌘P instead of Esc: the same. ⌘P again shows plak with the same scroll position, on the current desktop.
34. In another app, press ⌘N, then Esc: plak hides and the other app is in front with its caret ready. Do it again with ⌘N instead of Esc: the same. ⌘N again shows plak with the same scroll position, on the current desktop.
35. ⌘W and Hide Plak also give the other app its focus back; type a word just before, quit and open again: the word is there.
36. Hold `e` for the accent popup and press Esc: the popup closes and plak stays. Start a Japanese or Chinese composition and press Esc: the composition is cancelled and plak stays.
37. Paste PHP, JSON, XML and CSV text: each becomes one object on its own line. Paste a normal sentence: it stays text. Paste JSON with ⌥⇧⌘V: it stays text.
@@ -226,6 +297,11 @@ scripts/bundle.sh # build/Plak.app, ad-hoc signed (--install copies it
40. ↑ on the first line of a code block, or on the first row of a table, goes to the text above; ↓ on the last goes to the text below.
41. Press Esc while you edit a code block or a table cell: the edit ends and plak stays open.
42. Edit a code block and a table, then quit and open again: the edits are back, and page.md holds the fenced blocks.
43. Type `https://plak.app`. Hold ⌘ over it: it is underlined and the pointer is the hand; let go of ⌘: the underline goes and the text cursor is back. ⌘-click opens it in the browser; page.md is unchanged.
44. Run `open 'plak://append?text=hello%20world'`, with plak running and with plak quit: the window shows with `hello world` as the last block, in the vertical middle. Copy a screenshot and run `open plak://paste`: the image is the last block.
45. In the bundled app (`scripts/bundle.sh`), type `#lorem` on a new line: lorem text shows, with the caret at its end. ⌘Z brings back `#lorem`.
46. Quit plak and delete page.md, then open plak: the page shows only the one welcome sentence. Quit and open again: it is the same page, not a second copy.
47. Choose Plak Help in the menu bar icon: the help text is added at the end of the page, with the table and the code block, and the window shows it in the middle; the text above is unchanged.
## 6. Out of scope for v1
@@ -239,9 +315,9 @@ Remembered for later, not built now:
These follow from the answers, but you did not choose them yourself. Change them here if they are wrong.
- The caret starts at the end of the page when plak opens (1.2).
- A launch and a reopen from Spotlight or Finder scroll to the end; ⌘P and Show Plak keep your place (1.2).
- A launch and a reopen from Spotlight or Finder scroll to the end; ⌘N and Show Plak keep your place (1.2).
- ⌘W hides the window instead of quitting (1.5).
- ⌘P toggles: in plak it hides plak, from another app it shows it (1.2). Esc hides plak too (1.5).
- ⌘N toggles: in plak it hides plak, from another app it shows it (1.2). Esc hides plak too (1.5).
- Hiding hides the whole app, not only the window, so that the previous app gets its focus back (1.5).
- The menu bar icon is the SF Symbol `note.text` (1.2).
- The paper colours in section 2.
@@ -256,3 +332,7 @@ These follow from the answers, but you did not choose them yourself. Change them
- Long values in a table are cut off with `…` (1.8).
- ⌥⇧⌘V pastes without code block or table detection (1.8).
- The key map of the table (1.8).
- The wide layout rule of bookmarks: the widest label, counted for at most 40 characters, plus 64 pt, at least 160 pt (1.11).
- In the narrow layout a bookmark without a date shows nothing (1.11).
- The bookmark rule uses the colour of `inkMuted`, so it reads as a light grey hairline (2).
- The first startup is a missing page file, not an empty one, so a page you emptied yourself stays empty (1.13).
+9 -3
View File
@@ -4,14 +4,20 @@
|---|---|---|
| page | All the content of plak: one long, never-ending plain text. There is only one. | document, note, file (in the UI) |
| block | A run of lines without a blank line in it. Blocks exist only to give text a created date. | cell, chunk, section, paragraph (in code) |
| created date | The moment a block was made, shown in the left margin when the window is wide enough. Stored as a date line above the block in the page file. | timestamp, created_at (in the UI) |
| created date | The moment a block was made. Shown as the date of a bookmark in the block. Stored as a date line above the block in the page file. | timestamp, created_at (in the UI) |
| date line | The line `<!-- 2026-10-16 08:55 -->` above a block in the page file. Never shown in the page. | header, metadata |
| bookmark | A line that starts with one `=` directly followed by a title, as `=update on this`. Shows its title and the created date of its block beside the column. Stored as plain text. | heading, anchor, marker |
| bookmark index | The list of the last 10 bookmarks at the top left of the window, in a wide window. A click on an entry jumps to that bookmark. | table of contents, TOC, sidebar |
| image | A picture you pasted or dropped. One object in the text; in the page file the line `![](images/<name>)`. | attachment (in the UI), asset |
| image line | The line `![](images/<name>)` in the page file. | image tag, embed |
| code block | A pasted PHP, JSON or XML text. One object in the text, shown with syntax colours and edited in place; in the page file a fenced block. | snippet, code cell |
| table | A pasted CSV text. One object in the text, shown as a grid of cells; in the page file a fenced block. | spreadsheet, CSV block |
| fence, fenced block | The lines ```` ```php ```` (or `json`, `xml`, `csv`) and ```` ``` ```` around the text of a code block or table in the page file. Never shown in the page. | code tag |
| link | A web or mail address in the text. ⌘-click opens it. Stored as plain text. | hyperlink, URL (in the UI) |
| page file | `~/Library/Application Support/plak/page.md`, where the page is stored. | database, save file |
| image folder | `~/Library/Application Support/plak/images/`, where plak keeps the image files. | assets, attachments |
| paper | The mid-tone background colour of the page. | canvas |
| menu bar icon | The icon of plak in the macOS menu bar, with the menu Show Plak, Hide Plak, Quit Plak. Plak has no Dock icon. | status item (in the UI), tray icon |
| paper | The dark slate background colour of the page. | canvas |
| menu bar icon | The icon of plak in the macOS menu bar, with the menu Show Plak, Hide Plak, Plak Help, Quit Plak. Plak Help adds the help text at the end of the page. Plak has no Dock icon. | status item (in the UI), tray icon |
| lorem text | The filler text that typing `#lorem` at the start of a line puts in the page: one sentence of 16 words and two paragraphs of 3 to 5 sentences, picked from `lorem.txt`, then 4 telephone numbers, 4 addresses and 4 e-mail addresses made up from `contacts.json`. | placeholder text, dummy text, snippet |
| welcome text | The one sentence that the page holds at the first startup, when the page file does not exist. It points to Plak Help. | intro page, sample content |
| help text | The introduction to plak and its tricks, from `help.md` in the app. Plak Help adds it at the end of the page. | manual, docs (in the UI), tutorial, onboarding |