whitepaper HTML: cage the uncloseai button + ChunkFive for titles + logo under title

Three whitepaper-HTML-only fixes:

* docutils's responsive.css blanket-pads every `body > *` with
  `padding: 0.5rem calc(29% - 7.2rem)`. The uncloseai floating
  button gets appended to <body>, picks up that padding, and blows
  from its designed 121 px to nearly half the viewport. Scoped
  override resets the cascade on the button selector with
  `all: revert` + explicit zero padding/margin.

* whitepaper h1/h2 titles now use ChunkFive (same face as the
  homepage logo) instead of docutils's default serif. Font embedded
  as a base64 data: URI inside a <style> block so the HTML stays
  self-contained — no external font fetch.

* RST layout: λ logo now sits UNDER the "Lumbda" heading instead
  of above it. Permacomputer logo still follows below the λ.

New helper: whitepaper/inject-whitepaper-css.py runs after
embed-images.py, reads ChunkFive from www/fonts/..., base64-encodes,
writes the <style> block before </head>. Makefile wires it in.
This commit is contained in:
russell@unturf.com 2026-04-19 17:54:53 -04:00
parent 5566865815
commit cd5d4d2efa
5 changed files with 2255 additions and 2076 deletions

View file

@ -0,0 +1,75 @@
#!/usr/bin/env python3
# Inject whitepaper-specific CSS overrides into the rst2html5 output:
#
# 1. Embed the ChunkFive webfont (base64 woff2) and assign it to h1 /
# h2, so whitepaper titles read in the same voice as the homepage
# logo instead of docutils's default serif fallback.
#
# 2. Cancel docutils's responsive.css `body > *` rule for the
# uncloseai floating button — that rule slaps `padding: 0.5rem
# calc(29% - 7.2rem)` onto every direct child of <body>, which
# blows the 121px button up to ~40% of the viewport width. Scoped
# override plus `all: revert` so the button falls back to its own
# stylesheet's intended sizing.
#
# Usage: inject-whitepaper-css.py <html-file> <chunkfive-woff2-path>
import base64
import os
import sys
TEMPLATE = """\
<style>
@font-face {{
font-family: 'chunkfive';
src: url(data:font/woff2;base64,{woff2_b64}) format('woff2');
font-weight: normal;
font-style: normal;
font-display: swap;
}}
main > h1, main > h2, section > h2 {{
font-family: 'chunkfive', Georgia, serif;
font-weight: normal;
letter-spacing: 0.01em;
}}
/* docutils's responsive.css blanket-pads every `body > *`, which
explodes the uncloseai floating button to nearly half the viewport.
Revert the cascade inside that button so its own stylesheet wins. */
body > button#floating-ai-button,
body > .uncloseai-floating-button {{
all: revert;
padding: 0 !important;
margin: 0 !important;
max-width: none !important;
background-color: transparent !important;
}}
</style>
"""
def main(argv):
if len(argv) != 3:
sys.stderr.write("usage: inject-whitepaper-css.py <html-file> <chunkfive-woff2-path>\n")
return 2
html_path, woff2_path = argv[1], argv[2]
if not os.path.isfile(woff2_path):
sys.stderr.write(f"inject-whitepaper-css: chunkfive missing: {woff2_path}\n")
return 1
with open(woff2_path, "rb") as f:
woff2_b64 = base64.b64encode(f.read()).decode()
style_block = TEMPLATE.format(woff2_b64=woff2_b64)
with open(html_path, "r") as f:
html = f.read()
if "</head>" not in html:
sys.stderr.write("inject-whitepaper-css: no </head> found\n")
return 1
html = html.replace("</head>", style_block + "</head>", 1)
with open(html_path, "w") as f:
f.write(html)
print(f"inject-whitepaper-css: injected {len(style_block)} bytes into {html_path}")
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -20,6 +20,9 @@
.. under AGPL-3.0-only.
.. Code is seeds to sprout on any abandoned technology.
Lumbda
======
.. figure:: diagrams/lumbda-logo-green.png
:width: 24%
:align: center
@ -28,9 +31,6 @@
:width: 42%
:align: center
Lumbda
======
.. class:: center
**A Lisp/Scheme-derived, just-in-time lambda language. Four implementation tiers with MOAD defect isolation. Workloads migrate across basic UNIX systems.**