clio.html32 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 clio.css contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # clio.html32
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Converts a static site into HTML 3.2 and GIFs drawn with [clio.css](https://github.com/surfine/clio.css),
4
+ so Netscape 3/4 and Internet Explorer 3–5 on a real Classic Mac can read it. The output has no script
5
+ and no CSS. Window frames, title bars and menus are GIFs cut from clio.css; tables hold them together.
6
+
7
+ Each source page becomes two pages:
8
+
9
+ - `/<page>`: picture mode. Chinese, Japanese and Korean paragraphs are GIFs, so a Mac without those
10
+ fonts can still read them. Links inside them are image maps.
11
+ - `/t/<page>`: text mode. The original text inside the same window, for Macs that have the fonts.
12
+
13
+ Pages over about 100 KB or 30 images are split into parts.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install clio.html32
19
+ npx playwright install chromium
20
+ ```
21
+
22
+ It also needs `ffmpeg` and `ffprobe` on the PATH, and `iconv` for GB2312 and Big5 pages.
23
+
24
+ ## Build
25
+
26
+ ```bash
27
+ npx clio-html32 --src ./site --out ./dist-html32 --check-links
28
+ ```
29
+
30
+ `--era` picks the look: `system6`, `system7` (default), `platinum`, `drawingboard` or `nextstep`.
31
+ `system6` also dithers content images to black and white.
32
+
33
+ Run `npx clio-html32 --help` for every option.
34
+
35
+ ## Hosting
36
+
37
+ On a host that serves only files, such as SourceForge or GitHub Pages, build with `--static-only`.
38
+ Menus, window switching and the picture/text switch then use plain links:
39
+
40
+ ```bash
41
+ npx clio-html32 --src . --out ./retro --base /retro/ --static-only --check-links
42
+ ```
43
+
44
+ On Cloudflare Workers, deploy the output as static assets with `clio.html32/worker` as the worker.
45
+ It adds what a file host cannot:
46
+
47
+ - Picks the era from the browser (Netscape 2 and 68K: System 6; Netscape 3: System 7; IE 4–5 and
48
+ Netscape 4: Platinum; OmniWeb: NeXTSTEP). `?era=` switches it and a cookie keeps the choice.
49
+ - Opens menus with `?menu=`.
50
+ - Sends text mode to browsers that ask for Chinese.
51
+ - Wraps pages in a frameset for Netscape 3, which has no zero page margin.
52
+
53
+ The worker reads `art/eras.json`, which only a build without `--static-only` writes.
54
+
55
+ ```jsonc
56
+ // wrangler.jsonc
57
+ {
58
+ "name": "my-legacy-site",
59
+ "main": "node_modules/clio.html32/worker/pages-worker.js",
60
+ "compatibility_date": "2026-12-01",
61
+ "assets": { "directory": "dist-html32", "binding": "ASSETS", "html_handling": "none", "run_worker_first": true }
62
+ }
63
+ ```
64
+
65
+ ## Limits
66
+
67
+ - Pages are laid out at 680 pixels for an 800×600 screen.
68
+ - When the worker switches the era, content images keep the colours of the build era.
69
+ - `--preset classicmac` (picked automatically for that site) draws a hand-made home page and font
70
+ guide for classicmac.top. Other sites get the generic conversion.
71
+
72
+ ## Licence
73
+
74
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { argv, exit } from "node:process";
3
+ import { readFileSync } from "node:fs";
4
+
5
+ if (argv.includes("-v") || argv.includes("--version")) {
6
+ console.log(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version);
7
+ exit(0);
8
+ }
9
+ if (argv.includes("-h") || argv.includes("--help") || argv.length <= 2) {
10
+ console.log(`clio-html32: convert a static site into HTML 3.2 and GIFs drawn with clio.css
11
+
12
+ Usage:
13
+ clio-html32 --src <dir> [--out <dir>] [options]
14
+
15
+ Options:
16
+ --src <dir> Source site (required)
17
+ --out <dir> Output directory (default: ./dist-html32; emptied first)
18
+ --base <path> URL path the output is served from (default: /)
19
+ --origin <url> Original site, for links to files that are not converted (default: http://classicmac.top/)
20
+ --era <name> system6 | system7 | platinum | drawingboard | nextstep (default: system7)
21
+ --clio <file> clio.css stylesheet to draw with (default: the installed clio.css for --era)
22
+ --depth <mode> Content image colours: auto | 1bit | 16 | 64 (default: 1bit for system6, else auto)
23
+ --static-only Plain static links, no edge worker needed (SourceForge, GitHub Pages)
24
+ --preset <name> auto | classicmac | none (default: auto)
25
+ --only <pages> Comma-separated source pages to build
26
+ --check-links Check every internal link, image and #anchor after the build
27
+ -v, --version Print the version
28
+ -h, --help Show this help
29
+
30
+ Needs ffmpeg and ffprobe on PATH, iconv for GB2312/Big5 pages, and Chromium for Playwright
31
+ (npx playwright install chromium).
32
+ `);
33
+ exit(0);
34
+ }
35
+
36
+ await import("../src/build.mjs");
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "clio.html32",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Convert a static site into HTML 3.2 and GIFs drawn with clio.css, for Netscape 3/4 and Internet Explorer 3-5 on System 6, System 7, Mac OS 8/9 and NeXTSTEP: no script, no CSS.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "clio-html32": "bin/clio-html32.mjs"
9
+ },
10
+ "exports": {
11
+ "./worker": "./worker/pages-worker.js",
12
+ "./chrome": "./src/chrome.mjs",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "src",
18
+ "worker",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "dependencies": {
26
+ "clio.css": "^2.0.2",
27
+ "playwright": "^1.63.0"
28
+ },
29
+ "homepage": "https://github.com/surfine/clio.css/tree/main/packages/clio-html32#readme",
30
+ "bugs": {
31
+ "url": "https://github.com/surfine/clio.css/issues"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/surfine/clio.css.git",
36
+ "directory": "packages/clio-html32"
37
+ },
38
+ "keywords": [
39
+ "clio.css",
40
+ "html32",
41
+ "classic mac os",
42
+ "system 6",
43
+ "system 7",
44
+ "mac os 9",
45
+ "platinum",
46
+ "nextstep",
47
+ "netscape",
48
+ "retro",
49
+ "static site"
50
+ ],
51
+ "scripts": {
52
+ "prepublishOnly": "node ../../tooling/release-guard.ts --stamp"
53
+ }
54
+ }
@@ -0,0 +1,58 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="i-apple" viewBox="0 0 14 16">
3
+ <path fill="#000" d="M8 0h2v1H9v1H8v1H7V1h1zM3 4h3v1h2V4h3v1h1v2h-1v3h1v2h-1v2h-1v1H8v-1H6v1H4v-1H3v-2H2V6h1z"/>
4
+ </symbol>
5
+ <symbol id="i-mac" viewBox="0 0 32 32">
6
+ <path fill="#0a7f7f" d="M7 1h18v1h1v24h-1v1H7v-1H6V2h1z"/>
7
+ <path fill="#e8f6f6" d="M7 2h18v24H7z"/>
8
+ <path fill="#0a7f7f" d="M9 4h14v13H9z"/>
9
+ <path fill="#fff" d="M10 5h12v11H10z"/>
10
+ <path fill="#000" d="M13 8h1v2h-1zM18 8h1v2h-1zM15 9h1v3h-1zM13 13h1v1h-1zM18 13h1v1h-1zM14 14h4v1h-4z"/>
11
+ <path fill="#0a7f7f" d="M9 21h6v1H9zM19 21h4v2h-4zM8 27h16v4H8z"/>
12
+ <path fill="#e8f6f6" d="M9 28h14v2H9z"/>
13
+ </symbol>
14
+ <symbol id="i-folder" viewBox="0 0 32 32">
15
+ <path fill="#000" d="M2 6h10l2 2h16v20H2z"/>
16
+ <path fill="#8cb4ff" d="M3 7h8l2 2h16v18H3z"/>
17
+ <path fill="#000" d="M3 11h26v1H3z"/>
18
+ <path fill="#c6dcff" d="M3 8h8v3H3z"/>
19
+ </symbol>
20
+ <symbol id="i-book" viewBox="0 0 32 32">
21
+ <path fill="#000" d="M2 5h12l2 2 2-2h12v22H18l-2 2-2-2H2z"/>
22
+ <path fill="#fff" d="M3 6h11l1 1v19h-1H3zM17 7l1-1h11v20H18h-1z"/>
23
+ <path fill="#2a5bd7" d="M15 7h2v20h-2z"/>
24
+ <path fill="#2a5bd7" d="M5 9h7v1H5zM5 12h7v1H5zM5 15h7v1H5zM5 18h7v1H5zM20 9h7v1h-7zM20 12h7v1h-7zM20 15h7v1h-7zM20 18h7v1h-7z"/>
25
+ </symbol>
26
+ <symbol id="i-drive" viewBox="0 0 32 32">
27
+ <path fill="#000" d="M2 8h28v18H2z"/>
28
+ <path fill="#ff9c2a" d="M3 9h26v16H3z"/>
29
+ <path fill="#fff" d="M5 11h22v4H5z"/>
30
+ <path fill="#000" d="M6 12h14v2H6zM5 18h10v1H5zM5 21h10v1H5zM22 19h4v2h-4z"/>
31
+ <path fill="#c45a00" d="M3 24h26v1H3z"/>
32
+ </symbol>
33
+ <symbol id="i-floppy" viewBox="0 0 32 32">
34
+ <path fill="#000" d="M3 2h23l3 3v25H3z"/>
35
+ <path fill="#8a63d2" d="M4 3h21l3 3v23H4z"/>
36
+ <path fill="#fff" d="M8 3h14v9H8z"/>
37
+ <path fill="#000" d="M17 4h3v7h-3z"/>
38
+ <path fill="#fff" d="M7 16h18v13H7z"/>
39
+ <path fill="#000" d="M9 19h14v1H9zM9 22h14v1H9zM9 25h14v1H9z"/>
40
+ </symbol>
41
+ <symbol id="i-help" viewBox="0 0 32 32">
42
+ <path fill="#000" d="M5 2h22v1h1v1h1v16h-1v1h-1v1H14l-5 6v-6H5v-1H4v-1H3V4h1V3h1z"/>
43
+ <path fill="#e8202a" d="M5 3h22v1h1v16h-1v1H13l-3 4v-4H5v-1H4V4h1z"/>
44
+ <path fill="#fff" d="M6 5h20v14H6z"/>
45
+ <path fill="#000" d="M13 7h6v1h1v4h-1v1h-2v2h-2v-3h1v-1h2V9h-4v2h-2V8h1zM15 16h2v2h-2z"/>
46
+ </symbol>
47
+ <symbol id="i-globe" viewBox="0 0 32 32">
48
+ <path fill="#000" d="M11 2h10v1h3v1h2v2h1v2h1v3h1v10h-1v3h-1v2h-1v2h-2v1h-3v1H11v-1H8v-1H6v-2H5v-2H4v-3H3V11h1V8h1V6h1V4h2V3h3z"/>
49
+ <path fill="#2f8fe8" d="M11 3h10v1h3v1h2v2h1v2h1v3h1v8h-1v3h-1v2h-1v2h-2v1h-3v1H11v-1H8v-1H6v-2H5v-2H4v-3H4V12h0V9h1V7h1V5h2V4h3z"/>
50
+ <path fill="#2fae3a" d="M9 6h5v2h2v3h-2v2h-3v3H8v-2H6v-3h1V8h2zM18 5h4v2h2v3h-3V8h-3zM17 14h6v2h3v4h-2v3h-2v2h-3v-4h-2v-3h1zM6 19h3v3h2v3H9v-2H7v-2H6z"/>
51
+ <path fill="#fff" d="M12 4h3v1h-3zM7 9h1v2H7z"/>
52
+ </symbol>
53
+ <symbol id="i-doc" viewBox="0 0 32 32">
54
+ <path fill="#000" d="M6 2h14l7 7v21H6z"/>
55
+ <path fill="#fff" d="M7 3h12v7h7v19H7z"/>
56
+ <path fill="#000" d="M20 4l5 5h-5zM10 14h12v1H10zM10 17h12v1H10zM10 20h12v1H10zM10 23h12v1H10z"/>
57
+ </symbol>
58
+ </svg>
Binary file
Binary file