Help: one click opens the manual, two quick clicks the note; the manual styled
One click on Help shows the explanations of every command in one window, the names in a sans-serif and the explanations in a serif, with a 2em margin; Copy copies them as plain text. Two quick clicks show the note about the documentation site. The closed window is not displayed (a layout rule had shown it empty on the start screen). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
24a6a2595b
commit
5d63a0f758
5 files changed
+156
-38
No files matched your search
+30
-3
@@ -4,9 +4,12 @@
|
||||
* (`data-help`), gathered from the page and written as plain text under
|
||||
* the title "User interface actions": the controls in alphabetical
|
||||
* order, each one's name on a line, its explanation on the next lines,
|
||||
* wrapped at WIDTH columns, and a blank line after (Andy, 2026-10-14:
|
||||
* Ctrl-click on Help shows it; a first form as Klammertext was replaced
|
||||
* by this the same day).
|
||||
* wrapped at WIDTH columns, and a blank line after (Andy, 2026-10-14; a
|
||||
* first form as Klammertext was replaced by this the same day); and the
|
||||
* same entries as elements for the Help window (`manualList`), which
|
||||
* the stylesheet sets, the names in a sans-serif and the explanations in
|
||||
* a serif (Andy, 2026-10-15: one click on Help shows it, Ctrl-click
|
||||
* until then). The Copy button copies the text.
|
||||
*/
|
||||
|
||||
export const TITLE = 'User interface actions';
|
||||
@@ -137,3 +140,27 @@ export function manualText(doc) {
|
||||
const blocks = manualEntries(doc).map(([name, help]) => `${name}\n${wrap(help, WIDTH)}\n`);
|
||||
return `${TITLE}\n\n${blocks.join('\n')}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* The manual as elements: the title as a heading, then a description
|
||||
* list, each control's name a term and its explanation the description.
|
||||
* @param {Document | Element} doc
|
||||
* @returns {DocumentFragment}
|
||||
*/
|
||||
export function manualList(doc) {
|
||||
const owner = doc instanceof Document ? doc : doc.ownerDocument;
|
||||
const fragment = owner.createDocumentFragment();
|
||||
const title = owner.createElement('h3');
|
||||
title.textContent = TITLE;
|
||||
fragment.append(title);
|
||||
const list = owner.createElement('dl');
|
||||
for (const [name, help] of manualEntries(doc)) {
|
||||
const term = owner.createElement('dt');
|
||||
term.textContent = name;
|
||||
const description = owner.createElement('dd');
|
||||
description.textContent = help;
|
||||
list.append(term, description);
|
||||
}
|
||||
fragment.append(list);
|
||||
return fragment;
|
||||
}
|
||||
Reference in new issue
Block a user