feat(library): LaTeX in descriptions, and essays for machines and collections - #119
Merged
thethinkmachine merged 1 commit intoSep 30, 2026
Conversation
A machine or a collection can now carry an essay: a Markdown file beside
it (bb5.md beside bb5.automaton, busy-beavers.md beside its collection).
The website and the app's Library view both show it after the showcase,
with a contents list, numbered figures and footnotes.
- js/library/article.js: a small Markdown dialect shared by both faces.
Code and math are set aside first and everything is escaped before any
tag is written; links are limited to http(s), # and lib:<id>.
- {{steps}}, {{ones}}, {{size}}, {{steps <id>}} and friends are read off
the index (js/library/essay.js), so the numbers in the prose are the
ones the badges were earned by.
- ::: spacetime / growth / diagram / machines draw figures from the
machine (js/library/article-figures.js), with arguments bounded. The
website draws them at build time; the view draws them in a worker.
- The index lists essay: { path, hash, minutes }; the build serves the
file beside its machine, and the view fetches it through the same
hash-checked, cached path as a machine's file.
- The build reports an essay's unknown facts, undrawable figures and
dead lib: links as warnings on the entry, so authors see them on the PR.
- guard.mjs credits a machine's essay as its machine: its author or a
maintainer may write it, nobody else may attach one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8hKpV2hiVoJMZ9f6X4Zwu
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
thethinkmachine
merged commit Sep 30, 2026
5da0d2b
into
feat/library-latex-support
11 of 12 checks passed
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits:
cfd40b8feat(library): Machine descriptions now support latex (fromfeat/library-latex-support, which never had a PR of its own). An author's description, write-up and a collection's blurb take$…$/$$…$$, typeset by KaTeX in the Library view, the submit form's preview and on the website (js/tex.js).6795008feat(library): essays for machines and collections, which builds on (1). A machine or a collection can now carry an essay: a Markdown file beside it (bb5.mdbesidebb5.automaton,busy-beavers.mdbeside its collection). Both the website and the app's Library view show it after the showcase, with a contents list in the margin, numbered figures and footnotes.How (essays)
js/library/article.js: a small Markdown dialect shared by both faces: headings, lists, quotes, tables, code,$…$/$$…$$,[^n]footnotes, links. Code spans and math are set aside first, and everything is escaped before any tag is written. Links are limited tohttp(s),#andlib:<id>.{{steps}},{{ones}},{{cells}},{{states}},{{size}},{{standard}}, and{{steps <other id>}}, are read off the index byjs/library/essay.js: the same analysis that earns the badges. They're set in mono with a dotted underline so readers can tell them from the author's words.::: spacetime,::: growth,::: diagram,::: machines <ids>(js/library/article-figures.js), with arguments clamped inessayFigureSpec. The website draws them at build time. The app draws them in a worker (essay-draw.js,essay-figures.worker.js) so BB(5)'s 47M steps don't block the UI, and caches the result.essay: { path, hash, minutes }(validated byessayRefin index-model.js).writeLibraryserves the.mdbeside its machine, only when the machine was published.fetchEssayTextuses the same hash-checked, cached path as a machine's file, so a tampered essay is refused and a read one works offline. Ids are prefixed (lib-essay-) because the essay shares the app's document. Footnote, contents andlib:clicks are handled in the view, so they never writelocation.hash, which carries share links.lib:links and missing footnotes are reported as warnings on the entry's report (the PR comment), not errors.guard.mjscredits it as its machine. The machine's author or a maintainer may write it, and nobody else may attach one. An essay with no machine beside it is refused. Previously every.mdread as "credits @(nobody)" and was rejected even from the author.S(n)intoS(N)..claude/skills/library/SKILL.md, and a bullet inlibrary-template/CONTRIBUTING.md.Testing
tests/essay.test.js(16): dialect, escaping (<script>,javascript:/data:links), code and math left untouched, fact lookup ({{constructor}}is not a fact), footnote order, id prefixing, figure numbering and bounds, the simulator against BB(2), andessayRefrejecting../,//, non-.mdand URL paths.tests/library.test.js(+10): the index and served files (an essay beside a failing machine is not served), the report's warnings, the guard, the website page, and the Library view (essay rendered after the showcase and before Behaviour, replaces Notes, a tampered essay is refused, the collection essay). The LaTeX commit's own tests are in the same file.npm teston this branch: 2599 pass, 1 skipped.vite buildemitsessay-figures.worker-*.js.Merge order
Merge this before thethinkmachine/automata-library#4: the library is built and guarded by this repo's
main.🤖 Generated with Claude Code
https://claude.ai/code/session_01L8hKpV2hiVoJMZ9f6X4Zwu