From cbf5cc32b715485ef3d8ab18d44c507bc13a17b1 Mon Sep 17 00:00:00 2001 From: Adam French Date: Wed, 14 Oct 2026 23:27:39 +0100 Subject: [PATCH] Add a CLI guide page to the website /usaco/cli summarises the ./usaco commands, setup, a typical session and interactive mode, linked from the header. It's a hand-written copy of the README (the Docker build context is site/, so it can't import it). Co-Authored-By: Claude Opus 5.5 --- README.md | 2 + site/README.md | 4 +- site/web/src/App.vue | 1 + site/web/src/router.js | 1 + site/web/src/views/CliPage.vue | 206 +++++++++++++++++++++++++++++++++ 5 files changed, 212 insertions(+), 2 deletions(-) create mode 100644 site/web/src/views/CliPage.vue diff --git a/README.md b/README.md index 1a047fd..a5c865d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ solved// finished problems skipped// problems set aside for later ``` +The website's CLI page (`site/web/src/views/CliPage.vue`) is a condensed copy of the Commands section below; keep it in step. + Each problem dir contains `main.cpp` plus `.in` / `.out` files (USACO file IO is wired up automatically via `STDIO("")`). Optional extras: `.url` (the problem link), `tests/N.in` + `N.out`, and `notes.md` (shown on the website, usually written from there). ## Commands diff --git a/site/README.md b/site/README.md index 6994251..97dd6f0 100644 --- a/site/README.md +++ b/site/README.md @@ -1,6 +1,6 @@ # USACO site -The public face of this repo, served at `/usaco/` on adam-french.co.uk. It shows the solved problems: each solution, its sample input, saved tests and notes, and its git history, plus a stats page with a solve calendar. When the site's admin is logged in, it also shows problems in `solving/` and `skipped/`, and lets them: +The public face of this repo, served at `/usaco/` on adam-french.co.uk. It shows the solved problems: each solution, its sample input, saved tests and notes, and its git history, plus a stats page with a solve calendar and a guide to the `./usaco` CLI. When the site's admin is logged in, it also shows problems in `solving/` and `skipped/`, and lets them: - mark a problem solved, skipped or back in progress - set its link @@ -49,7 +49,7 @@ Everything is served under `BASE_PATH` (`/usaco`). nginx proxies the prefix thro | Path | Auth | What | |---|---|---| -| `/usaco/`, `/usaco/p/`, `/usaco/stats` | none | SPA | +| `/usaco/`, `/usaco/p/`, `/usaco/stats`, `/usaco/cli` | none | SPA | | `GET /usaco/api/problems` | open; the admin also gets unsolved problems | the list | | `GET /usaco/api/problems/` | open for solved problems; 404 for others unless admin | one problem, with files, tests and history | | `GET /usaco/api/me` | open | `{admin}`, so the SPA knows whether to show the edit controls | diff --git a/site/web/src/App.vue b/site/web/src/App.vue index a4f04db..e0f8203 100644 --- a/site/web/src/App.vue +++ b/site/web/src/App.vue @@ -12,6 +12,7 @@ import { RouterLink, RouterView } from "vue-router"; diff --git a/site/web/src/router.js b/site/web/src/router.js index 2e9f6cf..9994a6d 100644 --- a/site/web/src/router.js +++ b/site/web/src/router.js @@ -13,6 +13,7 @@ export default createRouter({ { path: "/", name: "list", component: () => import("@/views/ProblemList.vue") }, { path: "/p/:name", name: "problem", component: () => import("@/views/ProblemPage.vue"), props: true }, { path: "/stats", name: "stats", component: () => import("@/views/StatsPage.vue") }, + { path: "/cli", name: "cli", component: () => import("@/views/CliPage.vue") }, { path: "/:pathMatch(.*)*", redirect: "/" }, ], scrollBehavior: (to, from, saved) => saved || { top: 0 }, diff --git a/site/web/src/views/CliPage.vue b/site/web/src/views/CliPage.vue new file mode 100644 index 0000000..edf138e --- /dev/null +++ b/site/web/src/views/CliPage.vue @@ -0,0 +1,206 @@ + + + + +