@tinyvolt/pie 0.9.0 → 0.11.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.
Files changed (139) hide show
  1. package/README.md +18 -1
  2. package/dist/components/SplitPane.d.ts +21 -0
  3. package/dist/components/SplitPane.jsx +113 -0
  4. package/dist/components/icons.d.ts +12 -0
  5. package/dist/components/icons.jsx +45 -0
  6. package/dist/lib/autodiff/index.d.ts +28 -0
  7. package/dist/lib/autodiff/index.js +39 -0
  8. package/dist/lib/customModules.d.ts +19 -0
  9. package/dist/lib/customModules.js +52 -0
  10. package/dist/lib/markdown/compile.d.ts +27 -0
  11. package/dist/lib/markdown/compile.js +26 -0
  12. package/dist/lib/markdown/components/CanvasPage.d.ts +9 -0
  13. package/dist/lib/markdown/components/CanvasPage.jsx +16 -0
  14. package/dist/lib/markdown/components/MarkdownBody.d.ts +11 -0
  15. package/dist/lib/markdown/components/MarkdownBody.jsx +37 -0
  16. package/dist/lib/markdown/components/PiePage.d.ts +14 -0
  17. package/dist/lib/markdown/components/PiePage.jsx +42 -0
  18. package/dist/lib/markdown/components/PythonEditor.d.ts +10 -0
  19. package/dist/lib/markdown/components/PythonEditor.jsx +209 -0
  20. package/dist/lib/markdown/features/build.d.ts +60 -0
  21. package/dist/lib/markdown/features/build.js +36 -0
  22. package/dist/lib/markdown/features/glossary/View.d.ts +9 -0
  23. package/dist/lib/markdown/features/glossary/View.jsx +62 -0
  24. package/dist/lib/markdown/features/glossary/build.d.ts +6 -0
  25. package/dist/lib/markdown/features/glossary/build.js +81 -0
  26. package/dist/lib/markdown/features/sidebar/View.d.ts +11 -0
  27. package/dist/lib/markdown/features/sidebar/View.jsx +45 -0
  28. package/dist/lib/markdown/features/sidebar/build.d.ts +3 -0
  29. package/dist/lib/markdown/features/sidebar/build.js +7 -0
  30. package/dist/lib/markdown/features/tags/build.d.ts +7 -0
  31. package/dist/lib/markdown/features/tags/build.js +22 -0
  32. package/dist/lib/markdown/features/tags/url.d.ts +6 -0
  33. package/dist/lib/markdown/features/tags/url.js +10 -0
  34. package/dist/lib/markdown/features/toc/build.d.ts +7 -0
  35. package/dist/lib/markdown/features/toc/build.js +62 -0
  36. package/dist/lib/markdown/features/views.d.ts +4 -0
  37. package/dist/lib/markdown/features/views.jsx +11 -0
  38. package/dist/lib/markdown/frontmatter.d.ts +44 -0
  39. package/dist/lib/markdown/frontmatter.js +109 -0
  40. package/dist/lib/markdown/render.d.ts +6 -0
  41. package/dist/lib/markdown/render.js +95 -0
  42. package/dist/lib/nodes/animation.d.ts +14 -0
  43. package/dist/lib/nodes/animation.js +34 -0
  44. package/dist/lib/nodes/components/CenteredGrid.d.ts +20 -0
  45. package/dist/lib/nodes/components/CenteredGrid.jsx +44 -0
  46. package/dist/lib/nodes/components/NodeCanvas.d.ts +7 -0
  47. package/dist/lib/nodes/components/NodeCanvas.jsx +50 -0
  48. package/dist/lib/nodes/execute.d.ts +27 -0
  49. package/dist/lib/nodes/execute.js +159 -0
  50. package/dist/lib/nodes/functions/Node2NodeFunc.d.ts +70 -0
  51. package/dist/lib/nodes/functions/Node2NodeFunc.js +223 -0
  52. package/dist/lib/nodes/functions/array.d.ts +12 -0
  53. package/dist/lib/nodes/functions/array.js +31 -0
  54. package/dist/lib/nodes/functions/autodiff.d.ts +12 -0
  55. package/dist/lib/nodes/functions/autodiff.js +60 -0
  56. package/dist/lib/nodes/functions/basic.d.ts +111 -0
  57. package/dist/lib/nodes/functions/basic.js +275 -0
  58. package/dist/lib/nodes/functions/registry.d.ts +9 -0
  59. package/dist/lib/nodes/functions/registry.js +45 -0
  60. package/dist/lib/nodes/functions/sideEffects.d.ts +78 -0
  61. package/dist/lib/nodes/functions/sideEffects.js +201 -0
  62. package/dist/lib/nodes/hooks/useCanvasGestures.d.ts +9 -0
  63. package/dist/lib/nodes/hooks/useCanvasGestures.js +120 -0
  64. package/dist/lib/nodes/hooks/useCanvasResize.d.ts +2 -0
  65. package/dist/lib/nodes/hooks/useCanvasResize.js +33 -0
  66. package/dist/lib/nodes/jax.d.ts +46 -0
  67. package/dist/lib/nodes/jax.js +120 -0
  68. package/dist/lib/nodes/render/renderLogic.d.ts +13 -0
  69. package/dist/lib/nodes/render/renderLogic.jsx +234 -0
  70. package/dist/lib/nodes/state/NameGenerator.d.ts +10 -0
  71. package/dist/lib/nodes/state/NameGenerator.js +29 -0
  72. package/dist/lib/nodes/state/Node.d.ts +134 -0
  73. package/dist/lib/nodes/state/Node.js +57 -0
  74. package/dist/lib/nodes/state/NodeStore.d.ts +49 -0
  75. package/dist/lib/nodes/state/NodeStore.js +138 -0
  76. package/dist/lib/nodes/tensors/broadcast.d.ts +18 -0
  77. package/dist/lib/nodes/tensors/broadcast.js +92 -0
  78. package/dist/lib/nodes/tensors/tensor.d.ts +13 -0
  79. package/dist/lib/nodes/tensors/tensor.js +34 -0
  80. package/dist/lib/python/lift.d.ts +51 -0
  81. package/dist/lib/python/lift.js +155 -0
  82. package/dist/lib/python/py/pie.py +303 -0
  83. package/dist/lib/python/py/pie_mpl.py +15 -0
  84. package/dist/lib/python/py/show_figures.py +5 -0
  85. package/dist/lib/python/runPage.d.ts +21 -0
  86. package/dist/lib/python/runPage.js +60 -0
  87. package/dist/lib/python/runner.d.ts +68 -0
  88. package/dist/lib/python/runner.js +243 -0
  89. package/dist/lib/python/worker.d.ts +1 -0
  90. package/dist/lib/python/worker.js +111 -0
  91. package/dist/lib/ui/UiLayer.d.ts +2 -0
  92. package/dist/lib/ui/UiLayer.jsx +15 -0
  93. package/dist/lib/ui/UiView.d.ts +23 -0
  94. package/dist/lib/ui/UiView.jsx +56 -0
  95. package/dist/lib/ui/components/checkboxes.d.ts +10 -0
  96. package/dist/lib/ui/components/checkboxes.jsx +30 -0
  97. package/dist/lib/ui/components/latex.d.ts +8 -0
  98. package/dist/lib/ui/components/latex.jsx +41 -0
  99. package/dist/lib/ui/components/radio.d.ts +6 -0
  100. package/dist/lib/ui/components/radio.jsx +19 -0
  101. package/dist/lib/ui/components/slider.d.ts +8 -0
  102. package/dist/lib/ui/components/slider.jsx +7 -0
  103. package/dist/lib/ui/components/textbox.d.ts +5 -0
  104. package/dist/lib/ui/components/textbox.jsx +21 -0
  105. package/dist/lib/ui/dragUi.d.ts +10 -0
  106. package/dist/lib/ui/dragUi.js +129 -0
  107. package/dist/lib/ui/nodeHandle.d.ts +15 -0
  108. package/dist/lib/ui/nodeHandle.js +37 -0
  109. package/dist/lib/ui/registry.d.ts +10 -0
  110. package/dist/lib/ui/registry.js +42 -0
  111. package/dist/runtime.css +696 -0
  112. package/dist/runtime.d.ts +10 -0
  113. package/dist/runtime.jsx +7 -0
  114. package/init/index.js +2 -2
  115. package/init/site-agents.md +2 -1
  116. package/package.json +15 -6
  117. package/runtime-agents.md +168 -0
  118. package/src/app.css +7 -665
  119. package/src/lib/customModules.ts +67 -0
  120. package/src/lib/markdown/compile.ts +49 -0
  121. package/src/lib/markdown/components/PiePage.tsx +49 -0
  122. package/src/lib/markdown/features/build.ts +15 -6
  123. package/src/lib/markdown/features/sidebar/View.tsx +4 -2
  124. package/src/lib/markdown/features/tags/build.ts +6 -3
  125. package/src/lib/markdown/pages.ts +1 -9
  126. package/src/lib/markdown/vitePlugin.ts +4 -8
  127. package/src/lib/nodes/functions/registry.ts +30 -21
  128. package/src/lib/nodes/functions/sideEffects.ts +14 -8
  129. package/src/lib/nodes/functions/vitePlugin.ts +8 -10
  130. package/src/lib/nodes/state/Node.ts +27 -19
  131. package/src/lib/python/runPage.ts +78 -0
  132. package/src/lib/python/runner.ts +189 -164
  133. package/src/lib/siteModules.ts +13 -0
  134. package/src/lib/ui/dragUi.ts +4 -2
  135. package/src/lib/ui/registry.ts +35 -14
  136. package/src/page.css +664 -0
  137. package/src/routes/[...slug].tsx +1 -0
  138. package/src/runtime.css +29 -0
  139. package/src/runtime.tsx +16 -0
