@bendyline/docblocks 2.7.7 → 2.7.9

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 (32) hide show
  1. package/THIRD_PARTY_NOTICES.txt +7 -7
  2. package/dist/{capabilities-D4Z1xYZV.d.ts → capabilities-CH66e2pR.d.ts} +187 -13
  3. package/dist/{catalog-BQK05tne.d.ts → catalog-BmEXHaZf.d.ts} +30 -4
  4. package/dist/{chunk-5VEIEFFC.js → chunk-CI3DHDPG.js} +1 -1
  5. package/dist/{chunk-FIEMYP2N.js → chunk-D7VUEVAX.js} +10 -1
  6. package/dist/{chunk-R2JX5N3F.js → chunk-L7HADBCQ.js} +49 -0
  7. package/dist/{chunk-66WTIYYG.js → chunk-LP6JHGBP.js} +2 -2
  8. package/dist/{chunk-BC42VRYW.js → chunk-PQBUG5DY.js} +49 -7
  9. package/dist/{chunk-RFEB4N5Q.js → chunk-WE5W7BRL.js} +299 -8
  10. package/dist/{chunk-NECMAJHS.js → chunk-ZBRXXOW5.js} +1 -1
  11. package/dist/document/index.d.ts +3 -0
  12. package/dist/document/index.js +1 -1
  13. package/dist/filesystem/electron.d.ts +1 -1
  14. package/dist/filesystem/electron.js +3 -3
  15. package/dist/filesystem/host.js +2 -2
  16. package/dist/filesystem/index.d.ts +1 -1
  17. package/dist/filesystem/index.js +5 -5
  18. package/dist/host/index.d.ts +3 -2
  19. package/dist/host/index.js +29 -1
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +33 -5
  22. package/dist/mcp/zod.d.ts +542 -542
  23. package/dist/{reconcile-electron-DuwLsuic.d.ts → reconcile-electron-BcwJ7z5Z.d.ts} +1 -1
  24. package/dist/{settings-HrrCikVX.d.ts → settings-C-TS15JZ.d.ts} +28 -2
  25. package/dist/vscode/index.d.ts +1 -1
  26. package/dist/vscode/index.js +1 -1
  27. package/dist/workspace/index.d.ts +2 -2
  28. package/dist/workspace-index/index.d.ts +2 -2
  29. package/dist/workspace-index/index.js +1 -1
  30. package/dist/workspace-settings/index.d.ts +26 -5
  31. package/dist/workspace-settings/index.js +42 -7
  32. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { d as FileSystemProvider } from './types-DLteNrK0.js';
2
- import { a4 as ElectronWorkspaceInfo, aq as HostEnvironment } from './capabilities-D4Z1xYZV.js';
2
+ import { al as ElectronWorkspaceInfo, aH as HostEnvironment } from './capabilities-CH66e2pR.js';
3
3
 
4
4
  /**
5
5
  * Origin of a transient workspace — records where its contents came from and
@@ -32,9 +32,22 @@ declare const CATALOG_SORT_ORDERS: readonly ["title", "path", "date"];
32
32
  type CatalogSortOrder = (typeof CATALOG_SORT_ORDERS)[number];
33
33
  declare const CATALOG_JSON_CONTENT_MODES: readonly ["metadata", "markdown"];
34
34
  type CatalogJsonContent = (typeof CATALOG_JSON_CONTENT_MODES)[number];
35
+ /** Rendered formats a workspace can name a default page template for. */
36
+ declare const WORKSPACE_OUTPUT_TEMPLATE_FORMATS: readonly ["html"];
37
+ type WorkspaceOutputTemplateFormat = (typeof WORKSPACE_OUTPUT_TEMPLATE_FORMATS)[number];
38
+ /** Workspace-relative page template path, by rendered output format. */
39
+ type WorkspaceOutputTemplates = {
40
+ readonly [Format in WorkspaceOutputTemplateFormat]?: string;
41
+ };
35
42
  interface WorkspaceDocumentSettings {
36
43
  /** Theme for documents whose frontmatter names none. */
37
44
  readonly defaultTheme?: string;
45
+ /**
46
+ * Page template for rendered documents whose frontmatter names none
47
+ * (`squisq-output-template`). A document's own choice, including `none`,
48
+ * always wins.
49
+ */
50
+ readonly outputTemplates?: WorkspaceOutputTemplates;
38
51
  }
