Skip to content

Commit 1fbf021

Browse files
snow-jallenclaude
andcommitted
API page: the Google Colab notebook gets its own callout with the Colab logo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8fdNFMnkyDNTFoKqQyD6L
1 parent cabc227 commit 1fbf021

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎src/NetRts.Server/wwwroot/apidocs.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ export function mountApiDocs(root) {
110110
<p class="small muted">Server: <code>${location.origin}</code> · Rules and strategy:
111111
<a href="https://github.com/SnowSE/NetRTS/blob/main/docs/bot-guide.md" target="_blank" rel="noopener">the bot guide</a> ·
112112
Every schema and field: <a href="/scalar">the full reference</a> ·
113-
<a href="#requests">Request files for your editor</a> ·
114-
Rather work in a notebook? <a href="#/colab">Play with Google Colab</a></p>
113+
<a href="#requests">Request files for your editor</a></p>
114+
<a class="colab-callout" href="#/colab">
115+
<img src="images/colab-logo.svg" alt="" width="40" height="25">
116+
<span>Rather work in a notebook? <b>Play with Google Colab</b> <span aria-hidden="true">→</span></span>
117+
</a>
115118
</header>
116119
117120
<section class="apidocs-bar" aria-label="Your key and language">
Lines changed: 6 additions & 0 deletions
Loading

‎src/NetRts.Server/wwwroot/styles.css‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,12 @@ a.owner:hover { text-decoration: underline; }
16461646
.apidocs-head .headline { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: none; margin: 0; }
16471647
.apidocs-head .lede { margin: 10px 0 0; max-width: 70ch; }
16481648
.apidocs-head p.small { margin: 12px 0 0; }
1649+
/* The way into the Colab notebook: noticeable beside the links above it, not a banner. */
1650+
.colab-callout { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 7px 16px 7px 12px;
1651+
border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); text-decoration: none; font-size: 0.95rem; }
1652+
.colab-callout:hover { border-color: #F9AB00; }
1653+
.colab-callout:hover b { text-decoration: underline; }
1654+
.colab-callout img { display: block; flex: none; }
16491655
.apidocs input:not([type="radio"]), .apidocs textarea {
16501656
font: inherit;
16511657
color: inherit;

0 commit comments

Comments
 (0)