@@ -330,7 +330,7 @@ export function Stepper(props: { args: UiArg[]; step?: number }) {
330
330
  - A UI that throws shows `pie.ui.<name>: <message>` in red in its place.
331
331
  - Don't add a grip or a label: every UI gets both. `args` and `label` are reserved prop names.
332
332
  - The built-in UIs are in `node_modules/@tinyvolt/pie/src/lib/ui/components/`.
333
- - A name used twice, by two of your files or by yours and a built-in, raises an error when a page with a Python editor loads. It doesn't fail the build.
333
+ - A name used twice, by two of your files or by yours and a built-in, fails the build.
334
334
 
335
335
  ## Layouts: `layouts/`
336
336
 
@@ -365,6 +365,7 @@ Change the CSS variables in `styles/theme.css` (colors, fonts, text width), or a
365
365
  - a page's URL matches a route in `node_modules/@tinyvolt/pie/src/routes/`
366
366
  - a `functions/` keyword is used twice
367
367
  - a `nodes/` type name is used twice
368
+ - a `ui/` name is used twice
368
369
  - a `layouts/` file has no default export
369
370
 
370
371
  Run `npm run build` after a change to confirm it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinyvolt/pie",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "A Markdown-based SSG for interactive science explainers. Create a site with: npx @tinyvolt/pie init my-site",
5
5
  "type": "module",
6
6
  "homepage": "https://pie.tinyvolt.com/",
@@ -9,7 +9,12 @@
9
9
  "url": "git+https://github.com/TinyVolt/pie-ssg.git"
10
10
  },
