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/README.md +53 -0
- package/dist/docula.d.ts +559 -529
- package/dist/docula.js +3398 -4398
- 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/css/styles.css +31 -2
- 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-bar.hbs +0 -1
- package/templates/modern/includes/header.hbs +15 -0
package/dist/docula.d.ts
CHANGED
|
@@ -1,590 +1,620 @@
|
|
|
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;
|
|
156
|
+
description?: string;
|
|
157
|
+
keywords?: string[];
|
|
158
|
+
ogTitle?: string;
|
|
159
|
+
ogDescription?: string;
|
|
152
160
|
};
|
|
153
161
|
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
|
-
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
264
|
+
name: string;
|
|
265
|
+
url: string;
|
|
266
|
+
order?: number;
|
|
249
267
|
};
|
|
250
268
|
type DoculaOpenGraph = {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
278
|
+
github: {
|
|
279
|
+
ttl: number;
|
|
280
|
+
};
|
|
263
281
|
};
|
|
264
282
|
type DoculaAIOptions = {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
283
|
+
provider: string;
|
|
284
|
+
model?: string;
|
|
285
|
+
apiKey?: string;
|
|
268
286
|
};
|
|
269
287
|
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
|
-
|
|
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
|
-
|
|
443
|
+
console?: DoculaConsole;
|
|
418
444
|
} & DoculaOptions;
|
|
419
445
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|