docula 1.11.1 → 1.13.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/dist/docula.d.ts CHANGED
@@ -1,590 +1,620 @@
1
- import fs from 'node:fs';
2
- import http from 'node:http';
3
- export { Writr } from 'writr';
1
+ import fs from "node:fs";
2
+ import http from "node:http";
3
+ import { Writr } from "writr";
4
4
 
5
+ //#region src/console.d.ts
5
6
  declare class DoculaConsole {
6
- quiet: boolean;
7
- log(message: string): void;
8
- error(message: string): void;
9
- warn(message: string): void;
10
- success(message: string): void;
11
- info(message: string): void;
12
- step(message: string): void;
13
- fileBuilt(filePath: string): void;
14
- fileCopied(filePath: string): void;
15
- serverLog(method: string, url: string, statusCode: number, durationMs?: number): void;
16
- banner(message: string): void;
17
- printHelp(): void;
18
- parseProcessArgv(argv: string[]): DoculaConsoleProcess;
19
- getCommand(argv: string[]): string | undefined;
20
- getArguments(argv: string[]): DoculaConsoleArguments;
7
+ quiet: boolean;
8
+ log(message: string): void;
9
+ error(message: string): void;
10
+ warn(message: string): void;
11
+ success(message: string): void;
12
+ info(message: string): void;
13
+ step(message: string): void;
14
+ fileBuilt(filePath: string): void;
15
+ fileCopied(filePath: string): void;
16
+ serverLog(method: string, url: string, statusCode: number, durationMs?: number): void;
17
+ banner(message: string): void;
18
+ printHelp(): void;
19
+ parseProcessArgv(argv: string[]): DoculaConsoleProcess;
20
+ getCommand(argv: string[]): string | undefined;
21
+ getArguments(argv: string[]): DoculaConsoleArguments;
21
22
  }
22
23
  type DoculaConsoleProcess = {
23
- argv: string[];
24
- command: string | undefined;
25
- args: DoculaConsoleArguments;
24
+ argv: string[];
25
+ command: string | undefined;
26
+ args: DoculaConsoleArguments;
26
27
  };
27
28
  type DoculaConsoleArguments = {
28
- sitePath: string | undefined;
29
- templatePath: string | undefined;
30
- template: string | undefined;
31
- output: string | undefined;
32
- watch: boolean;
33
- clean: boolean;
34
- build: boolean;
35
- port: number | undefined;
36
- typescript: boolean;
37
- javascript: boolean;
38
- overwrite: boolean;
39
- downloadTarget: string;
29
+ sitePath: string | undefined;
30
+ templatePath: string | undefined;
31
+ template: string | undefined;
32
+ output: string | undefined;
33
+ watch: boolean;
34
+ clean: boolean;
35
+ build: boolean;
36
+ port: number | undefined;
37
+ typescript: boolean;
38
+ javascript: boolean;
39
+ overwrite: boolean;
40
+ downloadTarget: string;
40
41
  };
41
-
42
+ //#endregion
43
+ //#region src/github.d.ts
42
44
  type GithubData = {
43
- releases: Record<string, unknown>;
44
- contributors: Record<string, unknown>;
45
+ releases: Record<string, unknown>;
46
+ contributors: Record<string, unknown>;
45
47
  };
46
-
48
+ //#endregion
49
+ //#region src/api-parser.d.ts
47
50
  type ApiSchemaProperty = {
48
- name: string;
49
- type: string;
50
- required: boolean;
51
- description: string;
52
- enumValues?: string[];
51
+ name: string;
52
+ type: string;
53
+ required: boolean;
54
+ description: string;
55
+ enumValues?: string[];
53
56
  };
54
57
  type ApiOperationParameter = {
55
- name: string;
56
- in: string;
57
- required: boolean;
58
- type: string;
59
- description: string;
58
+ name: string;
59
+ in: string;
60
+ required: boolean;
61
+ type: string;
62
+ description: string;
60
63
  };
61
64
  type ApiRequestBody = {
62
- contentType: string;
63
- schemaProperties: ApiSchemaProperty[];
64
- example: string;
65
+ contentType: string;
66
+ schemaProperties: ApiSchemaProperty[];
67
+ example: string;
65
68
  };
66
69
  type ApiResponse = {
67
- statusCode: string;
68
- statusClass: string;
69
- description: string;
70
- contentType: string;
71
- schemaProperties: ApiSchemaProperty[];
72
- example: string;
70
+ statusCode: string;
71
+ statusClass: string;
72
+ description: string;
73
+ contentType: string;
74
+ schemaProperties: ApiSchemaProperty[];
75
+ example: string;
73
76
  };
74
77
  type ApiCodeExamples = {
75
- curl: string;
76
- javascript: string;
77
- python: string;
78
+ curl: string;
79
+ javascript: string;
80
+ python: string;
78
81
  };
79
82
  type ApiOperation = {
80
- id: string;
81
- method: string;
82
- methodUpper: string;
83
- path: string;
84
- summary: string;
85
- description: string;
86
- parameters: ApiOperationParameter[];
87
- requestBody?: ApiRequestBody;
88
- responses: ApiResponse[];
89
- codeExamples: ApiCodeExamples;
83
+ id: string;
84
+ method: string;
85
+ methodUpper: string;
86
+ path: string;
87
+ summary: string;
88
+ description: string;
89
+ parameters: ApiOperationParameter[];
90
+ requestBody?: ApiRequestBody;
91
+ responses: ApiResponse[];
92
+ codeExamples: ApiCodeExamples;
90
93
  };