11
11
  "exports": {
12
- "./vite": "./vite.ts"
12
+ "./vite": "./vite.ts",
13
+ "./runtime": {
14
+ "types": "./dist/runtime.d.ts",
15
+ "solid": "./dist/runtime.jsx"
16
+ },
17
+ "./runtime.css": "./dist/runtime.css"
13
18
  },
14
19
  "bin": {
15
20
  "pie": "init/index.js"
@@ -26,13 +31,17 @@
26
31
  "layouts",
27
32
  "public",
28
33
  "site.yml",
29
- ".nvmrc"
34
+ ".nvmrc",
35
+ "dist",
36
+ "runtime-agents.md"
30
37
  ],
31
38
  "scripts": {
32
39
  "dev": "vite dev",
33
40
  "build": "vite build",
34
41
  "start": "node .output/server/index.mjs",
35
- "preview": "vite preview"
42
+ "preview": "vite preview",
43
+ "build:runtime": "node scripts/build-runtime.js",
44
+ "prepack": "node scripts/build-runtime.js"
36
45
  },
37
46
  "dependencies": {
38
47
  "@codemirror/lang-python": "6.2.1",
@@ -48,8 +57,8 @@
48
57
  "nitro": "3.0.260610-beta"
49
58
  },
50
59
  "peerDependencies": {
51
- "solid-js": "1.9.14",
52
- "vite": "8.1.4"
60
+ "solid-js": "^1.9.14",
61
+ "vite": "^8.1.4"
53
62
  },
