Link the site to the repo on Gitea
Test and publish the site / test (push) Successful in 39s
Test and publish the site / publish (push) Successful in 50s

A Source link in the header, and on the CLI page links to the script,
lib/cmd, usaco.zsh, the README, the template and debugging.h, plus the
clone URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 23:45:50 +01:00
co-authored by Claude Opus 5.5
parent cbf5cc32b7
commit 675410729e
2 changed files with 17 additions and 7 deletions
+16 -7
View File
@@ -5,6 +5,11 @@
* itself can't be imported. Keep the two in step when the CLI changes.
*/
// The repo on the site's Gitea, behind the same nginx, so a root-relative
// link works.
const repo = "/gitea/adamf/usaco";
const src = (path) => `${repo}/src/branch/main/${path}`;
// Every command that takes a problem name accepts a unique prefix, so the
// examples use the full name only where it reads better.
const sections = [
@@ -79,8 +84,9 @@ usaco [watermelon:solved]> q`;
<section>
<h1>The usaco CLI</h1>
<p class="muted">
Every problem here is written in a workspace managed by <code>./usaco</code>, a small bash script at
the repo root. Each problem lives in <code>solving/</code>, <code>solved/</code> or
Every problem here is written in a workspace managed by <a :href="src('usaco')"><code>./usaco</code></a>, a small bash script at
the root of <a :href="repo">the repo on Gitea</a> (the commands themselves are in
<a :href="src('lib/cmd')"><code>lib/cmd/</code></a>). Each problem lives in <code>solving/</code>, <code>solved/</code> or
<code>skipped/</code> as a directory with <code>main.cpp</code> and its <code>.in</code>/<code>.out</code>
files. Wherever a command takes a problem name, a unique prefix works too:
<code>usaco e diam</code> finds <code>diamond-collector</code>.
@@ -90,11 +96,14 @@ usaco [watermelon:solved]> q`;
<section>
<h2>Setup</h2>
<div class="card body">
<p>Run it as <code>./usaco</code> from the repo root, or add this to <code>~/.zshrc</code>:</p>
<pre><code>source ~/Coding/USACO/usaco.zsh</code></pre>
<p>Clone the repo and run <code>./usaco</code> from its root:</p>
<pre><code>git clone https://www.adam-french.co.uk{{ repo }}.git</code></pre>
<p>Or add this to <code>~/.zshrc</code>:</p>
<pre><code>source ~/Coding/USACO/<a :href="src('usaco.zsh')">usaco.zsh</a></code></pre>
<p>
That makes <code>usaco</code> a global command, adds tab completion for commands and problem names, and
adds <code>ucd &lt;name&gt;</code> to cd into a problem's directory.
adds <code>ucd &lt;name&gt;</code> to cd into a problem's directory. The full reference is the
<a :href="src('README.md')">README</a>.
</p>
</div>
</section>
@@ -134,8 +143,8 @@ usaco [watermelon:solved]> q`;
<h2>Debug output</h2>
<div class="card body">
<p>
<code>usaco</code> builds define <code>LOCAL</code>, which the template uses to include
<code>debugging.h</code> (pretty-printers for vectors, maps and pairs) and enable its
<code>usaco</code> builds define <code>LOCAL</code>, which the <a :href="src('template.cpp')">template</a> uses to include
<a :href="src('debugging.h')"><code>debugging.h</code></a> (pretty-printers for vectors, maps and pairs) and enable its
<code>DBG(x)</code> macros. The judge doesn't define it, so <code>main.cpp</code> is submittable as-is.
</p>
</div>