Link the site to the repo on Gitea
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:
@@ -13,6 +13,7 @@ import { RouterLink, RouterView } from "vue-router";
|
|||||||
<RouterLink to="/" exact-active-class="on">Problems</RouterLink>
|
<RouterLink to="/" exact-active-class="on">Problems</RouterLink>
|
||||||
<RouterLink to="/stats" active-class="on">Stats</RouterLink>
|
<RouterLink to="/stats" active-class="on">Stats</RouterLink>
|
||||||
<RouterLink to="/cli" active-class="on">CLI</RouterLink>
|
<RouterLink to="/cli" active-class="on">CLI</RouterLink>
|
||||||
|
<a href="/gitea/adamf/usaco">Source</a>
|
||||||
<a href="/">adam-french.co.uk</a>
|
<a href="/">adam-french.co.uk</a>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
* itself can't be imported. Keep the two in step when the CLI changes.
|
* 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
|
// Every command that takes a problem name accepts a unique prefix, so the
|
||||||
// examples use the full name only where it reads better.
|
// examples use the full name only where it reads better.
|
||||||
const sections = [
|
const sections = [
|
||||||
@@ -79,8 +84,9 @@ usaco [watermelon:solved]> q`;
|
|||||||
<section>
|
<section>
|
||||||
<h1>The usaco CLI</h1>
|
<h1>The usaco CLI</h1>
|
||||||
<p class="muted">
|
<p class="muted">
|
||||||
Every problem here is written in a workspace managed by <code>./usaco</code>, a small bash script at
|
Every problem here is written in a workspace managed by <a :href="src('usaco')"><code>./usaco</code></a>, a small bash script at
|
||||||
the repo root. Each problem lives in <code>solving/</code>, <code>solved/</code> or
|
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>
|
<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:
|
files. Wherever a command takes a problem name, a unique prefix works too:
|
||||||
<code>usaco e diam</code> finds <code>diamond-collector</code>.
|
<code>usaco e diam</code> finds <code>diamond-collector</code>.
|
||||||
@@ -90,11 +96,14 @@ usaco [watermelon:solved]> q`;
|
|||||||
<section>
|
<section>
|
||||||
<h2>Setup</h2>
|
<h2>Setup</h2>
|
||||||
<div class="card body">
|
<div class="card body">
|
||||||
<p>Run it as <code>./usaco</code> from the repo root, or add this to <code>~/.zshrc</code>:</p>
|
<p>Clone the repo and run <code>./usaco</code> from its root:</p>
|
||||||
<pre><code>source ~/Coding/USACO/usaco.zsh</code></pre>
|
<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>
|
<p>
|
||||||
That makes <code>usaco</code> a global command, adds tab completion for commands and problem names, and
|
That makes <code>usaco</code> a global command, adds tab completion for commands and problem names, and
|
||||||
adds <code>ucd <name></code> to cd into a problem's directory.
|
adds <code>ucd <name></code> to cd into a problem's directory. The full reference is the
|
||||||
|
<a :href="src('README.md')">README</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -134,8 +143,8 @@ usaco [watermelon:solved]> q`;
|
|||||||
<h2>Debug output</h2>
|
<h2>Debug output</h2>
|
||||||
<div class="card body">
|
<div class="card body">
|
||||||
<p>
|
<p>
|
||||||
<code>usaco</code> builds define <code>LOCAL</code>, which the template uses to include
|
<code>usaco</code> builds define <code>LOCAL</code>, which the <a :href="src('template.cpp')">template</a> uses to include
|
||||||
<code>debugging.h</code> (pretty-printers for vectors, maps and pairs) and enable its
|
<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.
|
<code>DBG(x)</code> macros. The judge doesn't define it, so <code>main.cpp</code> is submittable as-is.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user