Web pages: a page without headings is arranged by itself, and a typed address becomes a titled link
A page cut into parts by length is now arranged into titled sections by a model when it is first read, through the same gates as s (a model, the daily budget, the plan's limits, one request per text), once per text per server run. EX_PAGES_ARRANGE=manual keeps it to s. The pane shows the parts at once, says that it is arranging or why it did not, and swaps the sections in when they arrive. A bare http(s) address typed into a node's text is linked when the edit ends, then replaced by the page's title once that is read; u brings the address back. A node whose whole text is one address becomes a section that is only a link. See docs/pages.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
f8c6576ea1
commit
57b605e13c
19 files changed
+1095
-92
No files matched your search
@@ -6,6 +6,10 @@
|
||||
*
|
||||
* tracing a blog post whose sections are all h3, with <meta name=author> and a <time>
|
||||
* essay a long headingless essay in a layout table, paragraphs made of <br><br>, no metadata
|
||||
* drift a headingless page of plain paragraphs whose title says "mockfail": the mock model
|
||||
* fails to arrange it (an automatic attempt that comes to nothing, then s)
|
||||
* slow a headingless page whose title says "mockslow": the mock model takes 1.5 s over it
|
||||
* (the "arranging…" line, and a pane on a part by length when the sections arrive)
|
||||
* letters sections opened by <p>I.</p>, <p>II.</p>…, author and date in JSON-LD
|
||||
* rules <p><strong>1. …</strong></p> sections, a sidebar full of h2s, a byline class
|
||||
* phare French, h2 and h3 sections, with junk ones (Sommaire, Voir aussi, Notes et références)
|
||||
@@ -36,6 +40,8 @@
|
||||
export const MOCK_PAGES = {
|
||||
tracing: "https://tracing.example.org/posts/following-a-request",
|
||||
essay: "https://essays.example.com/hundred.html",
|
||||
drift: "https://notes.example.net/field/unsorted",
|
||||
slow: "https://tides.example.net/slow-water",
|
||||
letters: "https://letters.example.net/p/on-maps",
|
||||
rules: "https://software.example.com/2003/10/twelve-rules/",
|
||||
phare: "https://encyclopedie.example.org/fr/Phare_de_la_Pointe",
|
||||
@@ -130,6 +136,12 @@ const tracing = page(
|
||||
</article></main>${FOOTER}`,
|
||||
);
|
||||
|
||||
/** A page of plain paragraphs and nothing else: no headings, no metadata but its title. */
|
||||
const headingless = (title: string, from: number) =>
|
||||
page(`<title>${title}</title>`, `<article>${Array.from({ length: 12 }, (_, i) => `<p>${prose(125, from + i * 2)}</p>`).join("")}</article>`);
|
||||
const drift = headingless("Field notes, unsorted (mockfail)", 3);
|
||||
const slow = headingless("Slow water (mockslow)", 7);
|
||||
|
||||
const essayParas = Array.from({ length: 14 }, (_, i) => prose(120 + (i % 3) * 15, i * 2));
|
||||
const essay = `<html><head><title>A Hundred Small Maps</title></head><body bgcolor="#ffffff">
|
||||
<table border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td><img src="/nav.gif" width="69" height="357" alt=""></td><td width="26"></td>
|
||||
@@ -290,6 +302,8 @@ const redirect = (to: string, status = 302) => new Response(null, { status, head
|
||||
const PAGES: Record<string, () => Response> = {
|
||||
[MOCK_PAGES.tracing]: () => html(tracing),
|
||||
[MOCK_PAGES.essay]: () => html(essay, 200, { "content-type": "text/html" }),
|
||||
[MOCK_PAGES.drift]: () => html(drift),
|
||||
[MOCK_PAGES.slow]: () => html(slow),
|
||||
[MOCK_PAGES.letters]: () => html(letters),
|
||||
[MOCK_PAGES.rules]: () => html(rules, 200, { "last-modified": "Tue, 01 Nov 2022 10:00:00 GMT" }),
|
||||
[MOCK_PAGES.phare]: () => html(phare),
|
||||
|
||||
Reference in new issue
Block a user