Commit Graph
3 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 ccf4e4dd74 Explain concepts on the site, and reuse their code from the CLI
Test and publish the site / test (push) Successful in 1m19s
Test and publish the site / publish (push) Successful in 1m31s
/usaco/concepts is a library of techniques Claude explained: the admin
asks by topic ("help explain fenwick trees") or pastes code they could
not follow, and gets an intuitive explanation with SVG diagrams plus a
C++ snippet in contest style. Given code, the walkthrough traces that
code and the snippet is a general version of it. Anyone can read the
library; generating, rewriting and deleting are admin-only.

Each concept is committed as concepts/<slug>/: concept.md (tags in a
header comment, then a # title), snippet.cpp (first line
"// concept: <slug>") and request.md (the question, for rewrites). The
slug is Claude's to pick, so a new concept's job is keyed by an id and
returns {slug} as its result; a taken slug gets -2, -3... rather than
overwriting. Rewriting starts from the saved question and version plus
a note on what to change. The index reads concepts into Index.Concepts,
with their date from git.

internal/concept shares explain's math and diagram rules, now split out
as explain.MathRules and explain.DiagramRules; the explain prompt is
byte-for-byte unchanged. Code fences in explanations are highlighted
with the same highlight.js setup as CodeBlock (web/src/highlight.js).

`usaco snippet` lists concepts, prints one's snippet, or pastes it into
a solution above main (or class Solution), keeping a .bak and refusing
a concept the file already has. In interactive mode it pastes into the
selection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 12:58:38 +01:00
adamfandClaude Opus 5.5 4dc8d1674c Tidy the site's problem pages and typeset math in explanations
Test and publish the site / test (push) Successful in 1m10s
Test and publish the site / publish (push) Successful in 1m29s
The problem page's Explain and recording-review forms took most of the
first screen, above the solution. They now fold into the admin bar with
the editor, one open at a time; a running job is reported in the bar,
so a form can be closed while it works.

The problem list is grouped by month when sorted by recency, as one
card per month with divided rows, laid out on a fixed grid so rows
line up on a phone. Empty status tabs are hidden.

Rust solutions are now highlighted, the file picker is styled like the
other buttons, header links no longer break mid-word on a phone, and
keyboard focus is visible.

Markdown everywhere now goes through one renderer that typesets
$...$, $$...$$ and ```math with KaTeX. The explanation prompt asked for
$...$ only when the statement used it, so formulas came out as inline
code; it now asks for LaTeX for math and code spans for code, and the
review prompt does the same for complexities.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 02:19:24 +01:00
adamfandClaude Opus 5.5 6d956f1c76 Add the website: Go server + Vue SPA in site/, with CI
A standalone container for web_server, shaped like job-tracker: serves
/usaco/ with solved problems public and solving/skipped plus edits
(status, link, notes) for the site admin. Git is the only store: the
server clones adamf/usaco from Gitea, pulls on the push webhook, and
commits edits back. CI builds the image only when site/ changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00