@zvndev/darkmown 2.10.1 → 2.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.
- package/AGENTS.md +4 -2
- package/CHANGELOG.md +7 -0
- package/README.md +35 -1
- package/docs/cli.md +19 -0
- package/docs/errors.md +255 -0
- package/docs/spec-alignment.md +5 -0
- package/package.json +2 -1
- package/site/pages/docs/index.wd +6 -1
- package/site/pages/index.wd +1 -0
- package/site/pages/playground/index.js +28 -27
- package/src/builder.js +118 -11
- package/src/catalog.js +6 -0
- package/src/cli.js +35 -0
- package/src/compiler/page.js +16 -4
- package/src/compiler.js +1 -1
- package/src/mcp-tools.js +354 -0
- package/src/mcp.js +287 -0
- package/src/statics.js +1 -0
- package/types/builder.d.ts +5 -0
- package/types/compiler/page.d.ts +12 -3
- package/types/compiler.d.ts +4 -1
package/types/compiler/page.d.ts
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* Compile a page source file into a full HTML document plus its assets.
|
|
3
3
|
* @param {string} file Absolute path to the source `.md`/`.wd` file.
|
|
4
4
|
* @param {Paths} context Resolved project paths.
|
|
5
|
-
* @param {{ feed?: { href: string, title: string }, site?: SiteContext, collections?: Map<string, import("./collections.js").CollectionRow[]>, vars?: Record<string, unknown>, reader?: import("./reader.js").Reader, imageVariants?: Map<string, number[]> | null }} [options]
|
|
5
|
+
* @param {{ feed?: { href: string, title: string }, mdSource?: { href: string }, site?: SiteContext, collections?: Map<string, import("./collections.js").CollectionRow[]>, vars?: Record<string, unknown>, reader?: import("./reader.js").Reader, imageVariants?: Map<string, number[]> | null }} [options]
|
|
6
6
|
* When a site-wide RSS feed is emitted (the home page set `site_url` and the
|
|
7
7
|
* site has dated posts), `feed` carries its absolute href + title so every page
|
|
8
|
-
* links it.
|
|
8
|
+
* links it. When the site publishes markdown sources (the home page set
|
|
9
|
+
* `md_source: true` and this page did not opt out), `mdSource` carries the
|
|
10
|
+
* page's own `<route>.md` href for the alternate link. `site` carries the
|
|
11
|
+
* origin + this page's own route (and its resolved
|
|
9
12
|
* breadcrumb trail) so the shell can state a canonical URL. `collections` is the
|
|
10
13
|
* build-time collection index a bare-name `@loop` resolves against; `vars` seeds
|
|
11
14
|
* the document scope (the pager `page` object on a paginated route). `reader` is
|
|
@@ -19,6 +22,9 @@ export function compilePage(file: string, context: Paths, options?: {
|
|
|
19
22
|
href: string;
|
|
20
23
|
title: string;
|
|
21
24
|
};
|
|
25
|
+
mdSource?: {
|
|
26
|
+
href: string;
|
|
27
|
+
};
|
|
22
28
|
site?: SiteContext;
|
|
23
29
|
collections?: Map<string, import("./collections.js").CollectionRow[]>;
|
|
24
30
|
vars?: Record<string, unknown>;
|
|
@@ -103,7 +109,7 @@ export function foldBuildBindings(text: string, now?: Date): string;
|
|
|
103
109
|
* @param {Record<string, string> | Map<string, string>} files Project-relative
|
|
104
110
|
* path → source content.
|
|
105
111
|
* @param {string} entryPath Project-relative path of the page to compile.
|
|
106
|
-
* @param {{ feed?: { href: string, title: string }, site?: SiteContext, collections?: Map<string, import("./collections.js").CollectionRow[]>, vars?: Record<string, unknown>, cwd?: string }} [options]
|
|
112
|
+
* @param {{ feed?: { href: string, title: string }, mdSource?: { href: string }, site?: SiteContext, collections?: Map<string, import("./collections.js").CollectionRow[]>, vars?: Record<string, unknown>, cwd?: string }} [options]
|
|
107
113
|
* Same shell options as {@link compilePage}; `cwd` overrides the virtual
|
|
108
114
|
* project root the relative keys resolve against (defaults to `/`).
|
|
109
115
|
* @returns {CompiledPage}
|
|
@@ -113,6 +119,9 @@ export function compileFromMemory(files: Record<string, string> | Map<string, st
|
|
|
113
119
|
href: string;
|
|
114
120
|
title: string;
|
|
115
121
|
};
|
|
122
|
+
mdSource?: {
|
|
123
|
+
href: string;
|
|
124
|
+
};
|
|
116
125
|
site?: SiteContext;
|
|
117
126
|
collections?: Map<string, import("./collections.js").CollectionRow[]>;
|
|
118
127
|
vars?: Record<string, unknown>;
|
package/types/compiler.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* a different source (see `compileFromMemory`).
|
|
5
5
|
* @param {string} file Absolute path to the source `.md`/`.wd` file.
|
|
6
6
|
* @param {import("./config.js").Paths} context Resolved project paths.
|
|
7
|
-
* @param {{ feed?: { href: string, title: string }, site?: import("./compiler/page.js").SiteContext, collections?: Map<string, import("./compiler/collections.js").CollectionRow[]>, vars?: Record<string, unknown>, reader?: import("./compiler/reader.js").Reader, imageVariants?: Map<string, number[]> | null }} [options]
|
|
7
|
+
* @param {{ feed?: { href: string, title: string }, mdSource?: { href: string }, site?: import("./compiler/page.js").SiteContext, collections?: Map<string, import("./compiler/collections.js").CollectionRow[]>, vars?: Record<string, unknown>, reader?: import("./compiler/reader.js").Reader, imageVariants?: Map<string, number[]> | null }} [options]
|
|
8
8
|
* @returns {CompiledPage}
|
|
9
9
|
*/
|
|
10
10
|
export function compilePage(file: string, context: import("./config.js").Paths, options?: {
|
|
@@ -12,6 +12,9 @@ export function compilePage(file: string, context: import("./config.js").Paths,
|
|
|
12
12
|
href: string;
|
|
13
13
|
title: string;
|
|
14
14
|
};
|
|
15
|
+
mdSource?: {
|
|
16
|
+
href: string;
|
|
17
|
+
};
|
|
15
18
|
site?: import("./compiler/page.js").SiteContext;
|
|
16
19
|
collections?: Map<string, import("./compiler/collections.js").CollectionRow[]>;
|
|
17
20
|
vars?: Record<string, unknown>;
|