39
52
  interface WorkspaceVersionHistorySettings {
40
53
  /** Absent inherits the app-wide preference. */
@@ -76,6 +89,16 @@ type WorkspaceSettingsParseResult = {
76
89
  readonly status: 'invalid' | 'unsupported-version';
77
90
  readonly message: string;
78
91
  };
92
+ /** Validate a configured page template path for one rendered format. */
93
+ declare function validateOutputTemplatePath(value: unknown, format: WorkspaceOutputTemplateFormat): WorkspacePath;
94
+ /** Try-form for UI validation messages. */
95
+ declare function checkOutputTemplatePath(value: unknown, format: WorkspaceOutputTemplateFormat): {
96
+ ok: true;
97
+ path: WorkspacePath;
98
+ } | {
99
+ ok: false;
100
+ message: string;
101
+ };
79
102
  type CatalogOutputKind = 'html' | 'json';
80
103
  /**
81
104
  * Validate a configured catalog output path. Outputs may never land inside
@@ -135,7 +158,8 @@ declare function tryApplyWorkspaceSettingsPatch(base: WorkspaceSettings | null,
135
158
  };
136
159
  /**
137
160
  * True when settings change nothing about how DocBlocks treats the folder: no
138
- * default theme, no version-history choice, and no catalog output turned on.
161
+ * default theme or page template, no version-history choice, and no catalog
162
+ * output turned on.
139
163
  * Fields that only configure a disabled output (a catalog title, path, order,
140
164
  * or page theme) are inert. Such settings are never worth creating a
141
165
  * `.docblocks/` folder for.
@@ -143,6 +167,8 @@ declare function tryApplyWorkspaceSettingsPatch(base: WorkspaceSettings | null,
143
167
  declare function isDefaultWorkspaceSettings(settings: WorkspaceSettings | null | undefined): boolean;
144
168
  /** The workspace default theme, or undefined to use the built-in default. */
145
169
  declare function resolveWorkspaceDefaultThemeId(settings: WorkspaceSettings | null | undefined): string | undefined;
170
+ /** The workspace default page template for a rendered format, workspace-relative. */
171
+ declare function resolveWorkspaceOutputTemplate(settings: WorkspaceSettings | null | undefined, format: string): string | undefined;
146
172
  /**
147
173
  * The theme a renderer should be told about explicitly. Every Squisq
148
174
  * exporter lets an explicit theme beat the document's own frontmatter, so a
@@ -167,4 +193,4 @@ interface ResolvedCatalogOutputs {
167
193
  /** Effective catalog configuration, or null when no output is enabled. */
168
194
  declare function resolveCatalogOutputs(settings: WorkspaceSettings | null | undefined): ResolvedCatalogOutputs | null;
169
195
 
170
- export { resolveCatalogOutputs as A, resolveFallbackThemeId as B, type CatalogSortOrder as C, DEFAULT_CATALOG_HTML_PATH as D, EMPTY_WORKSPACE_SETTINGS as E, resolveWorkspaceDefaultThemeId as F, resolveWorkspaceVersioningEnabled as G, serializeWorkspaceSettings as H, tryApplyWorkspaceSettingsPatch as I, validateCatalogOutputPath as J, type ResolvedCatalogOutputs as R, UnsupportedWorkspaceSettingsVersionError as U, type WorkspaceSettings as W, type WorkspaceSettingsPatch as a, CATALOG_JSON_CONTENT_MODES as b, CATALOG_SORT_ORDERS as c, type CatalogJsonContent as d, type CatalogOutputKind as e, DEFAULT_CATALOG_JSON_PATH as f, DEFAULT_CATALOG_TITLE as g, WORKSPACE_SETTINGS_DIRECTORY as h, WORKSPACE_SETTINGS_LIMITS as i, WORKSPACE_SETTINGS_PATH as j, WORKSPACE_SETTINGS_VERSION as k, WORKSPACE_THEME_ID_PATTERN as l, type WorkspaceCatalogHtmlSettings as m, type WorkspaceCatalogJsonSettings as n, type WorkspaceCatalogSettings as o, type WorkspaceDocumentSettings as p, type WorkspaceSettingsParseResult as q, type WorkspaceVersionHistorySettings as r, applyWorkspaceSettingsPatch as s, checkCatalogOutputPath as t, diffWorkspaceSettings as u, isDefaultWorkspaceSettings as v, isEmptyWorkspaceSettingsPatch as w, parseWorkspaceSettings as x, parseWorkspaceSettingsPatch as y, parseWorkspaceSettingsText as z };
196
+ export { isEmptyWorkspaceSettingsPatch as A, parseWorkspaceSettings as B, type CatalogSortOrder as C, DEFAULT_CATALOG_HTML_PATH as D, EMPTY_WORKSPACE_SETTINGS as E, parseWorkspaceSettingsPatch as F, parseWorkspaceSettingsText as G, resolveCatalogOutputs as H, resolveFallbackThemeId as I, resolveWorkspaceDefaultThemeId as J, resolveWorkspaceOutputTemplate as K, resolveWorkspaceVersioningEnabled as L, serializeWorkspaceSettings as M, tryApplyWorkspaceSettingsPatch as N, validateCatalogOutputPath as O, validateOutputTemplatePath as P, type ResolvedCatalogOutputs as R, UnsupportedWorkspaceSettingsVersionError as U, type WorkspaceSettings as W, type WorkspaceSettingsPatch as a, CATALOG_JSON_CONTENT_MODES as b, CATALOG_SORT_ORDERS as c, type CatalogJsonContent as d, type CatalogOutputKind as e, DEFAULT_CATALOG_JSON_PATH as f, DEFAULT_CATALOG_TITLE as g, WORKSPACE_OUTPUT_TEMPLATE_FORMATS as h, WORKSPACE_SETTINGS_DIRECTORY as i, WORKSPACE_SETTINGS_LIMITS as j, WORKSPACE_SETTINGS_PATH as k, WORKSPACE_SETTINGS_VERSION as l, WORKSPACE_THEME_ID_PATTERN as m, type WorkspaceCatalogHtmlSettings as n, type WorkspaceCatalogJsonSettings as o, type WorkspaceCatalogSettings as p, type WorkspaceDocumentSettings as q, type WorkspaceOutputTemplateFormat as r, type WorkspaceOutputTemplates as s, type WorkspaceSettingsParseResult as t, type WorkspaceVersionHistorySettings as u, applyWorkspaceSettingsPatch as v, checkCatalogOutputPath as w, checkOutputTemplatePath as x, diffWorkspaceSettings as y, isDefaultWorkspaceSettings as z };
@@ -1,4 +1,4 @@
1
- import { W as WorkspaceSettings, a as WorkspaceSettingsPatch } from '../settings-HrrCikVX.js';
1
+ import { W as WorkspaceSettings, a as WorkspaceSettingsPatch } from '../settings-C-TS15JZ.js';
2
2
  import '../workspace-path-CWVrcuPL.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parseWorkspaceSettings,
3
3
  parseWorkspaceSettingsPatch
4
- } from "../chunk-BC42VRYW.js";
4
+ } from "../chunk-PQBUG5DY.js";
5
5
  import {
6
6
  HOST_WIRE_LIMITS,
7
7
  isBoundedString
@@ -1,9 +1,9 @@
1
- export { D as DEFAULT_WORKSPACE_ID, E as ElectronWorkspaceReconciliation, T as TransientOrigin, W as WorkspaceDescriptor, e as ensureDefaultWorkspace, g as getTransientWorkspace, a as getWorkspace, l as listWorkspaces, p as parsePersistedWorkspaceList, r as reconcileElectronWorkspaceDescriptors, b as registerTransientWorkspace, c as removeWorkspace, s as saveWorkspace, t as touchWorkspace, u as unregisterTransientWorkspace } from '../reconcile-electron-DuwLsuic.js';
1
+ export { D as DEFAULT_WORKSPACE_ID, E as ElectronWorkspaceReconciliation, T as TransientOrigin, W as WorkspaceDescriptor, e as ensureDefaultWorkspace, g as getTransientWorkspace, a as getWorkspace, l as listWorkspaces, p as parsePersistedWorkspaceList, r as reconcileElectronWorkspaceDescriptors, b as registerTransientWorkspace, c as removeWorkspace, s as saveWorkspace, t as touchWorkspace, u as unregisterTransientWorkspace } from '../reconcile-electron-BcwJ7z5Z.js';
2
2
  import { ContentContainer } from '@bendyline/squisq/storage';
3
3
  import { o as FileSystemProviderV2 } from '../v2-DwxWjFC0.js';
4
4
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
5
5
  import '../types-DLteNrK0.js';
6
- import '../capabilities-D4Z1xYZV.js';
6
+ import '../capabilities-CH66e2pR.js';
7
7
  import '../filesystem-v2-CXdAPR27.js';
8
8
 
9
9
  declare const WORKSPACE_BACKUP_MANIFEST = "docblocks-backup.json";
@@ -1,8 +1,8 @@
1
1
  import { o as FileSystemProviderV2, n as FileSystemProviderCapabilities } from '../v2-DwxWjFC0.js';
2
2
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
- import { d as CatalogDocumentFormat, f as CatalogOutlineEntry } from '../catalog-BQK05tne.js';
3
+ import { e as CatalogDocumentFormat, g as CatalogOutlineEntry } from '../catalog-BmEXHaZf.js';
4
4
  import '@bendyline/squisq/markdown';
5
- import '../settings-HrrCikVX.js';
5
+ import '../settings-C-TS15JZ.js';
6
6
 
7
7
  /**
8
8
  * What the index reads from. Only read methods are reachable, so the index
@@ -3,7 +3,7 @@ import {
3
3
  chooseOutsideInMarkdownPath,
4
4
  normalizeLineEndings,
5
5
  resolveOutsideInLayout
6
- } from "../chunk-R2JX5N3F.js";
6
+ } from "../chunk-L7HADBCQ.js";
7
7
  import {
8
8
  isCompanionDirectoryName,
9
9
  isDiscoverableWorkspaceEntry,
@@ -1,7 +1,7 @@
1
- import { R as ResolvedCatalogOutputs, W as WorkspaceSettings, a as WorkspaceSettingsPatch } from '../settings-HrrCikVX.js';
2
- export { b as CATALOG_JSON_CONTENT_MODES, c as CATALOG_SORT_ORDERS, d as CatalogJsonContent, e as CatalogOutputKind, C as CatalogSortOrder, D as DEFAULT_CATALOG_HTML_PATH, f as DEFAULT_CATALOG_JSON_PATH, g as DEFAULT_CATALOG_TITLE, E as EMPTY_WORKSPACE_SETTINGS, U as UnsupportedWorkspaceSettingsVersionError, h as WORKSPACE_SETTINGS_DIRECTORY, i as WORKSPACE_SETTINGS_LIMITS, j as WORKSPACE_SETTINGS_PATH, k as WORKSPACE_SETTINGS_VERSION, l as WORKSPACE_THEME_ID_PATTERN, m as WorkspaceCatalogHtmlSettings, n as WorkspaceCatalogJsonSettings, o as WorkspaceCatalogSettings, p as WorkspaceDocumentSettings, q as WorkspaceSettingsParseResult, r as WorkspaceVersionHistorySettings, s as applyWorkspaceSettingsPatch, t as checkCatalogOutputPath, u as diffWorkspaceSettings, v as isDefaultWorkspaceSettings, w as isEmptyWorkspaceSettingsPatch, x as parseWorkspaceSettings, y as parseWorkspaceSettingsPatch, z as parseWorkspaceSettingsText, A as resolveCatalogOutputs, B as resolveFallbackThemeId, F as resolveWorkspaceDefaultThemeId, G as resolveWorkspaceVersioningEnabled, H as serializeWorkspaceSettings, I as tryApplyWorkspaceSettingsPatch, J as validateCatalogOutputPath } from '../settings-HrrCikVX.js';
3
- import { C as CatalogEntry, W as WorkspaceCatalog } from '../catalog-BQK05tne.js';
4
- export { a as CATALOG_FORMAT_VERSION, b as CATALOG_GENERATOR, c as CATALOG_LIMITS, d as CatalogDocumentFormat, e as CatalogEntryHints, f as CatalogOutlineEntry, g as CatalogSource, O as OUTSIDE_IN_FORMAT_IDS, h as OutsideInFormatId, i as OutsideInLayout, j as buildCatalogMarkdownDocument, k as catalogEntryForUnreadable, l as catalogEntryFromDocument, m as catalogEntryFromMarkdown, n as chooseOutsideInMarkdownPath, o as createWorkspaceCatalog, p as isGeneratedCatalogHtml, q as isGeneratedCatalogJson, r as readCatalogHtmlDigest, s as relativeCatalogLink, t as relocateOutsideInLayout, u as resolveOutsideInLayout, v as serializeCatalogJson, w as sortCatalogEntries, x as stampCatalogHtml } from '../catalog-BQK05tne.js';
1
+ import { R as ResolvedCatalogOutputs, W as WorkspaceSettings, a as WorkspaceSettingsPatch } from '../settings-C-TS15JZ.js';
2
+ export { b as CATALOG_JSON_CONTENT_MODES, c as CATALOG_SORT_ORDERS, d as CatalogJsonContent, e as CatalogOutputKind, C as CatalogSortOrder, D as DEFAULT_CATALOG_HTML_PATH, f as DEFAULT_CATALOG_JSON_PATH, g as DEFAULT_CATALOG_TITLE, E as EMPTY_WORKSPACE_SETTINGS, U as UnsupportedWorkspaceSettingsVersionError, h as WORKSPACE_OUTPUT_TEMPLATE_FORMATS, i as WORKSPACE_SETTINGS_DIRECTORY, j as WORKSPACE_SETTINGS_LIMITS, k as WORKSPACE_SETTINGS_PATH, l as WORKSPACE_SETTINGS_VERSION, m as WORKSPACE_THEME_ID_PATTERN, n as WorkspaceCatalogHtmlSettings, o as WorkspaceCatalogJsonSettings, p as WorkspaceCatalogSettings, q as WorkspaceDocumentSettings, r as WorkspaceOutputTemplateFormat, s as WorkspaceOutputTemplates, t as WorkspaceSettingsParseResult, u as WorkspaceVersionHistorySettings, v as applyWorkspaceSettingsPatch, w as checkCatalogOutputPath, x as checkOutputTemplatePath, y as diffWorkspaceSettings, z as isDefaultWorkspaceSettings, A as isEmptyWorkspaceSettingsPatch, B as parseWorkspaceSettings, F as parseWorkspaceSettingsPatch, G as parseWorkspaceSettingsText, H as resolveCatalogOutputs, I as resolveFallbackThemeId, J as resolveWorkspaceDefaultThemeId, K as resolveWorkspaceOutputTemplate, L as resolveWorkspaceVersioningEnabled, M as serializeWorkspaceSettings, N as tryApplyWorkspaceSettingsPatch, O as validateCatalogOutputPath, P as validateOutputTemplatePath } from '../settings-C-TS15JZ.js';
3
+ import { C as CatalogEntry, W as WorkspaceCatalog } from '../catalog-BmEXHaZf.js';
4
+ export { a as CATALOG_FORMAT_VERSION, b as CATALOG_GENERATOR, c as CATALOG_LIMITS, d as CatalogDateRecord, e as CatalogDocumentFormat, f as CatalogEntryHints, g as CatalogOutlineEntry, h as CatalogSource, O as OUTSIDE_IN_FORMAT_IDS, i as OutsideInFormatId, j as OutsideInLayout, k as buildCatalogMarkdownDocument, l as catalogEntryForUnreadable, m as catalogEntryFromDocument, n as catalogEntryFromMarkdown, o as chooseOutsideInMarkdownPath, p as createWorkspaceCatalog, q as isGeneratedCatalogHtml, r as isGeneratedCatalogJson, s as readCatalogDateHistory, t as readCatalogHtmlDigest, u as relativeCatalogLink, v as relocateOutsideInLayout, w as resolveOutsideInLayout, x as serializeCatalogJson, y as sortCatalogEntries, z as stampCatalogDates, A as stampCatalogHtml } from '../catalog-BmEXHaZf.js';
5
5
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
6
6
  import { v as FileSystemVersion, o as FileSystemProviderV2 } from '../v2-DwxWjFC0.js';
7
7
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
@@ -37,6 +37,20 @@ declare const WORKSPACE_SETTINGS_JSON_SCHEMA: {
37
37
  readonly type: "string";
38
38
  readonly pattern: string;
39
39
  };
40
+ readonly outputTemplates: {
41
+ readonly type: "object";
42
+ readonly additionalProperties: false;
43
+ readonly description: "Page templates for rendered documents whose frontmatter names none (squisq-output-template). A document’s own choice, including \"none\", always wins.";
44
+ readonly properties: {
45
+ readonly html: {
46
+ readonly pattern: "\\.html?$";
47
+ readonly description: "Workspace-relative HTML page template for Web pages, such as \"_templates/post.html\". Its unnamed <slot> receives the page content.";
48
+ readonly type: "string";
49
+ readonly minLength: 1;
50
+ readonly maxLength: 1024;
51
+ };
52
+ };
53
+ };
40
54
  };
41
55
  };
42
56
  readonly versionHistory: {
@@ -154,6 +168,11 @@ interface WorkspaceOutputsRenderer {
154
168
  }): string | Promise<string>;
155
169
  /** Parse rendered HTML that has no Markdown companion yet. Optional. */
156
170
  importHtml?(html: string): MarkdownDocument | Promise<MarkdownDocument>;
171
+ /**
172
+ * True for an HTML page template — the chrome other pages are generated
173
+ * through, not a document of its own — which the catalog leaves out. Optional.
174
+ */
175
+ isPageTemplate?(html: string): boolean;
157
176
  }
