44390e765d
Add a custom Shiki grammar for the simple-mode command language (src/grammars/rdbms.mjs), registered with Expressive Code. Two language ids share it: rdbms (real commands) and rdbms-syntax (abstract templates). Simple-mode blocks now highlight; advanced examples keep sql. Separation + copy ergonomics via CSS (global.css): a decorative, copy-safe "> " prompt on rdbms command lines (not in the copy buffer), and the copy button hidden on multi-command rdbms blocks and on rdbms-syntax templates (the app input is single-line, so a multi-command paste is not runnable); single-command, sql, and sh blocks keep copy. Content: convert 22 simple-mode fences to rdbms; lead the simplest examples (first project, Tables reference) with bare "with pk" (the beginner default that creates a ready-made id key), pointing to the named form. Record the fence + prompt conventions in STYLE.md.
47 lines
2.0 KiB
JavaScript
47 lines
2.0 KiB
JavaScript
// @ts-check
|
|
import { defineConfig } from 'astro/config';
|
|
import starlight from '@astrojs/starlight';
|
|
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
|
|
// Custom highlight grammar for the playground's simple-mode command language
|
|
// (advanced-mode examples use the built-in `sql` grammar). Fence with ```rdbms.
|
|
import rdbmsLang, { rdbmsSyntax } from './src/grammars/rdbms.mjs';
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
// TODO(Phase B/SEO): set `site` to the production URL once the domain is
|
|
// known — enables the sitemap and canonical/OG URLs.
|
|
// Bind the dev/preview server to IPv4 loopback. Astro/Vite's default
|
|
// `localhost` bind resolves to IPv6 `::1` here, which breaks SSH
|
|
// `-L 4321:127.0.0.1:4321` tunnels (they target IPv4). Pinning 127.0.0.1
|
|
// keeps loopback-only access and makes tunnelling unambiguous.
|
|
server: { host: '127.0.0.1' },
|
|
integrations: [
|
|
starlight({
|
|
title: 'RDBMS Playground',
|
|
tagline: 'Learn relational databases by doing.',
|
|
// TODO(Phase B): point at the real repository once it moves to its
|
|
// public home. Omitted for now rather than linking the wrong repo.
|
|
// social: [{ icon: 'github', label: 'GitHub', href: '…' }],
|
|
customCss: ['./src/styles/global.css'],
|
|
// Register the simple-mode command grammar with Expressive Code (Shiki).
|
|
expressiveCode: { shiki: { langs: [rdbmsLang, rdbmsSyntax] } },
|
|
// Pragmatic structure (ADR-0044 §7 / website/STYLE.md): Getting
|
|
// started, Guides, Reference, Concepts. Autogenerated per directory;
|
|
// in-section order is controlled by each page's `sidebar.order`
|
|
// frontmatter.
|
|
sidebar: [
|
|
{ label: 'Getting started', items: [{ autogenerate: { directory: 'getting-started' } }] },
|
|
{ label: 'Guides', items: [{ autogenerate: { directory: 'guides' } }] },
|
|
{ label: 'Reference', items: [{ autogenerate: { directory: 'reference' } }] },
|
|
{ label: 'Concepts', items: [{ autogenerate: { directory: 'concepts' } }] },
|
|
],
|
|
}),
|
|
],
|
|
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
},
|
|
});
|