@mvarble/mesearch 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/app/ambient.d.ts +24 -0
- package/app/app.html +28 -0
- package/app/components/Proof.svelte +19 -0
- package/app/components/Statement.svelte +19 -0
- package/app/error.html +23 -0
- package/app/hooks.server.ts +8 -0
- package/app/lib/format.ts +6 -0
- package/app/lib/server/refs.ts +32 -0
- package/app/lib/types.ts +16 -0
- package/app/params/kind.ts +5 -0
- package/app/routes/+error.svelte +37 -0
- package/app/routes/+layout.svelte +41 -0
- package/app/routes/+layout.ts +2 -0
- package/app/routes/+page.server.ts +37 -0
- package/app/routes/+page.svelte +212 -0
- package/app/routes/+page.ts +18 -0
- package/app/routes/[kind=kind]/[slug]/+page.server.ts +62 -0
- package/app/routes/[kind=kind]/[slug]/+page.svelte +116 -0
- package/app/routes/[kind=kind]/[slug]/+page.ts +8 -0
- package/app/routes/search.json/+server.ts +30 -0
- package/app/static/favicon.svg +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +146 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +26 -0
- package/dist/config.js +82 -0
- package/dist/config.js.map +1 -0
- package/dist/headings.d.ts +2 -0
- package/dist/headings.js +17 -0
- package/dist/headings.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +6 -0
- package/dist/init.js +214 -0
- package/dist/init.js.map +1 -0
- package/dist/kit.d.ts +4 -0
- package/dist/kit.js +180 -0
- package/dist/kit.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +16 -0
- package/dist/paths.js.map +1 -0
- package/dist/project.d.ts +26 -0
- package/dist/project.js +92 -0
- package/dist/project.js.map +1 -0
- package/dist/resolve.d.ts +2 -0
- package/dist/resolve.js +51 -0
- package/dist/resolve.js.map +1 -0
- package/package.json +83 -0
- package/templates/AGENTS.md +64 -0
- package/templates/content/concepts/example-concept/description.md +1 -0
- package/templates/content/concepts/example-concept/index.md +16 -0
- package/templates/content/description.md +1 -0
- package/templates/content/writeups/example-writeup/index.md +7 -0
- package/templates/mesearch.config.ts +22 -0
- package/tsconfig.project.json +16 -0
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mvarble/mesearch",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "An opinionated static site for a library of agent-written notes: concepts, writeups and sequences under content/, rendered as a textbook with KaTeX, a dependency graph and an index.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Matthew Varble <matthew@rodent.club>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/mvarble/mesearch.git",
|
|
10
|
+
"directory": "packages/mesearch"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/mvarble/mesearch#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/mvarble/mesearch/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"markdown",
|
|
18
|
+
"mdsvex",
|
|
19
|
+
"svelte",
|
|
20
|
+
"sveltekit",
|
|
21
|
+
"katex",
|
|
22
|
+
"static-site",
|
|
23
|
+
"notes",
|
|
24
|
+
"cli"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"bin": {
|
|
31
|
+
"mesearch": "./dist/cli.js"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./kit": {
|
|
39
|
+
"types": "./dist/kit.d.ts",
|
|
40
|
+
"import": "./dist/kit.js"
|
|
41
|
+
},
|
|
42
|
+
"./Statement.svelte": {
|
|
43
|
+
"svelte": "./app/components/Statement.svelte",
|
|
44
|
+
"default": "./app/components/Statement.svelte"
|
|
45
|
+
},
|
|
46
|
+
"./Proof.svelte": {
|
|
47
|
+
"svelte": "./app/components/Proof.svelte",
|
|
48
|
+
"default": "./app/components/Proof.svelte"
|
|
49
|
+
},
|
|
50
|
+
"./tsconfig.json": "./tsconfig.project.json",
|
|
51
|
+
"./package.json": "./package.json"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist",
|
|
55
|
+
"app",
|
|
56
|
+
"templates",
|
|
57
|
+
"tsconfig.project.json"
|
|
58
|
+
],
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=22.18"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@mvarble/mesearch-cms": "^0.1.0",
|
|
64
|
+
"@mvarble/mesearch-markdown": "^0.1.0",
|
|
65
|
+
"@mvarble/mesearch-ui": "^0.1.0",
|
|
66
|
+
"@sveltejs/adapter-static": "^3.0.10",
|
|
67
|
+
"@sveltejs/kit": "^2.70.3",
|
|
68
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
69
|
+
"katex": "^0.18.4",
|
|
70
|
+
"svelte": "^5.57.1",
|
|
71
|
+
"vite": "^8.3.2"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/hast": "^3.0.5",
|
|
75
|
+
"@types/node": "^22.14.0",
|
|
76
|
+
"typescript": "^6.0.3"
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "tsc -p tsconfig.json",
|
|
80
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
81
|
+
"test": "node --test 'test/**/*.test.mjs'"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Writing for {{title}}
|
|
2
|
+
|
|
3
|
+
This repository is a [mesearch](https://github.com/mvarble/mesearch) site: a library of documents written to be read and learned from. `mesearch dev` serves it while you write and `mesearch build` writes the static site to `build/`. Everything about how the site looks is mesearch's; this repository holds only the documents and a little configuration.
|
|
4
|
+
|
|
5
|
+
These instructions apply to every agent writing here. They sit alongside any procedure you were given for the task (an `/explain` run, say); where the two disagree about this site's layout or conventions, this file wins.
|
|
6
|
+
|
|
7
|
+
## Layout
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
content/
|
|
11
|
+
description.md what the site is about; opens the home page
|
|
12
|
+
concepts/<slug>/index.md one concept per folder
|
|
13
|
+
concepts/<slug>/description.md optional one- or two-sentence preview
|
|
14
|
+
writeups/<slug>/index.md one writeup per folder
|
|
15
|
+
writeups/<slug>/description.md optional preview
|
|
16
|
+
sequences/<slug>/index.md an ordered run of writeups
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- A **concept** explains a single idea on its own terms. A **writeup** works through something --- a source document, a problem, a topic --- using concepts.
|
|
20
|
+
- The folder name is the slug: lowercase words joined by hyphens, named after the idea (`net-interest-margin`), never dated.
|
|
21
|
+
- Documents may be `.md` or `.svx` ([mdsvex](https://mdsvex.pngwn.io/): markdown that can import and use Svelte components). Anything else a document uses --- images, data, components --- goes in its own folder and is referenced relatively, as ``.
|
|
22
|
+
- Before creating a concept, check `content/concepts/`: if it exists, link to it and never rewrite or duplicate it. If a concept a document needs is missing, create it.
|
|
23
|
+
|
|
24
|
+
## Frontmatter
|
|
25
|
+
|
|
26
|
+
Every `index` document starts with YAML frontmatter:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
---
|
|
30
|
+
title: Net interest margin
|
|
31
|
+
created: 2026-10-01
|
|
32
|
+
updated: 2026-10-03 # only when revising; omit on creation
|
|
33
|
+
depends_on: [basis-points, writeups/bank-balance-sheets]
|
|
34
|
+
katex_macros:
|
|
35
|
+
'\NIM': '\mathrm{NIM}'
|
|
36
|
+
---
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `title` is required. It may contain inline math (`$\sigma$-algebras`).
|
|
40
|
+
- `created` and `updated` are dates. Without them the site falls back to the git history of the document's folder.
|
|
41
|
+
- `depends_on` lists what a reader must understand first, by slug. A bare slug names a concept or a writeup; write `concepts/<slug>` or `writeups/<slug>` when both exist. These become the solid arrows of the map, so they should be the real prerequisites --- the documents a reader would otherwise be lost without --- not everything mentioned.
|
|
42
|
+
- `katex_macros` are added to the site-wide macros in `mesearch.config.ts` for this document only.
|
|
43
|
+
- A sequence (`content/sequences/<slug>/index.md`) also has `documents:`, the writeups in reading order. Its body introduces the sequence.
|
|
44
|
+
|
|
45
|
+
A `description.md` has no frontmatter beyond optional `katex_macros`. It is one or two plain sentences saying what the document covers, for the map's preview panel and the index; without one, the document's first paragraph is used.
|
|
46
|
+
|
|
47
|
+
## Links
|
|
48
|
+
|
|
49
|
+
- Link to other documents with relative paths, the way the folders sit on disk: `[basis points](../basis-points/)` from one concept to another, `[the writeup](../../writeups/bank-balance-sheets/)` from a concept to a writeup. Links ending in `index.md` also work. The site rewrites them to the right URLs.
|
|
50
|
+
- A link between two documents that do not depend on each other draws a dashed line on the map, so link generously where it helps the reader.
|
|
51
|
+
- Never put a link inside a heading. When a section concerns another document, put `See also: [Name](../name/)` on its own line under the heading.
|
|
52
|
+
|
|
53
|
+
## Prose
|
|
54
|
+
|
|
55
|
+
Write in the register of a textbook: impersonal third-person exposition in complete sentences and paragraphs, with tables and bullet lists only where they genuinely help. Never address the reader or write in the first person, and never refer to the conversation or session that produced the document. Prefer a concrete example to an abstract definition alone. Each document must stand on its own for a reader arriving at it first, relying only on what it links as prerequisites.
|
|
56
|
+
|
|
57
|
+
## Site-specific opinions
|
|
58
|
+
|
|
59
|
+
<!-- Opinions particular to this site go here: its subject, the reader's
|
|
60
|
+
background, notation conventions, what to emphasise. For example:
|
|
61
|
+
|
|
62
|
+
- The reader is comfortable with undergraduate real analysis.
|
|
63
|
+
- Write probability measures as \PP and expectations as \EE.
|
|
64
|
+
-->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
A one- or two-sentence preview, shown when the concept is selected on the map and in the index.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: An example concept
|
|
3
|
+
created: {{date}}
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A concept explains one idea on its own terms: what it is, why it matters, and an example. Its folder name is its slug, so this one lives at `concepts/example-concept/`.
|
|
7
|
+
|
|
8
|
+
# A section
|
|
9
|
+
|
|
10
|
+
Headings become the table of contents beside the page. Display math is written like this:
|
|
11
|
+
|
|
12
|
+
$$
|
|
13
|
+
\int_0^1 x \, {\rm d}x = \frac{1}{2}. @tag(half)
|
|
14
|
+
$$
|
|
15
|
+
|
|
16
|
+
The `@tag(half)` numbers the equation, and [this link](eq:half) refers back to it.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
What this site is for, in a paragraph or two. This text opens the home page, above the map of every concept and writeup. It is ordinary markdown: it can link to [a concept](./concepts/example-concept/) and use math like $e^{i\pi} = -1$.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: An example writeup
|
|
3
|
+
created: {{date}}
|
|
4
|
+
depends_on: [example-concept]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
A writeup works through something using the concepts beneath it. Its `depends_on` list draws the solid arrow from [the example concept](../../concepts/example-concept/) to here on the map; a plain link between two documents that do not depend on each other draws a dashed line instead.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfig } from '@mvarble/mesearch';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
// The site's name, shown on the home page and in every tab.
|
|
5
|
+
title: '{{title}}',
|
|
6
|
+
// author: 'Your name',
|
|
7
|
+
// lang: 'en',
|
|
8
|
+
|
|
9
|
+
// The URL prefix the site is served from, if not the root of its domain,
|
|
10
|
+
// as in GitHub Pages' '/<repository>'.
|
|
11
|
+
// base: '/notes',
|
|
12
|
+
|
|
13
|
+
// KaTeX macros every document can use. A document adds its own in its
|
|
14
|
+
// frontmatter, under `katex_macros`.
|
|
15
|
+
katexMacros: {
|
|
16
|
+
// '\\PP': '\\mathbb{P}',
|
|
17
|
+
// '\\EE': '\\mathbb{E}',
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
// How the map lays itself out.
|
|
21
|
+
// graph: { charge: -900, linkDistance: 80, gravity: 0.02 },
|
|
22
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2023",
|
|
4
|
+
"lib": ["es2023", "dom", "dom.iterable"],
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"moduleResolution": "nodenext",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"checkJs": false,
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["${configDir}/mesearch.config.ts", "${configDir}/content/**/*"]
|
|
16
|
+
}
|