Step B1
The written form
The whole site can be spoken, the way the feed speaks — but to two audiences at once.
Export is a projection: it stores nothing, changes nothing, reads
everything and speaks it once. The step's real work is the shape of what is
spoken, because two audiences will read it. A person, unzipping, finds every
page body as an ordinary file named by its own path —
pages/notes/first-post.html, a raw stylesheet as
pages/demo/style.css — and every image under
media/. Another instance of the program finds one
manifest.json carrying the full record of every entity, all the
step-eight metadata, pointing at the body files by name.
Legibility and losslessness pull apart unless the shape serves both: bodies as files (for the person), records in the manifest (for the machine), and each pointing at the other.
def body_filename(page):
name = page.path or "_home"
ext = EXT.get(page.content_type, ".html")
if name.endswith(ext): # raw companions carry their own
ext = ""
return "pages/" + name + ext
record["body_file"] = body_filename(p)
z.writestr(record["body_file"], p.body)
Every page becomes a file named by its own path.