91
94
  type ApiGroup = {
92
- name: string;
93
- description: string;
94
- id: string;
95
- operations: ApiOperation[];
95
+ name: string;
96
+ description: string;
97
+ id: string;
98
+ operations: ApiOperation[];
96
99
  };
97
100
  type ApiOAuth2Flow = {
98
- authorizationUrl?: string;
99
- tokenUrl?: string;
100
- refreshUrl?: string;
101
- scopes: Record<string, string>;
101
+ authorizationUrl?: string;
102
+ tokenUrl?: string;
103
+ refreshUrl?: string;
104
+ scopes: Record<string, string>;
102
105
  };
103
106
  type ApiSecurityScheme = {
104
- key: string;
105
- type: string;
106
- scheme?: string;
107
- bearerFormat?: string;
108
- name?: string;
109
- in?: string;
110
- description: string;
111
- flows?: {
112
- authorizationCode?: ApiOAuth2Flow;
113
- implicit?: ApiOAuth2Flow;
114
- clientCredentials?: ApiOAuth2Flow;
115
- password?: ApiOAuth2Flow;
116
- };
107
+ key: string;
108
+ type: string;
109
+ scheme?: string;
110
+ bearerFormat?: string;
111
+ name?: string;
112
+ in?: string;
113
+ description: string;
114
+ flows?: {
115
+ authorizationCode?: ApiOAuth2Flow;
116
+ implicit?: ApiOAuth2Flow;
117
+ clientCredentials?: ApiOAuth2Flow;
118
+ password?: ApiOAuth2Flow;
119
+ };
117
120
  };
118
121
  type ApiSpecData = {
119
- info: {
120
- title: string;
121
- description: string;
122
- version: string;
123
- };
124
- servers: Array<{
125
- url: string;
126
- description: string;
127
- }>;
128
- groups: ApiGroup[];
129
- securitySchemes: ApiSecurityScheme[];
122
+ info: {
123
+ title: string;
124
+ description: string;
125
+ version: string;
126
+ };
127
+ servers: Array<{
128
+ url: string;
129
+ description: string;
130
+ }>;
131
+ groups: ApiGroup[];
132
+ securitySchemes: ApiSecurityScheme[];
130
133
  };
131
-
134
+ //#endregion
135
+ //#region src/types.d.ts
132
136
  type DoculaOpenApiSpecEntry = {
133
- name: string;
134
- url: string;
135
- order?: number;
136
- apiSpec?: ApiSpecData;
137
+ name: string;
138
+ url: string;
139
+ order?: number;
140
+ apiSpec?: ApiSpecData;
137
141
  };
138
142
  type DoculaChangelogEntry = {
139
- title: string;
140
- date: string;
141
- formattedDate: string;
142
- tag?: string;
143
- tagClass?: string;
144
- slug: string;
145
- content: string;
146
- generatedHtml: string;
147
- preview: string;
148
- draft?: boolean;
149
- previewImage?: string;
150
- urlPath: string;
151
- lastModified: string;
143
+ title: string;
144
+ date: string;
145
+ formattedDate: string;
146
+ tag?: string;
147
+ tagClass?: string;
148
+ slug: string;
149
+ content: string;
150
+ generatedHtml: string;
151
+ preview: string;
152
+ draft?: boolean;
153
+ previewImage?: string;
154
+ urlPath: string;
155
+ lastModified: string;
156
+ description?: string;
157
+ keywords?: string[];
158
+ ogTitle?: string;
159
+ ogDescription?: string;
152
160
  };
