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