feat(library): LaTeX in descriptions, and essays for machines and collections - #120
Merged
Merged
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
…e-ak678d feat(library): essays for machines and collections
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Brings two pieces of library work to
main:cfd40b8LaTeX in an author's words. A machine's description, its write-up and a collection's blurb take$…$,$$…$$,\(…\)and\[…\]. They're typeset by KaTeX in the Library view, in the submit form's preview (shown only while the text holds LaTeX) and on the website, where only elements markedtexare typeset, so a$in a machine code or a tape symbol stays a character. The delimiters live once injs/tex.js, shared withtriggerMath.6795008Essays for machines and collections (reviewed as thethinkmachine/AutomataStudio#119, merged into this branch). A Markdown file beside a machine or collection (bb5.mdbesidebb5.automaton) is shown after the showcase, on the website and in the Library view: a contents list, numbered figures and footnotes.{{steps}},{{ones}},{{size}},{{steps <id>}}and so on are read off the index, the analysis that earns the badges, never typed by the author.::: spacetime/growth/diagram/machinesfigures are drawn from the machine: at build time on the website, in a worker in the app.essay: { path, hash, minutes }; the app fetches it through the same hash-checked, cached path as a machine's file.lib:links as warnings on the entry.guard.mjscredits an essay as its machine, so only the machine's author or a maintainer can write it.Details are in feat(library): LaTeX in descriptions, and essays for machines and collections #119's description.
Testing
npm teston this branch: 2599 pass, 1 skipped (the library test that needs a locally built library).tests/essay.test.js(16 tests);tests/library.test.jscovers the LaTeX work and 10 essay cases: the build, the guard, the website page and the Library view. Mutation-checked: removing the escaping, the fact-name guard, the id prefix or the hash check each fails a test.vite buildsucceeds and emitsessay-figures.worker-*.js.After merging
thethinkmachine/automata-library#4 adds the first two essays (BB(5) and the Busy Beaver collection). Merge it after this. The library is built and guarded by this repo's
main, andlibrary-rebuild.ymlwill start its Publish workflow when this lands.🤖 Generated with Claude Code
https://claude.ai/code/session_01L8hKpV2hiVoJMZ9f6X4Zwu
Generated by Claude Code