153
161
  type DoculaData = {
154
- siteUrl: string;
155
- siteTitle: string;
156
- siteDescription: string;
157
- sitePath: string;
158
- templatePath: string;
159
- output: string;
160
- githubPath?: string;
161
- github?: GithubData;
162
- templates?: DoculaTemplates;
163
- hasDocuments?: boolean;
164
- hasChangelog?: boolean;
165
- sections?: DoculaSection[];
166
- documents?: DoculaDocument[];
167
- sidebarItems?: DoculaSection[];
168
- announcement?: string;
169
- hasApi?: boolean;
170
- apiSpec?: ApiSpecData;
171
- openApiSpecs?: DoculaOpenApiSpecEntry[];
172
- changelogEntries?: DoculaChangelogEntry[];
173
- hasReadme?: boolean;
174
- themeMode?: string;
175
- cookieAuth?: {
176
- loginUrl: string;
177
- logoutUrl?: string;
178
- authCheckUrl?: string;
179
- authCheckMethod?: string;
180
- authCheckUserPath?: string;
181
- };
182
- headerLinks?: Array<{
183
- label: string;
184
- url: string;
185
- icon?: string;
186
- }>;
187
- enableLlmsTxt?: boolean;
188
- hasFeed?: boolean;
189
- lastModified?: string;
190
- homeUrl?: string;
191
- baseUrl: string;
192
- docsPath: string;
193
- apiPath: string;
194
- changelogPath: string;
195
- docsUrl: string;
196
- apiUrl: string;
197
- changelogUrl: string;
198
- editPageUrl?: string;
199
- openGraph?: DoculaOpenGraph;
200
- };
201
- type DoculaTemplates = {
202
- home: string;
203
- docPage?: string;
204
- api?: string;
205
- changelog?: string;
206
- changelogEntry?: string;
207
- };
208
- type DoculaSection = {
209
- name: string;
210
- order?: number;
211
- path: string;
212
- children?: DoculaSection[];
213
- };
214
- type DoculaDocument = {
215
- title: string;
216
- navTitle: string;
217
- description: string;
218
- order?: number;
219
- section?: string;
220
- keywords: string[];
221
- content: string;
222
- markdown: string;
223
- generatedHtml: string;
224
- documentPath: string;
225
- urlPath: string;
226
- isRoot: boolean;
227
- lastModified: string;
162
+ siteUrl: string;
163
+ siteTitle: string;
164
+ siteDescription: string;
165
+ sitePath: string;
166
+ templatePath: string;
167
+ output: string;
168
+ githubPath?: string;
169
+ github?: GithubData;
170
+ templates?: DoculaTemplates;
171
+ hasDocuments?: boolean;
172
+ hasChangelog?: boolean;
173
+ sections?: DoculaSection[];
174
+ documents?: DoculaDocument[];
175
+ sidebarItems?: DoculaSection[];
176
+ announcement?: string;
177
+ hasApi?: boolean;
178
+ apiSpec?: ApiSpecData;
179
+ openApiSpecs?: DoculaOpenApiSpecEntry[];
180
+ changelogEntries?: DoculaChangelogEntry[];
181
+ hasReadme?: boolean;
182
+ readmeContent?: string;
183
+ readmeMetadata?: {
184
+ description?: string;
185
+ keywords?: string[];
228
186
  ogTitle?: string;
229
187
  ogDescription?: string;
230
- ogImage?: string;
231
- };
232
-
233
- type DoculaCookieAuth = {
188
+ };
189
+ themeMode?: string;
190
+ cookieAuth?: {
234
191
  loginUrl: string;
235
192
  logoutUrl?: string;
236
193
  authCheckUrl?: string;
237
194
  authCheckMethod?: string;
238
195
  authCheckUserPath?: string;
239
- };
240
- type DoculaHeaderLink = {
196
+ };
197
+ headerLinks?: Array<{
241
198
  label: string;
242
199
  url: string;
243
200
  icon?: string;
201
+ }>;
202
+ googleTagManager?: string;
203
+ isGtag?: boolean;
204
+ enableLlmsTxt?: boolean;
205
+ hasFeed?: boolean;
206
+ lastModified?: string;
207
+ homeUrl?: string;
208
+ baseUrl: string;
209
+ docsPath: string;
210
+ apiPath: string;
211
+ changelogPath: string;
212
+ docsUrl: string;
213
+ apiUrl: string;
214
+ changelogUrl: string;
215
+ editPageUrl?: string;
216
+ openGraph?: DoculaOpenGraph;
217
+ };
218
+ type DoculaTemplates = {
219
+ home: string;
220
+ docPage?: string;
221
+ api?: string;
222
+ changelog?: string;
223
+ changelogEntry?: string;
224
+ };
225
+ type DoculaSection = {
226
+ name: string;
227
+ order?: number;
228
+ path: string;
229
+ children?: DoculaSection[];
230
+ };
231
+ type DoculaDocument = {
232
+ title: string;
233
+ navTitle: string;
234
+ description: string;
235
+ order?: number;
236
+ section?: string;
237
+ keywords: string[];
238
+ content: string;
239
+ markdown: string;
240
+ generatedHtml: string;
241
+ documentPath: string;
242
+ urlPath: string;
243
+ isRoot: boolean;
244
+ lastModified: string;
245
+ ogTitle?: string;
246
+ ogDescription?: string;
247
+ ogImage?: string;
248
+ };
249
+ //#endregion
250
+ //#region src/options.d.ts
251
+ type DoculaCookieAuth = {
252
+ loginUrl: string;
253
+ logoutUrl?: string;
254
+ authCheckUrl?: string;
255
+ authCheckMethod?: string;
256
+ authCheckUserPath?: string;
257
+ };
258
+ type DoculaHeaderLink = {
259
+ label: string;
260
+ url: string;
261
+ icon?: string;
244
262
  };
245
263
  type DoculaOpenApiSpec = {
246
- name: string;
247
- url: string;
248
- order?: number;
264
+ name: string;
265
+ url: string;
266
+ order?: number;
249
267
  };
250
268
  type DoculaOpenGraph = {
251
- title?: string;
252
- description?: string;
253
- image?: string;
254
- url?: string;
255
- type?: string;
256
- siteName?: string;
257
- twitterCard?: string;
269
+ title?: string;
270
+ description?: string;
271
+ image?: string;
272
+ url?: string;
273
+ type?: string;
274
+ siteName?: string;
275
+ twitterCard?: string;
258
276
  };
259
277
  type DoculaCacheOptions = {
260
- github: {
261
- ttl: number;
262
- };
278
+ github: {
279
+ ttl: number;
280
+ };
263
281
  };
264
282
  type DoculaAIOptions = {
265
- provider: string;
266
- model?: string;
267
- apiKey: string;
283
+ provider: string;
284
+ model?: string;
285
+ apiKey?: string;
268
286
  };
