The ztk docs site
Flight Manual builds the docs site of ztk: the pages that tools/build-docs.py of ztk lists, the pages of the commands, the references, the pages of the widget reference, the live examples, the games, and the landing page. The files are in sites/ztk/:
| File | What it has |
|---|---|
site.fm |
The site file: the title, the URL, the repository, the assets, and the plugin. |
pages.fm |
The list of pages and the groups of the menu, from the lists PAGES and COMMANDS of build-docs.py. |
style/page.html, style/head.html |
The page template of the ztk site. The style sheets are the files of docs/site/ of ztk. |
style/fm.css |
Gives the menu and the notes of Flight Manual the look of the ztk site. |
ztk.tcl |
The plugin: the references, the pages of the widget reference, the live examples, the figures, the games, the replays, the widget grid, the tabs, the folded sections, the windows around the shots of the examples, the list "On this page" of a platform page, the landing page, and the redirects of old page paths. |
prepare.sh |
Writes the pages and the pictures of the widget reference with tools/refdoc.tcl and tools/ref-looks.tcl of ztk, and the size of each picture. The plugin reads these files, so Flight Manual needs no exec. |
Build it
sites/ztk/prepare.sh ZTK
build/flight-manual build -site sites/ztk/site.fm -root ZTK OUT
ZTK is a checkout of ztk with its program in zig-out/bin (zig build in ztk).
The compare
The result on 2026-12-02, with ztk at 132a4f3, on Linux x86_64. The old site comes from python3 tools/build-docs.py OLD, with no --live. tools/compare-sites.tcl OLD NEW -url https://beetlebug.org/ztk/ gives:
| Check | Result |
|---|---|
| Pages | 845 in each site, 845 in both (with the redirect pages) |
| Heading differences | 0 |
| Links to the same file in another form | 8 |
| Bare URLs of the text as links | 39 |
| Link differences not explained | 0 |
| Dead links | 3: the links of the landing page to play/, the web build. A build with no --live has no play/ folder, in both sites. |
The time of a build: 14.5 s for build-docs.py, with refdoc.tcl and ref-looks.tcl, and 1.6 s for Flight Manual after prepare.sh.
The compare of the pictures: 10 pages (overview, install, quick start, widgets, widgets/basic/, platforms/ios/, commands, reference/bind/, the games, and the FAQ), each in the light, the dark, and the phone view of tests/browser.mjs, in Chromium. compare -metric AE -fuzz 2% of ImageMagick counts the pixels that differ:
| Part | Pixels that differ |
|---|---|
| The main part of each page, light | 0, and 196 on the overview (the autolinks) |
| Each page on a phone, where the menu is closed | 0 to 219 |
| The menu at the left, light and dark | 2,800 to 11,400 on each page |
The menu differs in one place. In the old site, a section of a group, such as iOS of Platforms or Desktop of Commands, is a closed <details> under the name of the group, and it shows on each page. In Flight Manual, a section is a part of its group, and it shows only when the group is open. The links of the menu are the same.
What differs
- The menu: the sections of a group, as above. A step of a game tutorial has no class
step, so it has no indent. llms.txthas no part "For agents" with the links toapi.jsonandllms-full.txt.- The
<title>of a page of the widget reference has no words "Tk widget". - The checks of the repository of ztk, such as the table of capabilities of
SECURITY.mdand the links of eachREADME.md, stay in ztk.
Next: Flight Manual, the start of the docs.