Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
env:
MDBASE_SPEC_DIR: .sources/mdbase-spec

- name: Build search index and Markdown copies
- name: Build Markdown copies
run: pnpm index:site

- name: Check local links
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
env:
MDBASE_SPEC_DIR: .sources/mdbase-spec

- name: Build search index and Markdown copies
- name: Build Markdown copies
run: pnpm index:site

- name: Check local links
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ pnpm index:site
pnpm check:links
```

`pnpm index:site` builds the Pagefind index for the header's search dialog,
then writes a Markdown copy of each page (`index.md` beside its `index.html`),
`pnpm index:site` writes a Markdown copy of each page (`index.md` beside its `index.html`),
`/llms.txt` and `/llms-full.txt` (`scripts/build-llms.mjs`). It runs after the
specification import so the specification is included. Each page's `<main>` is
used; headers, footers and documentation sidebars are excluded, as are pages
Expand Down Expand Up @@ -127,8 +126,7 @@ pnpm deploy:dev
```

The command builds the current working tree for
`https://mdbase-dev.pages.dev`, imports the specification, builds the search
index and Markdown copies, checks local links, and deploys the `main` branch of
`https://mdbase-dev.pages.dev`, imports the specification, builds the Markdown copies, checks local links, and deploys the `main` branch of
the standalone `mdbase-dev` Cloudflare Pages project. It verifies the live homepage, specification, canonical URLs, and
indexing controls after deployment. The production GitHub Pages deployment and
`mdbase.dev` domain are unchanged.
Expand Down
2 changes: 2 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default defineConfig({
// Compression drops the line break before an inline link, gluing it to the previous word.
compressHTML: false,
integrations: [sitemap()],
// Fetch a page when its link is hovered or touched, so it is ready by the click.
prefetch: { prefetchAll: true, defaultStrategy: "hover" },
build: {
format: "directory"
},
Expand Down
5 changes: 4 additions & 1 deletion content/_types/doc-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ address, so `apps/reader/index.md` is `/apps/reader/`.
`section` is the documentation set the page belongs to, which picks its
sidebar.

The body is ordinary Markdown with three additions the site understands:
The body is ordinary Markdown with four additions the site understands:

- A heading can keep a fixed anchor: `## Saved views {#views}`.
- A code block can name its file: ` ```ts title="src/mdbase.ts" `. With
Expand All @@ -45,3 +45,6 @@ The body is ordinary Markdown with three additions the site understands:
JSON file.
- An image whose address is a recording in `/videos/` is shown as that
recording, with its captions and text description.
- A heading marked `{.cards}` shows the list under it as cards, two to a row.
Each item is a bold title, a sentence or two, and a link, each in its own
paragraph.
26 changes: 13 additions & 13 deletions content/sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ section: sdk

An mdbase collection is a folder of Markdown files with typed frontmatter, synced across a person’s devices. An app built with the SDK reads and writes the records in a collection its user chooses.

## Where to start {#start}
## Where to start {#start .cards}

**Build an app**
- **Build an app**

Build Worklog, a small app that signs a user in and keeps its entries in their collection, from an empty folder to a deployed site. It uses React, and its last section shows the same app without React.
Build Worklog, a small app that signs a user in and keeps its entries in their collection, from an empty folder to a deployed site. It uses React, and its last section shows the same app without React.

[Follow the tutorial](/sdk/connect-quickstart/)
[Follow the tutorial](/sdk/connect-quickstart/)

**Try the SDK in memory**
- **Try the SDK in memory**

Run a short script against an in-memory collection. It needs no account or service, and shows reads, writes and live queries.
Run a short script against an in-memory collection. It needs no account or service, and shows reads, writes and live queries.

[Run the script](/sdk/quickstart/)
[Run the script](/sdk/quickstart/)

**Develop on localhost**
- **Develop on localhost**

Run your app from a development server against real accounts and collections.
Run your app from a development server against real accounts and collections.

[Set up local development](/sdk/local-development/)
[Set up local development](/sdk/local-development/)

**The format**
- **The format**

Build tools that read and write mdbase collections as files, with no SDK.
Build tools that read and write mdbase collections as files, with no SDK.

[Read the specification](/spec/)
[Read the specification](/spec/)

## Why build on mdbase {#why}

Expand Down
19 changes: 19 additions & 0 deletions docs/app-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,22 @@ and opt-in accessible video controls. Site CI and the production build run it to
Production is the repository's GitHub Pages workflow (`.github/workflows/deploy.yml`), triggered
by a merge to `main`. Cloudflare Pages is only the separate development deployment. Verify
`/apps/`, both documentation roots, all five video files and their posters after deployment.

## Screenshots

`AppShot.astro` frames the screenshots in `public/images/apps`. Each has a light and a dark
capture, 1600×1000 WebP, taken from a 1120×700 window at 2×.

The Connect and desktop app screenshots use made-up accounts from the apps' own review
fixtures, with no real account or collection content. Retake them from an mdbase-connect
checkout with `scripts/screenshots/capture-connect.mjs` (the web screens, against
`pnpm portal:review`) and `scripts/screenshots/capture-desktop.mjs` (the desktop app's
renderer in a browser). Each script's header gives the steps. Retake them when those screens
change.

On a phone each screenshot shows only the part of the window named for it in
`AppShot.astro` (`crops`), and opening it shows the whole capture; set a crop when you add
a screenshot.

The social share image, `public/og-card.jpg`, is drawn from the homepage's sky by
`scripts/screenshots/capture-og-card.mjs`. Redraw it when the typefaces or the mark change.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sync:mcp-tools": "node scripts/sync-mcp-tools.mjs",
"sync:contracts": "node scripts/sync-contracts.mjs",
"import:spec": "node scripts/import-spec.mjs",
"index:site": "pagefind --site dist && node scripts/build-llms.mjs",
"index:site": "node scripts/build-llms.mjs",
"check:links": "node scripts/check-links.mjs",
"build:sdk-api": "node scripts/build-sdk-api.mjs",
"check:sdk-api": "node scripts/build-sdk-api.mjs --check",
Expand All @@ -29,14 +29,13 @@
"dependencies": {
"@astrojs/markdown-satteri": "0.3.4",
"@astrojs/sitemap": "^3.7.3",
"@fontsource/atkinson-hyperlegible": "^5.3.0",
"@fontsource/azeret-mono": "^5.3.0",
"@fontsource/ibm-plex-sans": "^5.3.0",
"astro": "^7.1.3",
"yaml": "^2.9.0"
},
"devDependencies": {
"@astrojs/check": "^0.9.9",
"pagefind": "1.5.2",
"turndown": "7.2.4",
"typescript": "^6.0.3"
}
Expand Down
87 changes: 7 additions & 80 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/images/apps/connect-approve-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/connect-approve-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/connect-collections-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/connect-sharing-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/connect-sharing-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/desktop-collections-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/desktop-collections-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/desktop-home-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apps/desktop-home-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion public/mdbase-atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
};

function readBase() {
const base = getComputedStyle(root).getPropertyValue('--color-canvas').trim();
// The token can be a light-dark() expression, which a canvas cannot parse, so an element resolves it.
const probe = document.createElement('span');
probe.style.cssText = 'display:none;color:var(--color-canvas)';
root.append(probe);
const base = getComputedStyle(probe).color;
probe.remove();
colorContext.fillStyle = base;
colorContext.fillRect(0, 0, 1, 1);
baseRgb = [...colorContext.getImageData(0, 0, 1, 1).data].slice(0, 3).join(',');
Expand Down
Loading