Skip to content

feat(library): LaTeX in descriptions, and essays for machines and collections - #120

Merged
thethinkmachine merged 3 commits into
mainfrom
feat/library-latex-support
Sep 30, 2026
Merged

thethinkmachine merged 3 commits into
mainfrom
feat/library-latex-support

Conversation

@thethinkmachine

Copy link
Copy Markdown
Owner

What

Brings two pieces of library work to main:

  1. cfd40b8 LaTeX 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 marked tex are typeset, so a $ in a machine code or a tape symbol stays a character. The delimiters live once in js/tex.js, shared with triggerMath.

  2. 6795008 Essays for machines and collections (reviewed as thethinkmachine/AutomataStudio#119, merged into this branch). A Markdown file beside a machine or collection (bb5.md beside bb5.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 / machines figures are drawn from the machine: at build time on the website, in a worker in the app.
    • The index lists essay: { path, hash, minutes }; the app fetches it through the same hash-checked, cached path as a machine's file.
    • The build reports unknown facts, undrawable figures and dead lib: links as warnings on the entry.
    • guard.mjs credits 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 test on this branch: 2599 pass, 1 skipped (the library test that needs a locally built library).
  • New tests/essay.test.js (16 tests); tests/library.test.js covers 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 build succeeds and emits essay-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, and library-rebuild.yml will start its Publish workflow when this lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L8hKpV2hiVoJMZ9f6X4Zwu


Generated by Claude Code

thethinkmachine and others added 3 commits September 30, 2026 14:48
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
Copilot AI balanced review requested due to automatic review settings September 30, 2026 14:47
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thethinkmachine
thethinkmachine merged commit de47e2f into main Sep 30, 2026
17 checks passed
@thethinkmachine
thethinkmachine deleted the feat/library-latex-support branch September 30, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants