@cparra/apexdocs 3.4.2 โ 3.6.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 +34 -6
- package/dist/cli/generate.js +1 -1
- package/dist/index.d.ts +35 -8
- package/dist/index.js +1 -1
- package/dist/{logger-D84qiac7.js โ logger-0jxxZOAh.js} +851 -488
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ create a documentation site that fits your needs, hosted in any static web hosti
|
|
|
17
17
|
ApexDocs generates Markdown files, which can be integrated into any Static Site Generation (SSG) engine,
|
|
18
18
|
(e.g. Jekyll, Vitepress, Hugo, Docosaurus, etc.) to create a documentation site that fits your needs.
|
|
19
19
|
|
|
20
|
-
This gives you the flexibility to create beautiful leveraging your preferred SSG engine, which
|
|
20
|
+
This gives you the flexibility to create beautiful sites by leveraging your preferred SSG engine, which
|
|
21
21
|
usually provides a wide range of themes, dark mode support, and other features out of the box.
|
|
22
22
|
|
|
23
23
|
<div align="center">
|
|
@@ -335,9 +335,11 @@ of different hooks that will be called at different stages of the documentation
|
|
|
335
335
|
|
|
336
336
|
All hooks can be async functions, allowing you to make asynchronous operations, like calling an external API.
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
There are hooks for both Markdown and Changelog operations (but not for OpenApi).
|
|
339
339
|
|
|
340
|
-
####
|
|
340
|
+
#### Markdown Hooks
|
|
341
|
+
|
|
342
|
+
##### **transformReferenceGuide**
|
|
341
343
|
|
|
342
344
|
Allows changing the Allows changing the frontmatter and content of the reference guide, or even if creating a reference
|
|
343
345
|
guide page should be skipped.
|
|
@@ -374,7 +376,7 @@ export default defineMarkdownConfig({
|
|
|
374
376
|
});
|
|
375
377
|
```
|
|
376
378
|
|
|
377
|
-
|
|
379
|
+
##### **transformDocs**
|
|
378
380
|
|
|
379
381
|
The main purpose of this hook is to allow you to skip the generation of specific pages,
|
|
380
382
|
by returning a filtered array of `DocPageData` objects.
|
|
@@ -397,7 +399,7 @@ export default {
|
|
|
397
399
|
};
|
|
398
400
|
```
|
|
399
401
|
|
|
400
|
-
|
|
402
|
+
##### **transformDocPage**
|
|
401
403
|
|
|
402
404
|
Allows changing the frontmatter and content of the doc page.
|
|
403
405
|
|
|
@@ -421,7 +423,7 @@ export default {
|
|
|
421
423
|
};
|
|
422
424
|
```
|
|
423
425
|
|
|
424
|
-
|
|
426
|
+
##### **transformReference**
|
|
425
427
|
|
|
426
428
|
Allows changing where the files are written to and how files are linked to each other.
|
|
427
429
|
|
|
@@ -449,6 +451,32 @@ export default {
|
|
|
449
451
|
};
|
|
450
452
|
```
|
|
451
453
|
|
|
454
|
+
#### Changelog Hooks
|
|
455
|
+
|
|
456
|
+
##### **transformChangeLogPage**
|
|
457
|
+
|
|
458
|
+
Allows changing the frontmatter and content of the changelog page.
|
|
459
|
+
|
|
460
|
+
**Type**
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
type TransformChangeLogPage = (
|
|
464
|
+
changelog: ChangeLogPageData,
|
|
465
|
+
) => Partial<ChangeLogPageData> | Promise<Partial<ChangeLogPageData>>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Example
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
export default {
|
|
472
|
+
transformChangeLogPage: (changelog) => {
|
|
473
|
+
return {
|
|
474
|
+
frontmatter: { example: 'example' }
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
```
|
|
479
|
+
|
|
452
480
|
## โคต๏ธ Importing to your project
|
|
453
481
|
|
|
454
482
|
### Reflection
|
package/dist/cli/generate.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ type UserDefinedMarkdownConfig = {
|
|
|
29
29
|
excludeTags: string[];
|
|
30
30
|
exclude: string[];
|
|
31
31
|
} & CliConfigurableMarkdownConfig &
|
|
32
|
-
Partial<
|
|
32
|
+
Partial<MarkdownConfigurableHooks>;
|
|
33
33
|
|
|
34
34
|
type UserDefinedOpenApiConfig = {
|
|
35
35
|
targetGenerator: 'openapi';
|
|
@@ -51,18 +51,31 @@ type UserDefinedChangelogConfig = {
|
|
|
51
51
|
scope: string[];
|
|
52
52
|
exclude: string[];
|
|
53
53
|
skipIfNoChanges: boolean;
|
|
54
|
-
}
|
|
54
|
+
} & Partial<ChangelogConfigurableHooks>;
|
|
55
55
|
|
|
56
56
|
type UserDefinedConfig = UserDefinedMarkdownConfig | UserDefinedOpenApiConfig | UserDefinedChangelogConfig;
|
|
57
57
|
|
|
58
|
+
type MetadataTypes = 'interface' | 'class' | 'enum' | 'customobject' | 'customfield';
|
|
59
|
+
|
|
58
60
|
type SourceFileMetadata = {
|
|
59
61
|
filePath: string;
|
|
60
62
|
name: string;
|
|
61
|
-
type:
|
|
63
|
+
type: MetadataTypes;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// External metadata is metadata that does not live directly in the source code, and thus we don't
|
|
67
|
+
// have a file path for it.
|
|
68
|
+
// This is metadata derived from other information.
|
|
69
|
+
// For example, for an "extension"
|
|
70
|
+
// field that extends a Salesforce object or object in a different package, we want to capture the parent
|
|
71
|
+
// object, even if the file for that object was not parsed.
|
|
72
|
+
type ExternalMetadata = {
|
|
73
|
+
name: string;
|
|
74
|
+
type: MetadataTypes;
|
|
62
75
|
};
|
|
63
76
|
|
|
64
77
|
type DocPageReference = {
|
|
65
|
-
source: SourceFileMetadata;
|
|
78
|
+
source: SourceFileMetadata | ExternalMetadata;
|
|
66
79
|
// The name under which the type should be displayed in the documentation.
|
|
67
80
|
// By default, this will match the source.name, but it can be configured by the user.
|
|
68
81
|
displayName: string;
|
|
@@ -84,7 +97,7 @@ type ReferenceGuidePageData = {
|
|
|
84
97
|
};
|
|
85
98
|
|
|
86
99
|
type DocPageData = {
|
|
87
|
-
source: SourceFileMetadata;
|
|
100
|
+
source: SourceFileMetadata | ExternalMetadata;
|
|
88
101
|
group: string | null;
|
|
89
102
|
outputDocPath: string;
|
|
90
103
|
frontmatter: Frontmatter;
|
|
@@ -92,6 +105,12 @@ type DocPageData = {
|
|
|
92
105
|
type: 'class' | 'interface' | 'enum' | 'customobject';
|
|
93
106
|
};
|
|
94
107
|
|
|
108
|
+
type ChangeLogPageData = {
|
|
109
|
+
frontmatter: Frontmatter;
|
|
110
|
+
content: string;
|
|
111
|
+
outputDocPath: string;
|
|
112
|
+
};
|
|
113
|
+
|
|
95
114
|
/**
|
|
96
115
|
* Represents a file to be skipped.
|
|
97
116
|
*/
|
|
@@ -102,9 +121,9 @@ type Skip = {
|
|
|
102
121
|
// CONFIGURABLE HOOKS
|
|
103
122
|
|
|
104
123
|
/**
|
|
105
|
-
* The configurable hooks that can be used to modify the output of the generator.
|
|
124
|
+
* The configurable hooks that can be used to modify the output of the Markdown generator.
|
|
106
125
|
*/
|
|
107
|
-
type
|
|
126
|
+
type MarkdownConfigurableHooks = {
|
|
108
127
|
transformReferenceGuide: TransformReferenceGuide;
|
|
109
128
|
transformDocs: TransformDocs;
|
|
110
129
|
transformDocPage: TransformDocPage;
|
|
@@ -143,6 +162,14 @@ type TransformDocPage = (
|
|
|
143
162
|
doc: DocPageData,
|
|
144
163
|
) => Partial<ConfigurableDocPageData> | Promise<Partial<ConfigurableDocPageData>>;
|
|
145
164
|
|
|
165
|
+
type ChangelogConfigurableHooks = {
|
|
166
|
+
transformChangeLogPage: TransformChangelogPage;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type TransformChangelogPage = (
|
|
170
|
+
page: ChangeLogPageData,
|
|
171
|
+
) => Partial<ChangeLogPageData> | Promise<Partial<ChangeLogPageData>>;
|
|
172
|
+
|
|
146
173
|
/**
|
|
147
174
|
* Represents a file to be skipped.
|
|
148
175
|
*/
|
|
@@ -177,4 +204,4 @@ type ConfigurableChangelogConfig = Omit<Partial<UserDefinedChangelogConfig>, 'ta
|
|
|
177
204
|
*/
|
|
178
205
|
declare function defineChangelogConfig(config: ConfigurableChangelogConfig): Partial<UserDefinedChangelogConfig>;
|
|
179
206
|
|
|
180
|
-
export { type
|
|
207
|
+
export { type ChangeLogPageData, type ChangelogConfigurableHooks, type ConfigurableChangelogConfig, type ConfigurableDocPageData, type ConfigurableDocPageReference, type ConfigurableMarkdownConfig, type ConfigurableOpenApiConfig, type DocPageData, type DocPageReference, type MarkdownConfigurableHooks, type ReferenceGuidePageData, type Skip, type TransformChangelogPage, type TransformDocPage, type TransformDocs, type TransformReference, type TransformReferenceGuide, defineChangelogConfig, defineMarkdownConfig, defineOpenApiConfig, process, skip };
|