54
63
  "publishConfig": {
55
64
  "access": "public"
@@ -0,0 +1,168 @@
1
+ # pie inside another app: `@tinyvolt/pie/runtime`
2
+
3
+ [pie-ssg](https://github.com/TinyVolt/pie-ssg) builds sites from Markdown pages. Readers can run Python in a page and draw on a canvas. `@tinyvolt/pie/runtime` shows the same pages inside another app (the "host"), e.g. as a Markdown preview: the host turns pie markdown into a page with `compilePie` and shows it with `<PiePage>`.
4
+
5
+ The markdown format is the one a site uses. It is described in `node_modules/@tinyvolt/pie/init/site-agents.md`, the guide for sites. This guide covers only what differs in a host.
6
+
7
+ ## Requirements
8
+
9
+ - A Solid app built with Vite and Solid's Vite plugin (`vite-plugin-solid`; SolidStart includes it). pie ships its components with their JSX, under the `solid` export condition, and the host's Solid plugin compiles them for the browser and the server.
10
+ - `solid-js` ^1.9.14 and `vite` ^8.1.4, as the host's own dependencies. pie uses the host's copy of Solid: two copies on one page break reactivity.
11
+ - No other setup: no aliases, `optimizeDeps` or `ssr.noExternal` settings for pie.
12
+
13
+ ```sh
14
+ npm install @tinyvolt/pie
15
+ ```
16
+
17
+ Installing changes none of the host's files.
18
+
19
+ ## A preview
20
+
21
+ ```tsx
22
+ import { createSignal, ErrorBoundary, Show } from 'solid-js';
23
+ import { compilePie, PiePage, type Page } from '@tinyvolt/pie/runtime';
24
+ import '@tinyvolt/pie/runtime.css';
25
+
26
+ export default function Preview() {
27
+ const [text, setText] = createSignal('# Hello\n\n$x^2$');
28
+ const [page, setPage] = createSignal<Page>();
29
+ const [error, setError] = createSignal('');
30
+
31
+ const preview = () => {
32
+ try {
33
+ setPage(compilePie(text()));
34
+ setError('');
35
+ } catch (e) {
36
+ setError((e as Error).message);
37
+ }
38
+ };
39
+
40
+ return (
41
+ <>
42
+ <textarea value={text()} onInput={e => setText(e.currentTarget.value)} />
43
+ <button onClick={preview}>Preview</button>
44
+ <p>{error()}</p>
45
+ <div style={{ height: '80vh' }}>
46
+ <Show when={page()}>
47
+ {page => (
48
+ <ErrorBoundary fallback={err => <p>{err.message}</p>}>
49
+ <PiePage page={page()} />
50
+ </ErrorBoundary>
51
+ )}
52
+ </Show>
53
+ </div>
54
+ </>
55
+ );
56
+ }
57
+ ```
58
+
59
+ ## `compilePie(markdown, options?)`
60
+
61
+ Turns pie markdown into a `Page`, as a site build would: `{ frontmatter, html, features }`. Runs in the browser or on a server.
62
+
63
+ - It throws an `Error` with the message a site build gives, e.g. ``page.md: `canvas` must be one of left, right, top, bottom, none, got "middle"``.
64
+ - `options.file`: the page's name in those messages. Default `page.md`.
65
+ - `options.site`: what a site's `site.yml` gives: the value of `sidebar`, `toc` and `glossary` for a page that leaves the key out, e.g. `{ toc: true }`. An error about one of these values names `site.yml`.
66
+ - `options.readFile(path)`: returns the text of another `.md` file, for `sidebar: _topics.md` and `glossary: _terms.md`. `path` is exactly as the page or `site` wrote it. Its frontmatter is ignored. Without `readFile`, such a page throws `file _topics.md does not exist`.
67
+ - Tags show as plain text, not links: a host has no tag pages.
68
+
69
+ ## `<PiePage page modules? css? />`
70
+
71
+ Shows a `Page` as a pie site shows it: the text, the canvas on the side `canvas:` names, and the toc, sidebar, glossary and tags. It shows only the page: not a site's header, and it doesn't set the browser tab's title.
72
+
73
+ - It renders a `<div class="pie-page">` that fills its parent. Give the parent a height. The text and the canvas scroll inside it.
74
+ - A new `page`, `modules` or `css` starts a fresh canvas and fresh Python variables, as opening another page in a site does.
75
+ - `modules`: the host's own functions, node types and UIs. See below.
76
+ - `css`: CSS like a site's `styles/*.css`, limited to the page. E.g. `h1 { color: crimson; }` styles only the page's headings. It is removed with the page, or when `css` changes.
77
+ - Only one `PiePage` can be mounted at a time, because custom code is global. Mounting a second throws `Only one PiePage can be mounted at a time`.
78
+ - It renders on the server too. Python, the canvas's drawing and the UIs need the browser, and `modules` is used only there.
79
+ - Python runs in a web worker with Pyodide, loaded from `https://cdn.jsdelivr.net/pyodide/`. A host with a Content-Security-Policy must allow `cdn.jsdelivr.net` in `script-src` and `connect-src`, and `'wasm-unsafe-eval'` in `script-src`.
80
+
81
+ ## `runPage(page, options?)`
82
+
83
+ Runs a `Page`'s `python-editor` blocks in order, as a reader clicking Run on each would, without showing the page. Use it to check a page's Python before showing it, e.g. a page an agent wrote. Added in 0.11.0.
84
+
85
+ ```ts
86
+ import { compilePie, runPage } from '@tinyvolt/pie/runtime';
87
+
88
+ const results = await runPage(compilePie(markdown));
89
+ const failed = results.find(r => r.error !== undefined);
90
+ ```
91
+
92
+ - It returns one `{ output, error? }` per block that ran: what the block printed, and its error, e.g. a Python traceback. `error` is unset for a block that ran without one.
93
+ - It stops at the first block with an error, which is the last entry. Later blocks don't run and have no entry.
94
+ - The blocks share Python variables, as on a page. `pie.*` calls work, on a canvas that isn't shown.
95
+ - `pie.ui.*` calls are checked as on a page: an unknown UI or a missing node raises in Python. The UIs aren't drawn, so an error a UI shows in its own place, like `pie.ui.slider` given a Point, isn't caught. Figures from `plt.show()` are dropped.
96
+ - Animated calls (`animate=True`) take half a second each, as on a page. In a tab that isn't visible, they wait until it is.
97
+ - `options.timeoutMs`: stop after this many milliseconds in total, including loading Pyodide. Default 30000. The running block's error is then `Timed out after 30 s`, with the number of seconds given.
98
+ - `options.modules`: as `<PiePage modules>`. While a `PiePage` is mounted, they must be the same files with the same exports as its `modules`, or `runPage` rejects with `runPage: modules differ from the open PiePage's`. A `PiePage` with other `modules`, mounted while `runPage` runs, throws `PiePage: modules differ from a running runPage's`. A name used twice rejects, as it makes `PiePage` throw.
99
+ - It runs in its own Python worker, so a mounted `PiePage` keeps its variables and is not slowed down. Each call loads Pyodide again, which takes a few seconds. Packages a block imports, like numpy, load on first use in each call.
100
+ - When it ends, its Python variables, nodes and worker are gone.
101
+ - Browser only: it needs `Worker` and `DOMParser`.
102
+
103
+ ## Your own functions, node types and UIs: `modules`
104
+
105
+ A site keeps these in its `functions/`, `nodes/` and `ui/` folders. A host keeps them in its own files and passes them in:
106
+
107
+ ```tsx
108
+ import * as squareFns from './pie/square';
109
+ import * as squareNodes from './pie/squareNode';
110
+ import * as stepperUi from './pie/stepper';
111
+
112
+ <PiePage
113
+ page={page()}
114
+ modules={{
115
+ functions: [{ file: 'pie/square.ts', exports: squareFns }],
116
+ nodes: [{ file: 'pie/squareNode.tsx', exports: squareNodes }],
117
+ ui: [{ file: 'pie/stepper.tsx', exports: stepperUi }],
118
+ }}
119
+ />
120
+ ```
121
+
122
+ - `exports`: a module's exports, what `import * as m from '...'` gives. `file`: its name in error messages.
123
+ - Each kind takes the exports a site's folder takes: `Node2NodeFunc`s and `SideEffectFunc`s for `functions`, `NodeDefinition`s for `nodes`, and PascalCase components for `ui` (`MatrixProduct` is `pie.ui.matrix_product`). Other exports are ignored.
124
+ - The built-in functions, node types and UIs are always there. A name used twice, by two modules or by a module and a built-in, makes `PiePage` throw, e.g. `Duplicate function keyword 'square': pie/a.ts and pie/b.ts`. Wrap it in an `<ErrorBoundary>` to show the message.
125
+ - After the page goes, its modules' names are gone: `pie.square(...)` raises `Unknown function: square`.
126
+
127
+ Write them as `init/site-agents.md` describes, under "Your own functions", "Your own node types" and "Your own UIs", with one change: import from `@tinyvolt/pie/runtime` instead of `~/lib/...`. A site's file moves into a host by changing only those import lines.
128
+
129
+ ```ts
130
+ import { add, div, ref, scalar, type AnyNode, type Node2NodeFunc, type PointNode } from '@tinyvolt/pie/runtime';
131
+ ```
132
+
133
+ `@tinyvolt/pie/runtime` exports:
134
+
135
+ - Math on node values: everything in a site's `~/lib/nodes/jax` (`num`, `scalar`, `ref`, `add`, `sub`, `mul`, `div`, `sqrt`, `sin`, `cos`, `atan2`, …).
136
+ - Node types: `Node`, `AnyNode`, `NodeType`, `NodeTypeMap`, `NodeDefinition`, and each built-in node: `TextNode`, `PointNode`, `ScalarNode`, `TriangleNode`, `LineNode`, `CircleNode`, `EllipseNode`, `BezierQuadraticNode`, `BezierCubicNode`, `ArcNode`, `PointGradNode`, `ArrayNode`, `DummyNode`.
137
+ - Functions: `Node2NodeFunc`, `SideEffectFunc`, `ParameterDefinition`, `NodeStore` (what a `SideEffectFunc`'s `run` gets) and `Track` (what an animated one returns).
138
+ - UIs: `expectNode`, `useSetNode`, `UiArg`, `NodeHandle`.
139
+
140
+ A node type adds itself to `NodeTypeMap` on `@tinyvolt/pie/runtime`, not on `~/lib/nodes/state/Node`:
141
+
142
+ ```ts
143
+ declare module '@tinyvolt/pie/runtime' {
144
+ interface NodeTypeMap {
145
+ Square: SquareNode;
146
+ }
147
+ }
148
+ ```
149
+
150
+ ## Styles: `@tinyvolt/pie/runtime.css`
151
+
152
+ Import it once: `import '@tinyvolt/pie/runtime.css'`. It also needs KaTeX's CSS, which `PiePage` imports itself.
153
+
154
+ - Every rule is limited to `.pie-page`, so it styles nothing else in the host.
155
+ - The host's rules for bare elements, like `main` or a `* { margin: 0; padding: 0 }` reset, lose to pie's rules for the same properties. pie also sets the list padding and heading margins a reset removes.
156
+ - A property pie doesn't set, or a host rule with a class or id, can still reach into the page, e.g. `button { text-transform: uppercase }`.
157
+ - To restyle the page, set the variables of a site's `styles/theme.css` on `.pie-page`, e.g. `.pie-page { --color-text: #222; --content-width: 50rem; }`: colors (`--color-text`, `--color-bg`, `--color-muted`, `--color-subtle`, `--color-hover`, `--color-border`, `--color-border-hover`, `--color-code-bg`, `--color-error`, `--color-backdrop`), fonts (`--font-ui`, `--font-body`, `--font-mono`, `--font-size-body`, `--line-height`) and layout (`--content-width`, `--sidebar-width`, `--sidebar-drawer-below`).
158
+ - Or add rules that start with `.pie-page`, in CSS loaded after `runtime.css`, e.g. `.pie-page main h1 { color: crimson; }`, or pass them as `css`. The class names are under "Styles" in `init/site-agents.md`.
159
+
160
+ ## What differs from a site
161
+
162
+ - There is no `pages/` folder and no URLs: the host passes the markdown to `compilePie`.
163
+ - `site.yml` is `compilePie`'s `site` option. Its `title`, `url` and `description` don't apply.
164
+ - `sidebar` and `glossary` files come from `readFile`.
165
+ - Tags are plain text, and there are no `/_tags` pages.
166
+ - Links in a page or its sidebar are ordinary links in the host, e.g. `[Home](/)` opens the host's `/`.
167
+ - A site's build checks are errors instead: bad frontmatter, a missing `sidebar` or `glossary` file and an unknown `[[term]]` from `compilePie`; a name used twice from `PiePage`.
168
+ - `layouts/`, `public/` and the site's header don't apply.