158
177
  declare const WORKSPACE_OUTPUT_LIMITS: {
159
178
  readonly maxDocuments: 5000;
@@ -188,6 +207,8 @@ interface RefreshWorkspaceOutputsOptions {
188
207
  /** Compute everything, write nothing. */
189
208
  readonly dryRun?: boolean;
190
209
  readonly limits?: Partial<WorkspaceOutputLimits>;
210
+ /** Time stamped on new or changed documents in the catalog JSON. Defaults to now. */
211
+ readonly now?: Date;
191
212
  }
192
213
  type WorkspaceOutputStatus = 'written' | 'unchanged' | 'blocked' | 'would-write';
193
214
  interface WorkspaceOutputResult {
@@ -211,7 +232,7 @@ declare function isCatalogRelevantPath(path: string, settings: WorkspaceSettings
211
232
  /** True for the workspace settings directory or anything inside it. */
212
233
  declare function isWorkspaceSettingsPath(path: string): boolean;
213
234
  /** Walk the workspace and build its catalog without writing anything. */
214
- declare function collectWorkspaceCatalog(io: WorkspaceOutputsIO, resolved: ResolvedCatalogOutputs, renderer: Pick<WorkspaceOutputsRenderer, 'importHtml'>, options?: Omit<RefreshWorkspaceOutputsOptions, 'force' | 'dryRun'>): Promise<WorkspaceCatalog>;
235
+ declare function collectWorkspaceCatalog(io: WorkspaceOutputsIO, resolved: ResolvedCatalogOutputs, renderer: Pick<WorkspaceOutputsRenderer, 'importHtml' | 'isPageTemplate'>, options?: Omit<RefreshWorkspaceOutputsOptions, 'force' | 'dryRun' | 'now'>): Promise<WorkspaceCatalog>;
215
236
  /**
216
237
  * Regenerate every enabled catalog output for one workspace. Throws
217
238
  * {@link WorkspaceOutputsLimitError} when over budget, `FsError('aborted')`
@@ -11,6 +11,8 @@ import {
11
11
  createWorkspaceCatalog,
12
12
  isGeneratedCatalogHtml,
13
13
  isGeneratedCatalogJson,
14
+ normalizeLineEndings,
15
+ readCatalogDateHistory,
14
16
  readCatalogHtmlDigest,
15
17
  relativeCatalogLink,
16
18
  relocateOutsideInLayout,
@@ -18,8 +20,9 @@ import {
18
20
  serializeCatalogJson,
19
21
  sha256Hex,
20
22
  sortCatalogEntries,
23
+ stampCatalogDates,
21
24
  stampCatalogHtml
22
- } from "../chunk-R2JX5N3F.js";
25
+ } from "../chunk-L7HADBCQ.js";
23
26
  import {
24
27
  CATALOG_JSON_CONTENT_MODES,
25
28
  CATALOG_SORT_ORDERS,
@@ -28,6 +31,7 @@ import {
28
31
  DEFAULT_CATALOG_TITLE,
29
32
  EMPTY_WORKSPACE_SETTINGS,
30
33
  UnsupportedWorkspaceSettingsVersionError,
34
+ WORKSPACE_OUTPUT_TEMPLATE_FORMATS,
31
35
  WORKSPACE_SETTINGS_DIRECTORY,
32
36
  WORKSPACE_SETTINGS_LIMITS,
33
37
  WORKSPACE_SETTINGS_PATH,
@@ -35,6 +39,7 @@ import {
35
39
  WORKSPACE_THEME_ID_PATTERN,
36
40
  applyWorkspaceSettingsPatch,
37
41
  checkCatalogOutputPath,
42
+ checkOutputTemplatePath,
38
43
  diffWorkspaceSettings,
39
44
  isDefaultWorkspaceSettings,
40
45
  isEmptyWorkspaceSettingsPatch,
@@ -44,11 +49,13 @@ import {
44
49
  resolveCatalogOutputs,
45
50
  resolveFallbackThemeId,
46
51
  resolveWorkspaceDefaultThemeId,
52
+ resolveWorkspaceOutputTemplate,
47
53
  resolveWorkspaceVersioningEnabled,
48
54
  serializeWorkspaceSettings,
49
55
  tryApplyWorkspaceSettingsPatch,
50
- validateCatalogOutputPath
51
- } from "../chunk-BC42VRYW.js";
56
+ validateCatalogOutputPath,
57
+ validateOutputTemplatePath
58
+ } from "../chunk-PQBUG5DY.js";
52
59
  import {
53
60
  SQUISQ_RUNTIME_DIRECTORY_NAME,
54
61
  isDiscoverableWorkspaceEntry,
@@ -92,6 +99,18 @@ var WORKSPACE_SETTINGS_JSON_SCHEMA = {
92
99
  defaultTheme: {
93
100
  ...themeId,
94
101
  description: "Theme for documents whose frontmatter does not name one. A document\u2019s own theme always wins."
102
+ },
103
+ outputTemplates: {
104
+ type: "object",
105
+ additionalProperties: false,
106
+ description: 'Page templates for rendered documents whose frontmatter names none (squisq-output-template). A document\u2019s own choice, including "none", always wins.',
107
+ properties: {
108
+ html: {
109
+ ...relativePath,
110
+ pattern: "\\.html?$",
111
+ description: 'Workspace-relative HTML page template for Web pages, such as "_templates/post.html". Its unnamed <slot> receives the page content.'
112
+ }
113
+ }
95
114
  }
96
115
  }
97
116
  },
@@ -351,7 +370,7 @@ async function collectWorkspaceCatalog(io, resolved, renderer, options = {}) {
351
370
  const text = new TextDecoder("utf-8").decode(read.data);
352
371
  if (target.mode === "markdown") {
353
372
  entry = await catalogEntryFromMarkdown(target.source, text, { includeMarkdown });
354
- } else if (isGeneratedCatalogHtml(text)) {
373
+ } else if (isGeneratedCatalogHtml(text) || renderer.isPageTemplate?.(text)) {
355
374
  entry = null;
356
375
  } else if (renderer.importHtml) {
357
376
  const head = text.slice(0, 64 * 1024);
@@ -362,6 +381,7 @@ async function collectWorkspaceCatalog(io, resolved, renderer, options = {}) {
362
381
  } else {
363
382
  entry = catalogEntryForUnreadable(target.source);
364
383
  }
384
+ if (entry) entry = { ...entry, contentHash: await sha256Hex(normalizeLineEndings(text)) };
365
385
  }
366
386
  cache?.set(target.source.path, {
367
387
  readPath: target.readPath,
@@ -426,7 +446,9 @@ async function writeOutput(io, request, limits, options) {
426
446
  return blocked(`${path} is an edited document. Choose another catalog path.`);
427
447
  }
428
448
  }
429
- const bytes = new TextEncoder().encode(await request.produce());
449
+ const bytes = new TextEncoder().encode(
450
+ await request.produce(existing ? new TextDecoder("utf-8").decode(existing.data) : null)
451
+ );
430
452
  if (bytes.byteLength > limits.maxOutputBytes) {
431
453
  return blocked(
432
454
  `The catalog would exceed ${Math.round(limits.maxOutputBytes / 1024 / 1024)} MiB and was not written.`
@@ -451,13 +473,20 @@ async function refreshWorkspaceOutputs(io, settings, renderer, options = {}) {
451
473
  if (resolved.json) {
452
474
  throwIfAborted(options.signal);
453
475
  const content = resolved.json.content;
476
+ const now = options.now ?? /* @__PURE__ */ new Date();
454
477
  outputs.push(
455
478
  await writeOutput(
456
479
  io,
457
480
  {
458
481
  kind: "json",
459
482
  path: resolved.json.path,
460
- produce: async () => serializeCatalogJson(content === "markdown" ? catalog : metadataCatalog)
483
+ produce: async (previous) => serializeCatalogJson(
484
+ stampCatalogDates(
485
+ content === "markdown" ? catalog : metadataCatalog,
486
+ readCatalogDateHistory(previous ?? ""),
487
+ now
488
+ )
489
+ )
461
490
  },
462
491
  limits,
463
492
  options
@@ -771,6 +800,7 @@ export {
771
800
  WORKSPACE_OUTPUTS_DEBOUNCE_MS,
772
801
  WORKSPACE_OUTPUTS_MAX_WAIT_MS,
773
802
  WORKSPACE_OUTPUT_LIMITS,
803
+ WORKSPACE_OUTPUT_TEMPLATE_FORMATS,
774
804
  WORKSPACE_SETTINGS_DIRECTORY,
775
805
  WORKSPACE_SETTINGS_JSON_SCHEMA,
776
806
  WORKSPACE_SETTINGS_LIMITS,
@@ -784,6 +814,7 @@ export {
784
814
  catalogEntryFromDocument,
785
815
  catalogEntryFromMarkdown,
786
816
  checkCatalogOutputPath,
817
+ checkOutputTemplatePath,
787
818
  chooseOutsideInMarkdownPath,
788
819
  collectWorkspaceCatalog,
789
820
  createWorkspaceCatalog,
@@ -800,6 +831,7 @@ export {
800
831
  parseWorkspaceSettings,
801
832
  parseWorkspaceSettingsPatch,
802
833
  parseWorkspaceSettingsText,
834
+ readCatalogDateHistory,
803
835
  readCatalogHtmlDigest,
804
836
  readWorkspaceSettings,
805
837
  refreshWorkspaceOutputs,
@@ -809,12 +841,15 @@ export {
809
841
  resolveFallbackThemeId,
810
842
  resolveOutsideInLayout,
811
843
  resolveWorkspaceDefaultThemeId,
844
+ resolveWorkspaceOutputTemplate,
812
845
  resolveWorkspaceVersioningEnabled,
813
846
  saveWorkspaceSettingsPatch,
814
847
  serializeCatalogJson,
815
848
  serializeWorkspaceSettings,
816
849
  sortCatalogEntries,
850
+ stampCatalogDates,
817
851
  stampCatalogHtml,
818
852
  tryApplyWorkspaceSettingsPatch,
819
- validateCatalogOutputPath
853
+ validateCatalogOutputPath,
854
+ validateOutputTemplatePath
820
855
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/docblocks",
3
- "version": "2.7.7",
3
+ "version": "2.7.9",
4
4
  "description": "Core data structures and filesystem abstractions for DocBlocks",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -126,7 +126,7 @@
126
126
  "typecheck": "tsc --noEmit"
127
127
  },
128
128
  "dependencies": {
129
- "@bendyline/squisq": "2.13.3",
129
+ "@bendyline/squisq": "2.13.8",
130
130
  "zod": "3.25.76"
131
131
  }
132
132
  }