269
287
  declare class DoculaOptions {
270
- /**
271
- * Name of the built-in template to use (e.g., "modern", "classic")
272
- */
273
- template: string;
274
- /**
275
- * Path to the template directory. When set, overrides the `template` option.
276
- */
277
- templatePath: string;
278
- /**
279
- * Path to the output directory
280
- */
281
- output: string;
282
- /**
283
- * Path to the site directory
284
- */
285
- sitePath: string;
286
- /**
287
- * Path to the github repository
288
- */
289
- githubPath: string;
290
- /**
291
- * Site title
292
- */
293
- siteTitle: string;
294
- /**
295
- * Site description
296
- */
297
- siteDescription: string;
298
- /**
299
- * Site URL
300
- */
301
- siteUrl: string;
302
- /**
303
- * Port to run the server
304
- */
305
- port: number;
306
- /**
307
- * Sections
308
- */
309
- sections?: DoculaSection[];
310
- /**
311
- * OpenAPI specification for API documentation.
312
- * Pass a string URL for a single spec, or an array of DoculaOpenApiSpec for multiple specs.
313
- * When provided, creates a dedicated /api page.
314
- */
315
- openApiUrl?: string | DoculaOpenApiSpec[];
316
- /**
317
- * When true, GitHub releases are converted to changelog entries and merged
318
- * with file-based changelog entries. Requires a changelog template to exist.
319
- */
320
- enableReleaseChangelog: boolean;
321
- /**
322
- * Number of changelog entries to display per page on the changelog index.
323
- */
324
- changelogPerPage: number;
325
- /**
326
- * When true, generates llms.txt and llms-full.txt files for the built site.
327
- */
328
- enableLlmsTxt: boolean;
329
- /**
330
- * Override the default theme toggle. By default the site follows the system
331
- * preference. Set to "light" or "dark" to use that theme when no user
332
- * preference is stored in localStorage.
333
- */
334
- themeMode?: "light" | "dark";
335
- /**
336
- * When true, automatically adds generated paths (e.g., .cache) to the
337
- * site directory's .gitignore file if not already present.
338
- */
339
- autoUpdateIgnores: boolean;
340
- /**
341
- * When true, automatically copies the project root README.md into the site
342
- * directory if one does not already exist. The package.json name field is
343
- * used to prepend a title heading when the README lacks one.
344
- */
345
- autoReadme: boolean;
346
- /**
347
- * When true, suppresses all non-error console output during the build.
348
- */
349
- quiet: boolean;
350
- /**
351
- * URL for the logo/home link in the header. Defaults to baseUrl or "/".
352
- * Useful when hosting docs under a subpath but the logo should link to the parent site.
353
- */
354
- homeUrl?: string;
355
- /**
356
- * Base URL path prefix for all generated paths (e.g., "/docs").
357
- * When set, all asset and navigation URLs are prefixed with this path.
358
- */
359
- baseUrl: string;
360
- /**
361
- * Output subdirectory and URL segment for documentation pages.
362
- * Set to empty string to place docs at the output root.
363
- */
364
- docsPath: string;
365
- /**
366
- * Output subdirectory and URL segment for API reference pages.
367
- */
368
- apiPath: string;
369
- /**
370
- * Output subdirectory and URL segment for changelog pages.
371
- */
372
- changelogPath: string;
373
- /**
374
- * Base URL for "Edit this page" links on documentation pages.
375
- * When set, an edit link is shown at the bottom of each doc page.
376
- * The document's relative path is appended to this URL.
377
- * Example: "https://github.com/owner/repo/edit/main/site/docs"
378
- */
379
- editPageUrl?: string;
380
- /**
381
- * OpenGraph meta tags for social sharing. When set, og: and twitter:
382
- * meta tags are rendered in the page head. Fields fall back to
383
- * siteTitle / siteDescription / siteUrl when omitted.
384
- */
385
- openGraph?: DoculaOpenGraph;
386
- /**
387
- * Cookie-based authentication. When set, shows a Login/Logout button
388
- * in the header based on whether a JWT cookie is present.
389
- */
390
- cookieAuth?: DoculaCookieAuth;
391
- /**
392
- * Additional links to display in the site header navigation.
393
- * Each link requires a label and url.
394
- */
395
- headerLinks?: DoculaHeaderLink[];
396
- /**
397
- * AI-powered metadata enrichment configuration. When set, uses AI to fill
398
- * missing OpenGraph and HTML meta tag fields during the build.
399
- * Requires provider name and API key. Omit to disable AI enrichment.
400
- */
401
- ai?: DoculaAIOptions;
402
- /**
403
- * Cache settings. Controls caching of external data (e.g., GitHub API responses)
404
- * in the .cache directory within the site path.
405
- */
406
- cache: DoculaCacheOptions;
407
- /**
408
- * File extensions to copy as assets from docs/ and changelog/ directories.
409
- * Override in docula.config to customize.
410
- */
411
- allowedAssets: string[];
412
- constructor(options?: Record<string, unknown>);
413
- parseOptions(options: Record<string, any>): void;
288
+ /**
289
+ * Name of the built-in template to use (e.g., "modern", "classic")
290
+ */
291
+ template: string;
292
+ /**
293
+ * Path to the template directory. When set, overrides the `template` option.
294
+ */
295
+ templatePath: string;
296
+ /**
297
+ * Path to the output directory
298
+ */
299
+ output: string;
300
+ /**
301
+ * Path to the site directory
302
+ */
303
+ sitePath: string;
304
+ /**
305
+ * Path to the github repository
306
+ */
307
+ githubPath: string;
308
+ /**
309
+ * Site title
310
+ */
311
+ siteTitle: string;
312
+ /**
313
+ * Site description
314
+ */
315
+ siteDescription: string;
316
+ /**
317
+ * Site URL
318
+ */
319
+ siteUrl: string;
320
+ /**
321
+ * Port to run the server
322
+ */
323
+ port: number;
324
+ /**
325
+ * Sections
326
+ */
327
+ sections?: DoculaSection[];
328
+ /**
329
+ * OpenAPI specification for API documentation.
330
+ * Pass a string URL for a single spec, or an array of DoculaOpenApiSpec for multiple specs.
331
+ * When provided, creates a dedicated /api page.
332
+ */
333
+ openApiUrl?: string | DoculaOpenApiSpec[];
334
+ /**
335
+ * When true, GitHub releases are converted to changelog entries and merged
336
+ * with file-based changelog entries. Requires a changelog template to exist.
337
+ */
338
+ enableReleaseChangelog: boolean;
339
+ /**
340
+ * Number of changelog entries to display per page on the changelog index.
341
+ */
342
+ changelogPerPage: number;
343
+ /**
344
+ * When true, generates llms.txt and llms-full.txt files for the built site.
345
+ */
346
+ enableLlmsTxt: boolean;
347
+ /**
348
+ * Override the default theme toggle. By default the site follows the system
349
+ * preference. Set to "light" or "dark" to use that theme when no user
350
+ * preference is stored in localStorage.
351
+ */
352
+ themeMode?: "light" | "dark";
353
+ /**
354
+ * When true, automatically adds generated paths (e.g., .cache) to the
355
+ * site directory's .gitignore file if not already present.
356
+ */
357
+ autoUpdateIgnores: boolean;
358
+ /**
359
+ * When true, automatically renders the project root README.md as the home
360
+ * page if no README exists in the site directory. The README is read in
361
+ * place and never copied into the site directory. The package.json name
362
+ * field is used to prepend a title heading when the README lacks one.
363
+ */
364
+ autoReadme: boolean;
365
+ /**
366
+ * When true, suppresses all non-error console output during the build.
367
+ */
368
+ quiet: boolean;
369
+ /**
370
+ * URL for the logo/home link in the header. Defaults to baseUrl or "/".
371
+ * Useful when hosting docs under a subpath but the logo should link to the parent site.
372
+ */
373
+ homeUrl?: string;
374
+ /**
375
+ * Base URL path prefix for all generated paths (e.g., "/docs").
376
+ * When set, all asset and navigation URLs are prefixed with this path.
377
+ */
378
+ baseUrl: string;
379
+ /**
380
+ * Output subdirectory and URL segment for documentation pages.
381
+ * Set to empty string to place docs at the output root.
382
+ */
383
+ docsPath: string;
384
+ /**
385
+ * Output subdirectory and URL segment for API reference pages.
386
+ */
387
+ apiPath: string;
388
+ /**
389
+ * Output subdirectory and URL segment for changelog pages.
390
+ */
391
+ changelogPath: string;
392
+ /**
393
+ * Base URL for "Edit this page" links on documentation pages.
394
+ * When set, an edit link is shown at the bottom of each doc page.
395
+ * The document's relative path is appended to this URL.
396
+ * Example: "https://github.com/owner/repo/edit/main/site/docs"
397
+ */
398
+ editPageUrl?: string;
399
+ /**
400
+ * OpenGraph meta tags for social sharing. When set, og: and twitter:
401
+ * meta tags are rendered in the page head. Fields fall back to
402
+ * siteTitle / siteDescription / siteUrl when omitted.
403
+ */
404
+ openGraph?: DoculaOpenGraph;
405
+ /**
406
+ * Cookie-based authentication. When set, shows a Login/Logout button
407
+ * in the header based on whether a JWT cookie is present.
408
+ */
409
+ cookieAuth?: DoculaCookieAuth;
410
+ /**
411
+ * Additional links to display in the site header navigation.
412
+ * Each link requires a label and url.
413
+ */
414
+ headerLinks?: DoculaHeaderLink[];
415
+ /**
416
+ * Google Tag Manager container ID (e.g., "GTM-XXXXXX") or
417
+ * Google Analytics 4 measurement ID (e.g., "G-XXXXXXXXXX").
418
+ * When set, injects the appropriate tracking script on every page.
419
+ */
420
+ googleTagManager?: string;
421
+ /**
422
+ * AI-powered metadata enrichment configuration. When set, uses AI to fill
423
+ * missing OpenGraph and HTML meta tag fields during the build.
424
+ * Requires provider name and API key. Omit to disable AI enrichment.
425
+ */
426
+ ai?: DoculaAIOptions;
427
+ /**
428
+ * Cache settings. Controls caching of external data (e.g., GitHub API responses)
429
+ * in the .cache directory within the site path.
430
+ */
431
+ cache: DoculaCacheOptions;
432
+ /**
433
+ * File extensions to copy as assets from docs/ and changelog/ directories.
434
+ * Override in docula.config to customize.
435
+ */
436
+ allowedAssets: string[];
437
+ constructor(options?: Record<string, unknown>);
438
+ parseOptions(options: Record<string, any>): void;
414
439
  }
