Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ basement_dist
.vuepress/.cache
.vuepress/dist
.wrangler

# Generated by .vuepress/seed-bible/generate-reference.mjs and
# generate-guides.mjs
seed-bible/reference/
seed-bible/guide/
41 changes: 41 additions & 0 deletions docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
resolvers,
useSiteLocaleData,
} from 'vuepress/client';
import AgentBootstrap from './components/AgentBootstrap.vue';
import NewsletterDialog from './components/NewsletterDialog.vue';
import ScrollCue from './components/ScrollCue.vue';
import FlywheelLayout from './layouts/FlywheelLayout.vue';
Expand Down Expand Up @@ -53,6 +54,46 @@ export default defineClientConfig({
// js-newsletter-trigger. The scroll cue sits bottom right on every page.
rootComponents: [NewsletterDialog, ScrollCue],

// Components that markdown pages use by name.
enhance({ app, router }) {
app.component('AgentBootstrap', AgentBootstrap);

if (__VUEPRESS_SSR__) {
return;
}
// The links that seed-bible/referenceCodeLinks.mjs adds inside code
// blocks are plain <a> tags, which the router doesn't see, so they
// would reload the whole site. Send them through the router instead,
// like the sidebar's links. A click meant to open a new tab or window
// is left to the browser.
document.addEventListener('click', (event) => {
if (
event.defaultPrevented ||
event.button !== 0 ||
event.metaKey ||
event.ctrlKey ||
event.shiftKey ||
event.altKey
) {
return;
}
const link = (event.target as Element | null)?.closest?.(
'a.code-link'
);
if (!(link instanceof HTMLAnchorElement)) {
return;
}
const base = router.options.history.base;
if (!link.pathname.startsWith(`${base}/`)) {
return;
}
event.preventDefault();
void router.push(
link.pathname.slice(base.length) + link.search + link.hash
);
});
},

// Arabic and Urdu read right to left. The page's `lang` is set from the
// locale, but nothing sets `dir`, so do it here as the reader switches
// languages. It follows the locale of the address rather than the page,
Expand Down
169 changes: 169 additions & 0 deletions docs/.vuepress/components/AgentBootstrap.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<script setup lang="ts">
import { onBeforeUnmount, ref } from 'vue';

// A box of instructions for a coding agent, with a button that copies them.
// The instructions are the slot: a fenced `text` code block written in the
// page's markdown, so they're readable (and searchable) without JavaScript.

const root = ref<HTMLElement | null>(null);
const status = ref<'idle' | 'copied' | 'failed'>('idle');
let reset: ReturnType<typeof setTimeout> | undefined;

/**
* The code block's text. Shiki puts each line in its own element with the
* line breaks between them, so textContent keeps the lines intact (the line
* numbers are outside the <code> element).
*/
const instructions = () =>
root.value?.querySelector('pre code')?.textContent?.trimEnd() ?? '';

async function copy() {
clearTimeout(reset);
try {
await navigator.clipboard.writeText(instructions());
status.value = 'copied';
} catch {
status.value = 'failed';
}
reset = setTimeout(() => (status.value = 'idle'), 2500);
}

onBeforeUnmount(() => clearTimeout(reset));
</script>

<template>
<section
ref="root"
class="agent-bootstrap"
aria-labelledby="agent-bootstrap-title"
>
<div class="agent-bootstrap-header">
<div>
<p id="agent-bootstrap-title" class="agent-bootstrap-title">
Agent bootstrap
</p>
<p class="agent-bootstrap-lead">
Building with a coding agent such as Claude Code or Codex?
Copy these instructions and paste them into it. It will ask
what you want to build, then create the project, read the
API and write, check and test the extension.
</p>
</div>
<button type="button" class="agent-bootstrap-copy" @click="copy">
{{
status === 'copied'
? 'Copied'
: status === 'failed'
? 'Copy failed'
: 'Copy instructions'
}}
</button>
</div>
<span class="agent-bootstrap-status" role="status" aria-live="polite">{{
status === 'copied'
? 'Instructions copied to the clipboard.'
: status === 'failed'
? 'Could not copy. Select the text below and copy it instead.'
: ''
}}</span>
<details class="agent-bootstrap-details">
<summary>Show the instructions</summary>
<slot />
</details>
</section>
</template>

<style lang="scss">
.agent-bootstrap {
margin: 1.5rem 0 2rem;
padding: 1.25rem;
border: 1px solid var(--vp-c-border);
border-radius: 12px;
background: var(--vp-c-bg-alt);
}

.agent-bootstrap-header {
display: flex;
gap: 1rem;
align-items: flex-start;
justify-content: space-between;

@media (max-width: 600px) {
flex-direction: column;
}
}

.agent-bootstrap-title {
margin: 0;
font-weight: 600;
font-size: 1.1rem;
}

.agent-bootstrap-lead {
margin: 0.4rem 0 0;
color: var(--vp-c-text-mute);
}

.agent-bootstrap-copy {
flex-shrink: 0;
min-width: 10.5rem;
padding: 0.6rem 1rem;
border: none;
border-radius: 8px;
background: var(--vp-c-accent-bg);
color: var(--vp-c-accent-text);
font: inherit;
font-weight: 600;
cursor: pointer;

&:hover {
background: var(--vp-c-accent-hover);
}

&:focus-visible {
outline: 2px solid var(--vp-c-accent);
outline-offset: 2px;
}
}

.agent-bootstrap-status {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}

.agent-bootstrap-details {
margin-top: 0.75rem;

summary {
cursor: pointer;
color: var(--vp-c-text-mute);
}

// The instructions are prose, so wrap them instead of scrolling sideways,
// and drop the line numbers, which would no longer line up.
div[class*='language-'] {
margin-bottom: 0;

pre {
white-space: pre-wrap;
overflow-wrap: anywhere;
}

// The gutter is the line numbers' column and the ::after rule
// beside it.
.line-numbers,
&::after {
display: none;
}

pre {
margin-left: 0;
padding-left: 1.25rem;
}
}
}
</style>
14 changes: 6 additions & 8 deletions docs/.vuepress/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,14 @@ onBeforeUnmount(() => {
>{{ labels.home.datasetsLink }} &rarr;</span
>
</RouteLink>
<div class="card">
<!-- The Seed Bible pages are only in English. -->
<RouteLink class="card" to="/seed-bible/">
<h3>{{ labels.home.seedBibleTitle }}</h3>
<p>{{ labels.home.seedBibleBody }}</p>
<span class="go pending">{{
labels.home.seedBibleComing
}}</span>
</div>
<span class="go"
>{{ labels.home.seedBibleLink }} &rarr;</span
>
</RouteLink>
</div>
</div>
</section>
Expand Down Expand Up @@ -1078,9 +1079,6 @@ onBeforeUnmount(() => {
font-weight: 600;
font-size: 15px;
}
.card .go.pending {
color: var(--muted);
}

.matrix-wrap {
overflow-x: auto;
Expand Down
37 changes: 27 additions & 10 deletions docs/.vuepress/components/OpenEcosystemPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,15 @@ onBeforeUnmount(() => io?.disconnect());
<div v-for="card in CARDS" :key="card" class="card">
<h3>{{ o.cards[card].title }}</h3>
<p>{{ o.cards[card].body }}</p>
<span
<!-- The Seed Bible pages are only in English. -->
<RouteLink
v-if="card === 'seedBible'"
class="go pending"
>{{ o.seedBibleComing }}</span
class="go"
to="/seed-bible/"
>{{
labels.home.seedBibleLink
}}
&rarr;</RouteLink
>
</div>
</div>
Expand All @@ -223,7 +228,9 @@ onBeforeUnmount(() => io?.disconnect());
class="btn primary"
:to="localePage('/free-use-fund.html')"
>{{ o.fundLink }}
<span aria-hidden="true">&rarr;</span></RouteLink
<span aria-hidden="true"
>&rarr;</span
></RouteLink
>
</div>
<VerseQuote :verse="verses.wholeBody" />
Expand All @@ -250,7 +257,9 @@ onBeforeUnmount(() => io?.disconnect());
labels.home.newsletterPrompt
}}</small>
<strong
>{{ labels.home.newsletterLink }}
>{{
labels.home.newsletterLink
}}
&rarr;</strong
>
<p>{{ labels.home.newsletterBody }}</p>
Expand All @@ -262,7 +271,9 @@ onBeforeUnmount(() => io?.disconnect());
>
<small>{{ labels.home.discordPrompt }}</small>
<strong
>{{ labels.home.contributeDiscord }}
>{{
labels.home.contributeDiscord
}}
&#8599;</strong
>
<p>{{ labels.home.discordBody }}</p>
Expand Down Expand Up @@ -565,11 +576,17 @@ onBeforeUnmount(() => io?.disconnect());
font-weight: 600;
font-size: 15px;
}
.card .go.pending {
color: var(--muted);
.card a.go {
color: var(--text);
text-decoration: underline;
text-decoration-color: transparent;
text-underline-offset: 3px;
}
.card a.go:hover {
text-decoration-color: currentColor;
}
// the cards sit under a centred heading and proof row, and carry no
// links here, so centre their text and let them hug it
// the cards sit under a centred heading and proof row, and only the
// Seed Bible one carries a link, so centre their text and let them hug it
@media (min-width: 621px) {
.card {
min-height: 0;
Expand Down
11 changes: 4 additions & 7 deletions docs/.vuepress/components/SiteFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ const aoLabLogoDark = withBase('/ao_lab_logo_dark.png');
>
</li>
<li>
<span class="soon">{{
labels.footer.seedBibleSoon
}}</span>
<!-- The Seed Bible pages are only in English. -->
<RouteLink to="/seed-bible/">{{
labels.footer.seedBible
}}</RouteLink>
</li>
</ul>
</div>
Expand Down Expand Up @@ -357,10 +358,6 @@ const aoLabLogoDark = withBase('/ao_lab_logo_dark.png');
.foot-cols a {
color: var(--text-2);
}
.foot-cols .soon {
color: var(--muted);
cursor: default;
}
.foot-cols a:hover {
color: var(--text);
text-decoration: underline;
Expand Down
Loading
Loading