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 CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Database (all scripts run with `tsx` and are type-checked by `pnpm check` via th
- `pnpm db:snapshot`: copy the database to `static/databases/catdat-snapshot.db` for the download page.
- `pnpm db:update`: run `db:seed`, `db:deduce`, `db:test`, and `db:snapshot` in sequence. **This is the standard command after editing any YAML data.** Use `--watch` to rerun it whenever a file in `database/data/` changes.
- `pnpm db:text`: fast path for text-only changes to existing structures (names, notations, alternative notations, descriptions, nLab links, comments, keywords, objects and morphisms of categories, proofs of property assignments), properties (descriptions, nLab links), and implications (proofs). It updates changed fields without rebuilding relations or running deductions. Special objects, special morphisms, and special morphism rules are not covered. Supports `--watch`.
- After `db:update`, and after `db:text` when it changed something, the script writes a timestamp to `database/.last-update` (gitignored). A Vite plugin in [vite.config.ts](vite.config.ts) watches this file and reloads the browser while `pnpm dev` is running.
- After `db:update`, and after `db:text` when it changed something, the script writes a timestamp to `database/.last-update` (gitignored). A Vite plugin in [vite.config.ts](vite.config.ts) watches this file and the Markdown files in `content/`, and reloads the browser when one of them changes while `pnpm dev` is running.
- `pnpm db:redundancies`: report property assignments that could already be deduced from others. It reports at most one per structure and kind, so rerun it after each removal. Not part of `db:update`.
- `pnpm db:combinations <id> [<id> ...]`: list the combinations p ∧ ¬q that the given structures (or their duals) witness and that no other structure in the database witnesses. Needs only the IDs, not the type (all IDs must have the same type). Useful to judge whether a structure adds new information.
- `pnpm db:structure <id> [group]`: print the property IDs of a structure, grouped into `satisfied`, `unsatisfied`, `unknown`, and `undecidable` with counts (a terminal version of the structure detail page). An optional group argument restricts the output to that group, e.g. `pnpm db:structure Ab unsatisfied`. Needs only the ID, not the type.
Expand Down
7 changes: 2 additions & 5 deletions src/routes/content/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@

<MetaData
title="Content pages"
description="For long-form content, particularly longer proofs and reusable lemmas, we use content pages."
description="For long-form content and reusable lemmas, we use content pages."
/>

<h1>Content pages</h1>

<p class="hint">
For long-form content, particularly longer proofs and reusable lemmas, we use content
pages.
</p>
<p class="hint">For long-form content and reusable lemmas, we use content pages.</p>

<ul>
{#each data.pages as page}
Expand Down
23 changes: 17 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,33 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import { defineConfig, type Plugin } from 'vite'
import { sveltekit } from '@sveltejs/kit/vite'
import { UPDATE_MARKER_PATH } from './shared/db.ts'
import path from 'node:path'

const CONTENT_FOLDER = path.resolve('content')

/**
* Reloads the browser when a database script marks the database as updated
* or when a content page is edited
*/
function reload_on_database_update(): Plugin {
function reload_on_data_update(): Plugin {
return {
name: 'reload-on-database-update',
name: 'reload-on-data-update',
apply: 'serve',
configureServer(server) {
server.watcher.add(UPDATE_MARKER_PATH)
server.watcher.add([UPDATE_MARKER_PATH, CONTENT_FOLDER])

function on_change(file: string) {
if (file === UPDATE_MARKER_PATH) server.ws.send({ type: 'full-reload' })
const is_content_page =
path.dirname(file) === CONTENT_FOLDER && file.endsWith('.md')
if (file === UPDATE_MARKER_PATH || is_content_page) {
server.ws.send({ type: 'full-reload' })
}
}

server.watcher.on('add', on_change).on('change', on_change)
server.watcher
.on('add', on_change)
.on('change', on_change)
.on('unlink', on_change)
}
}
}
Expand All @@ -29,6 +40,6 @@ export default defineConfig({
preprocess: vitePreprocess(),
adapter: adapter()
}),
reload_on_database_update()
reload_on_data_update()
]
})
Loading