415
-
440
+ //#endregion
441
+ //#region src/builder.d.ts
416
442
  type DoculaBuilderOptions = {
417
- console?: DoculaConsole;
443
+ console?: DoculaConsole;
418
444
  } & DoculaOptions;
419
445
  declare class DoculaBuilder {
420
- private readonly _options;
421
- private readonly _ecto;
422
- private readonly _console;
423
- private readonly _hash;
424
- onReleaseChangelog?: (entries: DoculaChangelogEntry[], console: DoculaConsole) => Promise<DoculaChangelogEntry[]> | DoculaChangelogEntry[];
425
- get console(): DoculaConsole;
426
- constructor(options?: DoculaBuilderOptions, engineOptions?: any);
427
- get options(): DoculaOptions;
428
- build(): Promise<void>;
429
- validateOptions(options: DoculaOptions): void;
430
- autoReadme(): Promise<void>;
431
- getGithubData(githubPath: string): Promise<GithubData>;
432
- getTemplates(templatePath: string, hasDocuments: boolean, hasChangelog?: boolean): Promise<DoculaTemplates>;
433
- getTemplateFile(path: string, name: string): Promise<string | undefined>;
434
- buildRobotsPage(options: DoculaOptions): Promise<void>;
435
- buildSiteMapPage(data: DoculaData): Promise<void>;
436
- buildFeedPage(data: DoculaData): Promise<void>;
437
- buildChangelogFeedJson(data: DoculaData): Promise<void>;
438
- buildChangelogLatestFeedJson(data: DoculaData): Promise<void>;
439
- buildLlmsFiles(data: DoculaData): Promise<void>;
440
- resolveOpenGraphData(data: DoculaData, pageUrl: string, pageData?: Partial<DoculaDocument> & {
441
- previewImage?: string;
442
- preview?: string;
443
- }): Record<string, string | undefined>;
444
- resolveJsonLd(pageType: "home" | "docs" | "api" | "changelog" | "changelog-entry", data: DoculaData, pageUrl: string, pageData?: Partial<DoculaDocument> & {
445
- date?: string;
446
- preview?: string;
447
- previewImage?: string;
448
- }): string;
449
- buildIndexPage(data: DoculaData): Promise<void>;
450
- buildDocsHomePage(data: DoculaData): Promise<void>;
451
- buildReadmeSection(data: DoculaData): Promise<string>;
452
- buildAnnouncementSection(data: DoculaData): Promise<string | undefined>;
453
- buildDocsPages(data: DoculaData): Promise<void>;
454
- renderApiContent(data: DoculaData): Promise<string>;
455
- buildApiPage(data: DoculaData): Promise<void>;
456
- buildAllApiPages(data: DoculaData): Promise<void>;
457
- buildApiHomePage(data: DoculaData): Promise<void>;
458
- getChangelogEntries(changelogPath: string, cachedEntries?: Map<string, DoculaChangelogEntry>, previousHashes?: Record<string, string>, currentHashes?: Record<string, string>): DoculaChangelogEntry[];
459
- parseChangelogEntry(filePath: string): DoculaChangelogEntry;
460
- generateChangelogPreview(markdown: string, maxLength?: number, mdx?: boolean): string;
461
- convertReleaseToChangelogEntry(release: Record<string, any>): DoculaChangelogEntry;
462
- getReleasesAsChangelogEntries(releases: any[]): DoculaChangelogEntry[];
463
- buildChangelogPage(data: DoculaData): Promise<void>;
464
- buildChangelogEntryPages(data: DoculaData): Promise<void>;
465
- generateSidebarItems(data: DoculaData): DoculaSection[];
466
- getDocuments(sitePath: string, doculaData: DoculaData, cachedDocs?: Map<string, DoculaDocument>, previousDocHashes?: Record<string, string>, currentDocHashes?: Record<string, string>): DoculaDocument[];
467
- getDocumentInDirectory(sitePath: string, docsRootPath: string, cachedDocs?: Map<string, DoculaDocument>, previousDocHashes?: Record<string, string>, currentDocHashes?: Record<string, string>): DoculaDocument[];
468
- getSections(sitePath: string, doculaOptions: DoculaOptions): DoculaSection[];
469
- mergeSectionWithOptions(section: DoculaSection, options: DoculaOptions): DoculaSection;
470
- parseDocumentData(documentPath: string): DoculaDocument;
446
+ private readonly _options;
447
+ private readonly _ecto;
448
+ private readonly _console;
449
+ private readonly _hash;
450
+ onReleaseChangelog?: (entries: DoculaChangelogEntry[], console: DoculaConsole) => Promise<DoculaChangelogEntry[]> | DoculaChangelogEntry[];
451
+ get console(): DoculaConsole;
452
+ constructor(options?: DoculaBuilderOptions, engineOptions?: any);
453
+ get options(): DoculaOptions;
454
+ build(): Promise<void>;
455
+ validateOptions(options: DoculaOptions): void;
456
+ autoReadme(): Promise<{
457
+ sourcePath: string;
458
+ content: string;
459
+ } | undefined>;
460
+ getGithubData(githubPath: string): Promise<GithubData>;
461
+ getTemplates(templatePath: string, hasDocuments: boolean, hasChangelog?: boolean): Promise<DoculaTemplates>;
462
+ getTemplateFile(path: string, name: string): Promise<string | undefined>;
463
+ buildRobotsPage(options: DoculaOptions): Promise<void>;
464
+ buildSiteMapPage(data: DoculaData): Promise<void>;
465
+ buildFeedPage(data: DoculaData): Promise<void>;
466
+ buildChangelogFeedJson(data: DoculaData): Promise<void>;
467
+ buildChangelogLatestFeedJson(data: DoculaData): Promise<void>;
468
+ buildLlmsFiles(data: DoculaData): Promise<void>;
469
+ resolveOpenGraphData(data: DoculaData, pageUrl: string, pageData?: Partial<DoculaDocument> & {
470
+ previewImage?: string;
471
+ preview?: string;
472
+ }): Record<string, string | undefined>;
473
+ resolveJsonLd(pageType: "home" | "docs" | "api" | "changelog" | "changelog-entry", data: DoculaData, pageUrl: string, pageData?: Partial<DoculaDocument> & {
474
+ date?: string;
475
+ preview?: string;
476
+ previewImage?: string;
477
+ }): string;
478
+ buildIndexPage(data: DoculaData): Promise<void>;
479
+ buildDocsHomePage(data: DoculaData): Promise<void>;
480
+ buildReadmeSection(data: DoculaData): Promise<string>;
481
+ buildAnnouncementSection(data: DoculaData): Promise<string | undefined>;
482
+ buildDocsPages(data: DoculaData): Promise<void>;
483
+ renderApiContent(data: DoculaData): Promise<string>;
484
+ buildApiPage(data: DoculaData): Promise<void>;
485
+ buildAllApiPages(data: DoculaData): Promise<void>;
486
+ buildApiHomePage(data: DoculaData): Promise<void>;
487
+ getChangelogEntries(changelogPath: string, cachedEntries?: Map<string, DoculaChangelogEntry>, previousHashes?: Record<string, string>, currentHashes?: Record<string, string>): DoculaChangelogEntry[];
488
+ parseChangelogEntry(filePath: string): DoculaChangelogEntry;
489
+ generateChangelogPreview(markdown: string, maxLength?: number, mdx?: boolean): string;
490
+ convertReleaseToChangelogEntry(release: Record<string, any>): DoculaChangelogEntry;
491
+ getReleasesAsChangelogEntries(releases: any[]): DoculaChangelogEntry[];
492
+ buildChangelogPage(data: DoculaData): Promise<void>;
493
+ buildChangelogEntryPages(data: DoculaData): Promise<void>;
494
+ generateSidebarItems(data: DoculaData): DoculaSection[];
495
+ getDocuments(sitePath: string, doculaData: DoculaData, cachedDocs?: Map<string, DoculaDocument>, previousDocHashes?: Record<string, string>, currentDocHashes?: Record<string, string>): DoculaDocument[];
496
+ getDocumentInDirectory(sitePath: string, docsRootPath: string, cachedDocs?: Map<string, DoculaDocument>, previousDocHashes?: Record<string, string>, currentDocHashes?: Record<string, string>): DoculaDocument[];
497
+ getSections(sitePath: string, doculaOptions: DoculaOptions): DoculaSection[];
498
+ mergeSectionWithOptions(section: DoculaSection, options: DoculaOptions): DoculaSection;
499
+ parseDocumentData(documentPath: string): DoculaDocument;
471
500
  }
