@cparra/apexdocs 3.0.0-beta.1 → 3.0.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/LICENSE +1 -1
- package/README.md +246 -650
- package/dist/cli/generate.js +74 -3095
- package/dist/defaults-BcE8DTat.js +13 -0
- package/dist/defaults-D07y_bq4.js +40 -0
- package/dist/defaults-gPzwP66p.js +14 -0
- package/dist/index.d.ts +49 -19
- package/dist/index.js +90 -2
- package/dist/logger-BEbUIfqN.js +3282 -0
- package/dist/logger-BGuf1PnL.js +3281 -0
- package/dist/logger-CWBRF2za.js +3284 -0
- package/dist/logger-CdBmDEN1.js +3283 -0
- package/dist/logger-Ce4QqPFR.js +3278 -0
- package/dist/logger-CyEVYaAC.js +3284 -0
- package/dist/logger-D7a83ycP.js +3277 -0
- package/dist/logger-DGaHeBKk.js +3279 -0
- package/dist/logger-Dqhl_lO_.js +3278 -0
- package/dist/logger-aySSWi0G.js +3280 -0
- package/dist/logger-qLCcAtiy.js +3284 -0
- package/examples/README.md +5 -0
- package/examples/docsify/README.md +17 -0
- package/examples/docsify/apexdocs.config.ts +13 -0
- package/examples/docsify/classes/ASampleClass.cls +57 -0
- package/examples/docsify/classes/CodeControl.cls +19 -0
- package/examples/docsify/classes/SampleClass.cls +95 -0
- package/examples/docsify/classes/SampleInterface.cls +17 -0
- package/examples/docsify/classes/SomeDto.cls +122 -0
- package/examples/docsify/docs/.nojekyll +0 -0
- package/examples/docsify/docs/README.md +25 -0
- package/examples/docsify/docs/_config.yml +1 -0
- package/examples/docsify/docs/index.html +22 -0
- package/examples/docsify/docs/miscellaneous/ASampleClass.md +88 -0
- package/examples/docsify/docs/miscellaneous/CodeControl.md +107 -0
- package/examples/docsify/docs/miscellaneous/SomeDto.md +244 -0
- package/examples/docsify/docs/sample-classes/SampleClass.md +171 -0
- package/examples/docsify/docs/sample-interfaces/SampleInterface.md +36 -0
- package/examples/docsify/package-lock.json +2459 -0
- package/examples/docsify/package.json +14 -0
- package/examples/imported/.forceignore +12 -0
- package/examples/imported/README.md +6 -0
- package/examples/imported/config/project-scratch-def.json +5 -0
- package/examples/imported/docs/index.md +109 -0
- package/examples/imported/docs/miscellaneous/BaseClass.md +13 -0
- package/examples/imported/docs/miscellaneous/MultiInheritanceClass.md +69 -0
- package/examples/imported/docs/miscellaneous/ParentInterface.md +12 -0
- package/examples/imported/docs/miscellaneous/ReferencedEnum.md +5 -0
- package/examples/imported/docs/miscellaneous/SampleException.md +21 -0
- package/examples/imported/docs/miscellaneous/SampleInterface.md +113 -0
- package/examples/imported/docs/miscellaneous/Url.md +308 -0
- package/examples/imported/docs/sample-enums/SampleEnum.md +33 -0
- package/examples/imported/docs/samplegroup/SampleClass.md +167 -0
- package/examples/imported/force-app/classes/BaseClass.cls +3 -0
- package/examples/imported/force-app/classes/MultiInheritanceClass.cls +1 -0
- package/examples/imported/force-app/classes/ParentInterface.cls +3 -0
- package/examples/imported/force-app/classes/ReferencedEnum.cls +3 -0
- package/examples/imported/force-app/classes/SampleInterface.cls +50 -0
- package/examples/imported/force-app/classes/Url.cls +196 -0
- package/examples/imported/package-lock.json +665 -0
- package/examples/imported/package.json +6 -0
- package/examples/imported/scripts/process-docs.mjs +16 -0
- package/examples/imported/sfdx-project.json +12 -0
- package/examples/markdown/README.md +7 -0
- package/examples/markdown/docs/miscellaneous/Url.md +10 -8
- package/examples/markdown/force-app/classes/Url.cls +3 -1
- package/examples/markdown-jsconfig/.forceignore +12 -0
- package/examples/markdown-jsconfig/README.md +9 -0
- package/examples/markdown-jsconfig/apexdocs.config.mjs +22 -0
- package/examples/markdown-jsconfig/config/project-scratch-def.json +5 -0
- package/examples/markdown-jsconfig/docs/index.md +12 -0
- package/examples/markdown-jsconfig/docs/miscellaneous/Url.md +315 -0
- package/examples/markdown-jsconfig/force-app/classes/Url.cls +196 -0
- package/examples/markdown-jsconfig/package-lock.json +665 -0
- package/examples/markdown-jsconfig/package.json +15 -0
- package/examples/markdown-jsconfig/sfdx-project.json +12 -0
- package/examples/open-api/README.md +5 -0
- package/examples/open-api/docs/openapi.json +2 -570
- package/examples/vitepress/README.md +25 -0
- package/examples/vitepress/apexdocs.config.ts +9 -2
- package/examples/vitepress/docs/index.md +11 -11
- package/examples/vitepress/docs/miscellaneous/BaseClass.md +1 -1
- package/examples/vitepress/docs/miscellaneous/MultiInheritanceClass.md +2 -2
- package/examples/vitepress/docs/miscellaneous/SampleException.md +1 -1
- package/examples/vitepress/docs/miscellaneous/SampleInterface.md +6 -6
- package/examples/vitepress/docs/miscellaneous/Url.md +3 -3
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +3 -3
- package/examples/vitepress/docs/samplegroup/SampleClass.md +5 -5
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleClass.cls +73 -0
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleEnum.cls +30 -0
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleException.cls +17 -0
- package/package.json +3 -3
- package/src/application/Apexdocs.ts +16 -19
- package/src/application/__tests__/apex-file-reader.spec.ts +108 -67
- package/src/application/apex-file-reader.ts +1 -0
- package/src/application/generators/openapi.ts +17 -13
- package/src/cli/args.ts +12 -3
- package/src/cli/commands/markdown.ts +15 -12
- package/src/cli/commands/openapi.ts +5 -5
- package/src/cli/generate.ts +20 -4
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +15 -386
- package/src/core/markdown/__test__/generating-docs.spec.ts +378 -0
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +4 -328
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +4 -296
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +17 -1
- package/src/core/markdown/__test__/test-helpers.ts +3 -1
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +3 -1
- package/src/core/markdown/adapters/renderable-to-page-data.ts +6 -4
- package/src/core/markdown/generate-docs.ts +13 -15
- package/src/core/markdown/reflection/__test__/filter-scope.spec.ts +290 -0
- package/src/core/markdown/reflection/__test__/helpers.ts +18 -0
- package/src/core/markdown/reflection/__test__/remove-excluded-tags.spec.ts +200 -0
- package/src/core/markdown/reflection/remove-excluded-tags.ts +168 -0
- package/src/core/markdown/reflection/{sort-members.ts → sort-types-and-members.ts} +7 -5
- package/src/core/markdown/templates/reference-guide.ts +2 -2
- package/src/core/openapi/__tests__/open-api-docs-processor.spec.ts +6 -3
- package/src/core/openapi/open-api-docs-processor.ts +3 -3
- package/src/core/openapi/parser.ts +5 -2
- package/src/core/shared/types.d.ts +18 -18
- package/src/defaults.ts +15 -3
- package/src/index.ts +88 -14
- package/src/util/error-logger.ts +36 -36
- package/src/util/logger.ts +18 -11
- /package/examples/{vitepress/force-app/main/default → imported/force-app}/classes/SampleClass.cls +0 -0
- /package/examples/{vitepress/force-app/main/default → imported/force-app}/classes/SampleEnum.cls +0 -0
- /package/examples/{vitepress/force-app/main/default → imported/force-app}/classes/SampleException.cls +0 -0
- /package/examples/vitepress/force-app/main/default/classes/{SampleInterface.cls → feature-a/SampleInterface.cls} +0 -0
|
@@ -9,574 +9,6 @@
|
|
|
9
9
|
"url": "/services/apexrest/openapi/"
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
|
-
"paths": {
|
|
13
|
-
|
|
14
|
-
"description": "Account related operations",
|
|
15
|
-
"get": {
|
|
16
|
-
"tags": [
|
|
17
|
-
"Account Service"
|
|
18
|
-
],
|
|
19
|
-
"description": "This is a sample HTTP Get method",
|
|
20
|
-
"parameters": [
|
|
21
|
-
{
|
|
22
|
-
"name": "limit",
|
|
23
|
-
"in": "query",
|
|
24
|
-
"required": true,
|
|
25
|
-
"description": "Limits the number of items on a page",
|
|
26
|
-
"schema": {
|
|
27
|
-
"type": "integer"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "complex",
|
|
32
|
-
"in": "cookie",
|
|
33
|
-
"description": "A more complex schema",
|
|
34
|
-
"schema": {
|
|
35
|
-
"type": "array",
|
|
36
|
-
"items": {
|
|
37
|
-
"type": "object",
|
|
38
|
-
"properties": {
|
|
39
|
-
"name": {
|
|
40
|
-
"type": "string"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"responses": {
|
|
48
|
-
"100": {
|
|
49
|
-
"description": "Status code 100",
|
|
50
|
-
"content": {
|
|
51
|
-
"application/json": {
|
|
52
|
-
"schema": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"properties": {
|
|
55
|
-
"anotherObject": {
|
|
56
|
-
"description": "An object inside of an object",
|
|
57
|
-
"type": "object",
|
|
58
|
-
"properties": {
|
|
59
|
-
"message": {
|
|
60
|
-
"type": "string"
|
|
61
|
-
},
|
|
62
|
-
"somethingElse": {
|
|
63
|
-
"type": "number"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"200": {
|
|
73
|
-
"description": "Status code 200",
|
|
74
|
-
"content": {
|
|
75
|
-
"application/json": {
|
|
76
|
-
"schema": {
|
|
77
|
-
"type": "object",
|
|
78
|
-
"properties": {
|
|
79
|
-
"id": {
|
|
80
|
-
"type": "string",
|
|
81
|
-
"description": "The super Id."
|
|
82
|
-
},
|
|
83
|
-
"name": {
|
|
84
|
-
"type": "string"
|
|
85
|
-
},
|
|
86
|
-
"phone": {
|
|
87
|
-
"type": "string",
|
|
88
|
-
"format": "byte"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"304": {
|
|
96
|
-
"description": "Status code 304",
|
|
97
|
-
"content": {
|
|
98
|
-
"application/json": {
|
|
99
|
-
"schema": {
|
|
100
|
-
"type": "object",
|
|
101
|
-
"properties": {
|
|
102
|
-
"error": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
"400": {
|
|
111
|
-
"description": "Status code 400",
|
|
112
|
-
"content": {
|
|
113
|
-
"application/json": {
|
|
114
|
-
"schema": {
|
|
115
|
-
"type": "array",
|
|
116
|
-
"items": {
|
|
117
|
-
"type": "object",
|
|
118
|
-
"properties": {
|
|
119
|
-
"name": {
|
|
120
|
-
"type": "string"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"500": {
|
|
129
|
-
"description": "Status code 500",
|
|
130
|
-
"content": {
|
|
131
|
-
"application/json": {
|
|
132
|
-
"schema": {
|
|
133
|
-
"type": "string"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"post": {
|
|
141
|
-
"tags": [
|
|
142
|
-
"Account Service"
|
|
143
|
-
],
|
|
144
|
-
"description": "This is a sample HTTP Post method",
|
|
145
|
-
"summary": "Posts an Account 2",
|
|
146
|
-
"requestBody": {
|
|
147
|
-
"description": "This is an example of a request body",
|
|
148
|
-
"content": {
|
|
149
|
-
"application/json": {
|
|
150
|
-
"schema": {
|
|
151
|
-
"type": "array",
|
|
152
|
-
"items": {
|
|
153
|
-
"type": "object",
|
|
154
|
-
"properties": {
|
|
155
|
-
"name": {
|
|
156
|
-
"type": "string"
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"required": true
|
|
164
|
-
},
|
|
165
|
-
"parameters": [
|
|
166
|
-
{
|
|
167
|
-
"name": "limit",
|
|
168
|
-
"in": "query",
|
|
169
|
-
"required": true,
|
|
170
|
-
"description": "Limits the number of items on a page",
|
|
171
|
-
"schema": {
|
|
172
|
-
"type": "integer"
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"name": "complex",
|
|
177
|
-
"in": "cookie",
|
|
178
|
-
"description": "A more complex schema",
|
|
179
|
-
"schema": {
|
|
180
|
-
"type": "array",
|
|
181
|
-
"items": {
|
|
182
|
-
"type": "object",
|
|
183
|
-
"properties": {
|
|
184
|
-
"name": {
|
|
185
|
-
"type": "string"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
|
-
"responses": {
|
|
193
|
-
"200": {
|
|
194
|
-
"description": "Status code 200",
|
|
195
|
-
"content": {
|
|
196
|
-
"application/json": {
|
|
197
|
-
"schema": {
|
|
198
|
-
"type": "object",
|
|
199
|
-
"properties": {
|
|
200
|
-
"id": {
|
|
201
|
-
"type": "string",
|
|
202
|
-
"description": "The super Id."
|
|
203
|
-
},
|
|
204
|
-
"name": {
|
|
205
|
-
"type": "string"
|
|
206
|
-
},
|
|
207
|
-
"phone": {
|
|
208
|
-
"type": "string",
|
|
209
|
-
"format": "byte"
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
"304": {
|
|
217
|
-
"description": "Status code 304",
|
|
218
|
-
"content": {
|
|
219
|
-
"application/json": {
|
|
220
|
-
"schema": {
|
|
221
|
-
"type": "object",
|
|
222
|
-
"properties": {
|
|
223
|
-
"error": {
|
|
224
|
-
"type": "string"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
"400": {
|
|
232
|
-
"description": "Status code 400",
|
|
233
|
-
"content": {
|
|
234
|
-
"application/json": {
|
|
235
|
-
"schema": {
|
|
236
|
-
"type": "array",
|
|
237
|
-
"items": {
|
|
238
|
-
"type": "object",
|
|
239
|
-
"properties": {
|
|
240
|
-
"name": {
|
|
241
|
-
"type": "string"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
"500": {
|
|
250
|
-
"description": "Status code 500",
|
|
251
|
-
"content": {
|
|
252
|
-
"application/json": {
|
|
253
|
-
"schema": {
|
|
254
|
-
"type": "string"
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
"delete": {
|
|
262
|
-
"tags": [
|
|
263
|
-
"Account Service"
|
|
264
|
-
],
|
|
265
|
-
"description": "Sample HTTP Delete method with references to other types.",
|
|
266
|
-
"parameters": [
|
|
267
|
-
{
|
|
268
|
-
"name": "limit",
|
|
269
|
-
"in": "header",
|
|
270
|
-
"required": true,
|
|
271
|
-
"description": "My sample description.",
|
|
272
|
-
"schema": {
|
|
273
|
-
"$ref": "#/components/schemas/SampleClass"
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
],
|
|
277
|
-
"responses": {
|
|
278
|
-
"200": {
|
|
279
|
-
"description": "Status code 200",
|
|
280
|
-
"content": {
|
|
281
|
-
"application/json": {
|
|
282
|
-
"schema": {
|
|
283
|
-
"$ref": "#/components/schemas/SampleClass"
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
"304": {
|
|
289
|
-
"description": "Status code 304",
|
|
290
|
-
"content": {
|
|
291
|
-
"application/json": {
|
|
292
|
-
"schema": {
|
|
293
|
-
"$ref": "#/components/schemas/ChildClass"
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
"305": {
|
|
299
|
-
"description": "Status code 305",
|
|
300
|
-
"content": {
|
|
301
|
-
"application/json": {
|
|
302
|
-
"schema": {
|
|
303
|
-
"$ref": "#/components/schemas/Reference1"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
"306": {
|
|
309
|
-
"description": "Status code 306",
|
|
310
|
-
"content": {
|
|
311
|
-
"application/json": {
|
|
312
|
-
"schema": {
|
|
313
|
-
"$ref": "#/components/schemas/Reference1_array"
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
"307": {
|
|
319
|
-
"description": "Status code 307",
|
|
320
|
-
"content": {
|
|
321
|
-
"application/json": {
|
|
322
|
-
"schema": {
|
|
323
|
-
"$ref": "#/components/schemas/Reference7_Reference7[untypedObject:Reference2]"
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
"500": {
|
|
329
|
-
"description": "Status code 500",
|
|
330
|
-
"content": {
|
|
331
|
-
"application/json": {
|
|
332
|
-
"schema": {
|
|
333
|
-
"$ref": "#/components/schemas/SampleClass"
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"Contact/": {
|
|
342
|
-
"description": "Contact related operations",
|
|
343
|
-
"get": {
|
|
344
|
-
"tags": [
|
|
345
|
-
"Contact"
|
|
346
|
-
],
|
|
347
|
-
"description": "This is a sample HTTP Get method",
|
|
348
|
-
"responses": {
|
|
349
|
-
"200": {
|
|
350
|
-
"description": "Status code 200",
|
|
351
|
-
"content": {
|
|
352
|
-
"application/json": {
|
|
353
|
-
"schema": {
|
|
354
|
-
"$ref": "#/components/schemas/SampleRestResourceWithInnerClass.InnerClass"
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
"Order/": {
|
|
363
|
-
"description": "Order related operations",
|
|
364
|
-
"get": {
|
|
365
|
-
"tags": [
|
|
366
|
-
"Order"
|
|
367
|
-
],
|
|
368
|
-
"requestBody": {
|
|
369
|
-
"content": {
|
|
370
|
-
"application/json": {
|
|
371
|
-
"schema": {
|
|
372
|
-
"type": "object",
|
|
373
|
-
"properties": {
|
|
374
|
-
"param1": {
|
|
375
|
-
"type": "string"
|
|
376
|
-
},
|
|
377
|
-
"param2": {
|
|
378
|
-
"$ref": "#/components/schemas/Reference1"
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
"responses": {
|
|
386
|
-
"200": {
|
|
387
|
-
"description": "Status code 200",
|
|
388
|
-
"content": {
|
|
389
|
-
"application/json": {
|
|
390
|
-
"schema": {
|
|
391
|
-
"type": "string"
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
"patch": {
|
|
399
|
-
"tags": [
|
|
400
|
-
"Order"
|
|
401
|
-
],
|
|
402
|
-
"requestBody": {
|
|
403
|
-
"content": {
|
|
404
|
-
"application/json": {
|
|
405
|
-
"schema": {
|
|
406
|
-
"type": "object",
|
|
407
|
-
"properties": {
|
|
408
|
-
"param1": {
|
|
409
|
-
"type": "string"
|
|
410
|
-
},
|
|
411
|
-
"param2": {
|
|
412
|
-
"$ref": "#/components/schemas/Reference1"
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
"responses": {
|
|
420
|
-
"200": {
|
|
421
|
-
"description": "Status code 200",
|
|
422
|
-
"content": {
|
|
423
|
-
"application/json": {
|
|
424
|
-
"schema": {
|
|
425
|
-
"type": "string"
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
"tags": [
|
|
435
|
-
{
|
|
436
|
-
"name": "Account Service",
|
|
437
|
-
"description": "Account related operations"
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
"name": "Contact",
|
|
441
|
-
"description": "Contact related operations"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
"name": "Order",
|
|
445
|
-
"description": "Order related operations"
|
|
446
|
-
}
|
|
447
|
-
],
|
|
448
|
-
"components": {
|
|
449
|
-
"schemas": {
|
|
450
|
-
"SampleClass": {
|
|
451
|
-
"type": "object",
|
|
452
|
-
"properties": {
|
|
453
|
-
"MyProp": {
|
|
454
|
-
"type": "string",
|
|
455
|
-
"description": "This is a String property."
|
|
456
|
-
},
|
|
457
|
-
"AnotherProp": {
|
|
458
|
-
"type": "number",
|
|
459
|
-
"description": "This is a Decimal property."
|
|
460
|
-
},
|
|
461
|
-
"listOfStrings": {
|
|
462
|
-
"type": "array",
|
|
463
|
-
"items": {
|
|
464
|
-
"type": "string"
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
"someVariable": {
|
|
468
|
-
"type": "string"
|
|
469
|
-
},
|
|
470
|
-
"somePrivateStuff": {
|
|
471
|
-
"type": "string"
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
"ChildClass": {
|
|
476
|
-
"type": "object",
|
|
477
|
-
"properties": {
|
|
478
|
-
"privateStringFromChild": {
|
|
479
|
-
"type": "string"
|
|
480
|
-
},
|
|
481
|
-
"aPrivateString": {
|
|
482
|
-
"type": "string"
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
"Reference1": {
|
|
487
|
-
"type": "object",
|
|
488
|
-
"properties": {
|
|
489
|
-
"reference2Member": {
|
|
490
|
-
"$ref": "#/components/schemas/Reference2",
|
|
491
|
-
"description": "This is a reference 2 member. Lorem."
|
|
492
|
-
},
|
|
493
|
-
"reference3Member": {
|
|
494
|
-
"$ref": "#/components/schemas/Reference3"
|
|
495
|
-
},
|
|
496
|
-
"reference4Collection": {
|
|
497
|
-
"type": "array",
|
|
498
|
-
"items": {
|
|
499
|
-
"$ref": "#/components/schemas/Reference4"
|
|
500
|
-
}
|
|
501
|
-
},
|
|
502
|
-
"reference5Member": {
|
|
503
|
-
"$ref": "#/components/schemas/Reference5"
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
"Reference2": {
|
|
508
|
-
"type": "object",
|
|
509
|
-
"properties": {
|
|
510
|
-
"stringMember": {
|
|
511
|
-
"type": "string"
|
|
512
|
-
},
|
|
513
|
-
"objectReference": {
|
|
514
|
-
"$ref": "#/components/schemas/Reference3_array",
|
|
515
|
-
"description": "This is an object reference."
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
"Reference3_array": {
|
|
520
|
-
"type": "array",
|
|
521
|
-
"items": {
|
|
522
|
-
"$ref": "#/components/schemas/Reference3"
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
"Reference3": {
|
|
526
|
-
"type": "object",
|
|
527
|
-
"properties": {
|
|
528
|
-
"someBoolean": {
|
|
529
|
-
"type": "boolean"
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
},
|
|
533
|
-
"Reference4": {
|
|
534
|
-
"type": "object",
|
|
535
|
-
"properties": {
|
|
536
|
-
"someString": {
|
|
537
|
-
"type": "string"
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
"Reference5": {
|
|
542
|
-
"type": "object",
|
|
543
|
-
"properties": {
|
|
544
|
-
"reference6Member": {
|
|
545
|
-
"$ref": "#/components/schemas/Reference6"
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
},
|
|
549
|
-
"Reference6": {
|
|
550
|
-
"type": "object",
|
|
551
|
-
"properties": {
|
|
552
|
-
"grandChildString": {
|
|
553
|
-
"type": "string",
|
|
554
|
-
"description": "This is the grandchild description."
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
},
|
|
558
|
-
"Reference1_array": {
|
|
559
|
-
"type": "array",
|
|
560
|
-
"items": {
|
|
561
|
-
"$ref": "#/components/schemas/Reference1"
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
"Reference7_Reference7[untypedObject:Reference2]": {
|
|
565
|
-
"type": "object",
|
|
566
|
-
"properties": {
|
|
567
|
-
"untypedObject": {
|
|
568
|
-
"$ref": "#/components/schemas/Reference2"
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
},
|
|
572
|
-
"SampleRestResourceWithInnerClass.InnerClass": {
|
|
573
|
-
"type": "object",
|
|
574
|
-
"properties": {
|
|
575
|
-
"stringMember": {
|
|
576
|
-
"type": "string"
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
12
|
+
"paths": {},
|
|
13
|
+
"tags": []
|
|
582
14
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Vitepress Example
|
|
2
|
+
|
|
3
|
+
This project contains an example on how to generate documentation to be rendered with [Vitepress](https://vitepress.dev/).
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
* Follow the Vitepress installation instructions [here](https://vitepress.dev/guide/getting-started#installation).
|
|
8
|
+
* Keep track of where you initialized your VitePress config. If it is different than the `docs` directory, you will
|
|
9
|
+
need to make sure that it matches the `targetDir` when configuring ApexDocs.
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
Take a look at the `apexdocs.config.ts` file to see how the configuration is set up.
|
|
14
|
+
|
|
15
|
+
Pay special attention to the following:
|
|
16
|
+
|
|
17
|
+
* `transformReference` -> This updates the reference links generated by ApexDocs to the preferred format for Vitepress.
|
|
18
|
+
|
|
19
|
+
This is **not** required, but Vitepress says in their documentation that they prefer when the links do not contain the .md extension.
|
|
20
|
+
|
|
21
|
+
* `transformReferenceGuide` -> This ensures that the `index` file always contains the correct frontmatter that Vitpress expects.
|
|
22
|
+
|
|
23
|
+
* `transformDocs` -> We use this hook to create a `sidebar` file that Vitepress uses to generate the sidebar navigation.
|
|
24
|
+
|
|
25
|
+
* `transformDocPage` -> This updates each individual page's frontmatter so that it has the correct title.
|
|
@@ -28,14 +28,21 @@ function writeFileAsync(filePath: string, data: string): Promise<void> {
|
|
|
28
28
|
export default defineMarkdownConfig({
|
|
29
29
|
sourceDir: 'force-app',
|
|
30
30
|
scope: ['global', 'public', 'protected', 'private', 'namespaceaccessible'],
|
|
31
|
+
sortAlphabetically: true,
|
|
31
32
|
namespace: 'apexdocs',
|
|
32
|
-
|
|
33
|
+
transformReference: (reference) => {
|
|
34
|
+
return {
|
|
35
|
+
// remove the trailing .md
|
|
36
|
+
referencePath: reference.referencePath.replace(/\.md$/, ''),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
transformReferenceGuide: async () => {
|
|
33
40
|
const frontMatter = await loadFileAsync('./docs/index-frontmatter.md');
|
|
34
41
|
return {
|
|
35
|
-
...referenceGuide,
|
|
36
42
|
frontmatter: frontMatter,
|
|
37
43
|
};
|
|
38
44
|
},
|
|
45
|
+
excludeTags: ['internal'],
|
|
39
46
|
transformDocs: async (docs) => {
|
|
40
47
|
// Update sidebar
|
|
41
48
|
const sidebar = [
|
|
@@ -19,38 +19,38 @@ hero:
|
|
|
19
19
|
|
|
20
20
|
## Miscellaneous
|
|
21
21
|
|
|
22
|
-
### [BaseClass](miscellaneous/BaseClass
|
|
22
|
+
### [BaseClass](miscellaneous/BaseClass)
|
|
23
23
|
|
|
24
|
-
### [MultiInheritanceClass](miscellaneous/MultiInheritanceClass
|
|
24
|
+
### [MultiInheritanceClass](miscellaneous/MultiInheritanceClass)
|
|
25
25
|
|
|
26
|
-
### [ParentInterface](miscellaneous/ParentInterface
|
|
26
|
+
### [ParentInterface](miscellaneous/ParentInterface)
|
|
27
27
|
|
|
28
|
-
### [ReferencedEnum](miscellaneous/ReferencedEnum
|
|
28
|
+
### [ReferencedEnum](miscellaneous/ReferencedEnum)
|
|
29
29
|
|
|
30
|
-
### [SampleException](miscellaneous/SampleException
|
|
30
|
+
### [SampleException](miscellaneous/SampleException)
|
|
31
31
|
|
|
32
32
|
This is a sample exception.
|
|
33
33
|
|
|
34
|
-
### [SampleInterface](miscellaneous/SampleInterface
|
|
34
|
+
### [SampleInterface](miscellaneous/SampleInterface)
|
|
35
35
|
|
|
36
36
|
This is a sample interface
|
|
37
37
|
|
|
38
|
-
### [Url](miscellaneous/Url
|
|
38
|
+
### [Url](miscellaneous/Url)
|
|
39
39
|
|
|
40
40
|
Represents a uniform resource locator (URL) and provides access to parts of the URL.
|
|
41
41
|
Enables access to the base URL used to access your Salesforce org.
|
|
42
42
|
|
|
43
43
|
## Sample Enums
|
|
44
44
|
|
|
45
|
-
### [SampleEnum](sample-enums/SampleEnum
|
|
45
|
+
### [SampleEnum](sample-enums/SampleEnum)
|
|
46
46
|
|
|
47
|
-
This is a sample enum. This references [ReferencedEnum](miscellaneous/ReferencedEnum
|
|
47
|
+
This is a sample enum. This references [ReferencedEnum](miscellaneous/ReferencedEnum) .
|
|
48
48
|
|
|
49
49
|
This description has several lines
|
|
50
50
|
|
|
51
51
|
## SampleGroup
|
|
52
52
|
|
|
53
|
-
### [SampleClass](samplegroup/SampleClass
|
|
53
|
+
### [SampleClass](samplegroup/SampleClass)
|
|
54
54
|
|
|
55
55
|
aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
|
|
56
|
-
deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
|
|
56
|
+
**deserunt** ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
|