472
-
501
+ //#endregion
502
+ //#region src/docula.d.ts
473
503
  declare class Docula {
474
- private _options;
475
- private readonly _console;
476
- private _configFileModule;
477
- private _server;
478
- private _watcher;
479
- get console(): DoculaConsole;
480
- /**
481
- * Initialize the Docula class
482
- * @param {DoculaOptions} options
483
- * @returns {void}
484
- * @constructor
485
- */
486
- constructor(options?: DoculaOptions);
487
- /**
488
- * Get the options
489
- * @returns {DoculaOptions}
490
- */
491
- get options(): DoculaOptions;
492
- /**
493
- * Set the options
494
- * @param {DoculaOptions} value
495
- */
496
- set options(value: DoculaOptions);
497
- /**
498
- * The http server used to serve the site
499
- * @returns {http.Server | undefined}
500
- */
501
- get server(): http.Server | undefined;
502
- /**
503
- * The file watcher used in watch mode
504
- * @returns {fs.FSWatcher | undefined}
505
- */
506
- get watcher(): fs.FSWatcher | undefined;
507
- /**
508
- * The config file module. This is the module that is loaded from the docula.config.ts or docula.config.mjs file
509
- * @returns {any}
510
- */
511
- get configFileModule(): any;
512
- /**
513
- * Remove the .cache directory inside the site path.
514
- * Resolves the path and verifies it stays within sitePath to prevent
515
- * path-traversal attacks.
516
- * @param {string} sitePath
517
- */
518
- private cleanCache;
519
- /**
520
- * Check for updates
521
- * @returns {void}
522
- */
523
- checkForUpdates(): void;
524
- /**
525
- * Is the execution process that runs the docula command
526
- * @param {NodeJS.Process} process
527
- * @returns {Promise<void>}
528
- */
529
- execute(process: NodeJS.Process): Promise<void>;
530
- private runBuild;
531
- /**
532
- * Detect if the current project uses TypeScript by checking for tsconfig.json
533
- * @returns {boolean}
534
- */
535
- detectTypeScript(): boolean;
536
- /**
537
- * Generate the init files
538
- * @param {string} sitePath
539
- * @param {boolean} typescript - If true, generates docula.config.ts instead of docula.config.mjs
540
- * @returns {void}
541
- */
542
- generateInit(sitePath: string, typescript?: boolean): void;
543
- /**
544
- * Copy the template's variables.css to the site directory.
545
- * If the file already exists and overwrite is false, prints an error.
546
- * @param {string} sitePath
547
- * @param {string} templatePath
548
- * @param {string} templateName
549
- * @param {boolean} overwrite
550
- * @returns {void}
551
- */
552
- downloadVariables(sitePath: string, templatePath: string, templateName: string, overwrite?: boolean): void;
553
- /**
554
- * Copy the full template directory to {sitePath}/templates/{outputName}/.
555
- * If the directory already exists and overwrite is false, prints an error.
556
- * @param {string} sitePath
557
- * @param {string} templatePath
558
- * @param {string} templateName
559
- * @param {boolean} overwrite
560
- * @returns {void}
561
- */
562
- downloadTemplate(sitePath: string, templatePath: string, templateName: string, overwrite?: boolean): void;
563
- /**
564
- * Get the version of the package
565
- * @returns {string}
566
- */
567
- getVersion(): string;
568
- /**
569
- * Load the config file. Supports both .mjs and .ts config files.
570
- * Priority: docula.config.ts > docula.config.mjs
571
- * @param {string} sitePath
572
- * @returns {Promise<void>}
573
- */
574
- loadConfigFile(sitePath: string): Promise<void>;
575
- /**
576
- * Watch the site path for file changes and rebuild on change
577
- * @param {DoculaOptions} options
578
- * @param {DoculaBuilder} builder
579
- * @returns {fs.FSWatcher}
580
- */
581
- watch(options: DoculaOptions, builder: DoculaBuilder): fs.FSWatcher;
582
- /**
583
- * Serve the site based on the options (port and output path)
584
- * @param {DoculaOptions} options
585
- * @returns {Promise<void>}
586
- */
587
- serve(options: DoculaOptions): Promise<http.Server>;
504
+ private _options;
505
+ private readonly _console;
506
+ private _configFileModule;
507
+ private _server;
508
+ private _watcher;
509
+ get console(): DoculaConsole;
510
+ /**
511
+ * Initialize the Docula class
512
+ * @param {DoculaOptions} options
513
+ * @returns {void}
514
+ * @constructor
515
+ */
516
+ constructor(options?: DoculaOptions);
517
+ /**
518
+ * Get the options
519
+ * @returns {DoculaOptions}
520
+ */
521
+ get options(): DoculaOptions;
522
+ /**
523
+ * Set the options
524
+ * @param {DoculaOptions} value
525
+ */
526
+ set options(value: DoculaOptions);
527
+ /**
528
+ * The http server used to serve the site
529
+ * @returns {http.Server | undefined}
530
+ */
531
+ get server(): http.Server | undefined;
532
+ /**
533
+ * The file watcher used in watch mode
534
+ * @returns {fs.FSWatcher | undefined}
535
+ */
536
+ get watcher(): fs.FSWatcher | undefined;
537
+ /**
538
+ * The config file module. This is the module that is loaded from the docula.config.ts or docula.config.mjs file
539
+ * @returns {any}
540
+ */
541
+ get configFileModule(): any;
542
+ /**
543
+ * Remove the .cache directory inside the site path.
544
+ * Resolves the path and verifies it stays within sitePath to prevent
545
+ * path-traversal attacks.
546
+ * @param {string} sitePath
547
+ */
548
+ private cleanCache;
549
+ /**
550
+ * Check for updates
551
+ * @returns {void}
552
+ */
553
+ checkForUpdates(): void;
554
+ /**
555
+ * Is the execution process that runs the docula command
556
+ * @param {NodeJS.Process} process
557
+ * @returns {Promise<void>}
558
+ */
559
+ execute(process: NodeJS.Process): Promise<void>;
560
+ private runBuild;
561
+ /**
562
+ * Detect if the current project uses TypeScript by checking for tsconfig.json
563
+ * @returns {boolean}
564
+ */
565
+ detectTypeScript(): boolean;
566
+ /**
567
+ * Generate the init files
568
+ * @param {string} sitePath
569
+ * @param {boolean} typescript - If true, generates docula.config.ts instead of docula.config.mjs
570
+ * @returns {void}
571
+ */
572
+ generateInit(sitePath: string, typescript?: boolean): void;
573
+ /**
574
+ * Copy the template's variables.css to the site directory.
575
+ * If the file already exists and overwrite is false, prints an error.
576
+ * @param {string} sitePath
577
+ * @param {string} templatePath
578
+ * @param {string} templateName
579
+ * @param {boolean} overwrite
580
+ * @returns {void}
581
+ */
582
+ downloadVariables(sitePath: string, templatePath: string, templateName: string, overwrite?: boolean): void;
583
+ /**
584
+ * Copy the full template directory to {sitePath}/templates/{outputName}/.
585
+ * If the directory already exists and overwrite is false, prints an error.
586
+ * @param {string} sitePath
587
+ * @param {string} templatePath
588
+ * @param {string} templateName
589
+ * @param {boolean} overwrite
590
+ * @returns {void}
591
+ */
592
+ downloadTemplate(sitePath: string, templatePath: string, templateName: string, overwrite?: boolean): void;
593
+ /**
594
+ * Get the version of the package
595
+ * @returns {string}
596
+ */
597
+ getVersion(): string;
598
+ /**
599
+ * Load the config file. Supports both .mjs and .ts config files.
600
+ * Priority: docula.config.ts > docula.config.mjs
601
+ * @param {string} sitePath
602
+ * @returns {Promise<void>}
603
+ */
604
+ loadConfigFile(sitePath: string): Promise<void>;
605
+ /**
606
+ * Watch the site path for file changes and rebuild on change
607
+ * @param {DoculaOptions} options
608
+ * @param {DoculaBuilder} builder
609
+ * @returns {fs.FSWatcher}
610
+ */
611
+ watch(options: DoculaOptions, builder: DoculaBuilder): fs.FSWatcher;
612
+ /**
613
+ * Serve the site based on the options (port and output path)
614
+ * @param {DoculaOptions} options
615
+ * @returns {Promise<void>}
616
+ */
617
+ serve(options: DoculaOptions): Promise<http.Server>;
588
618
  }
589
-
590
- export { type DoculaAIOptions, type DoculaCacheOptions, type DoculaChangelogEntry, DoculaConsole, type DoculaCookieAuth, type DoculaHeaderLink, type DoculaOpenApiSpec, DoculaOptions, Docula as default };
619
+ //#endregion
620
+ export { type DoculaAIOptions, type DoculaCacheOptions, type DoculaChangelogEntry, DoculaConsole, type DoculaCookieAuth, type DoculaHeaderLink, type DoculaOpenApiSpec, DoculaOptions, Writr, Docula as default };