@cparra/apexdocs 3.13.0 β 3.14.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 +95 -0
- package/dist/cli/generate.js +1 -1
- package/dist/index.d.ts +140 -1
- package/dist/index.js +1 -1
- package/dist/{logger-BiPQ_i9-.js β logger-D4Q3KA6D.js} +507 -275
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,26 @@ ApexDocs is a non-opinionated documentation generator for Salesforce Apex classe
|
|
|
12
12
|
It can output documentation in Markdown format, which allows you to use the Static Site Generator of your choice to
|
|
13
13
|
create a documentation site that fits your needs, hosted in any static web hosting service.
|
|
14
14
|
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
- [π Examples](#-examples)
|
|
18
|
+
- [π Features](#-features)
|
|
19
|
+
- [πΏ Installation](#-installation)
|
|
20
|
+
- [β‘ Quick Start](#-quick-start)
|
|
21
|
+
- [CLI](#cli)
|
|
22
|
+
- [Markdown](#markdown)
|
|
23
|
+
- [OpenApi](#openapi)
|
|
24
|
+
- [Changelog](#changelog)
|
|
25
|
+
- [βΆοΈ Available Commands](#οΈ-available-commands)
|
|
26
|
+
- [Markdown](#markdown-1)
|
|
27
|
+
- [OpenApi](#openapi-1)
|
|
28
|
+
- [Changelog](#changelog-1)
|
|
29
|
+
- [π¬ Defining a configuration file](#-defining-a-configuration-file)
|
|
30
|
+
- [π Translation](#-translation)
|
|
31
|
+
- [β€΅οΈ Importing to your project](#οΈ-importing-to-your-project)
|
|
32
|
+
- [π Documentation Guide](#-documentation-guide)
|
|
33
|
+
- [π Generating OpenApi REST Definitions](#-generating-openapi-rest-definitions)
|
|
34
|
+
|
|
15
35
|
## π Examples
|
|
16
36
|
|
|
17
37
|
ApexDocs generates Markdown files, which can be integrated into any Static Site Generation (SSG) engine,
|
|
@@ -64,6 +84,7 @@ Here are some live projects using ApexDocs:
|
|
|
64
84
|
* Support for ignoring files and members from being documented
|
|
65
85
|
* Namespace support
|
|
66
86
|
* Configuration file support
|
|
87
|
+
* Translation support for different languages and custom terminology
|
|
67
88
|
* Single line ApexDoc Blocks
|
|
68
89
|
* Custom tag support
|
|
69
90
|
* And much, much more!
|
|
@@ -274,6 +295,12 @@ export default defineMarkdownConfig({
|
|
|
274
295
|
sourceDir: 'force-app',
|
|
275
296
|
targetDir: 'docs',
|
|
276
297
|
scope: ['global', 'public'],
|
|
298
|
+
translations: {
|
|
299
|
+
sections: {
|
|
300
|
+
methods: 'Methods',
|
|
301
|
+
properties: 'Properties',
|
|
302
|
+
},
|
|
303
|
+
},
|
|
277
304
|
...
|
|
278
305
|
});
|
|
279
306
|
```
|
|
@@ -595,6 +622,74 @@ export default {
|
|
|
595
622
|
};
|
|
596
623
|
```
|
|
597
624
|
|
|
625
|
+
## π Translation
|
|
626
|
+
|
|
627
|
+
ApexDocs supports translations to customize the language and terminology used in the generated documentation.
|
|
628
|
+
This feature allows you to:
|
|
629
|
+
|
|
630
|
+
- **Translate documentation to different languages** (Spanish, French, etc.)
|
|
631
|
+
- **Use custom business terminology** (e.g., "Business Operations" instead of "Methods")
|
|
632
|
+
- **Partially override specific terms** while keeping the rest in English
|
|
633
|
+
|
|
634
|
+
### How It Works
|
|
635
|
+
|
|
636
|
+
The translation system uses:
|
|
637
|
+
|
|
638
|
+
- **Default English translations** built into the system
|
|
639
|
+
- **User-provided overrides** that can be partial or complete
|
|
640
|
+
|
|
641
|
+
### Configuration
|
|
642
|
+
|
|
643
|
+
Add a `translations` property to your ApexDocs configuration (JS or TS file) and pass
|
|
644
|
+
the appropriate translation object, depending on the generator you're using:
|
|
645
|
+
|
|
646
|
+
```javascript
|
|
647
|
+
import { defineMarkdownConfig } from '@cparra/apexdocs';
|
|
648
|
+
|
|
649
|
+
export default defineMarkdownConfig({
|
|
650
|
+
sourceDir: 'src',
|
|
651
|
+
targetDir: 'docs',
|
|
652
|
+
scope: ['public', 'global'],
|
|
653
|
+
translations: {
|
|
654
|
+
sections: {
|
|
655
|
+
methods: 'MΓ©todos',
|
|
656
|
+
properties: 'Propiedades',
|
|
657
|
+
fields: 'Campos',
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### TypeScript Support
|
|
664
|
+
|
|
665
|
+
For TypeScript projects, import the translation types for better autocomplete and type safety:
|
|
666
|
+
|
|
667
|
+
```typescript
|
|
668
|
+
import { defineMarkdownConfig } from '@cparra/apexdocs';
|
|
669
|
+
import type { UserTranslations } from '@cparra/apexdocs';
|
|
670
|
+
|
|
671
|
+
const markdownTranslations: UserTranslations['markdown'] = {
|
|
672
|
+
sections: {
|
|
673
|
+
methods: 'Functions',
|
|
674
|
+
},
|
|
675
|
+
// ...other translation keys as needed
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
export default defineMarkdownConfig({
|
|
679
|
+
sourceDir: 'src',
|
|
680
|
+
targetDir: 'docs',
|
|
681
|
+
scope: ['public', 'global'],
|
|
682
|
+
translations: markdownTranslations,
|
|
683
|
+
});
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
### Notes
|
|
687
|
+
|
|
688
|
+
- Only the **markdown** and **changelog** generators support translations
|
|
689
|
+
- All translations are optional - anything not specified uses the English default
|
|
690
|
+
|
|
691
|
+
For a complete example, see the [translation example](examples/translation/) in this repository.
|
|
692
|
+
|
|
598
693
|
## β€΅οΈ Importing to your project
|
|
599
694
|
|
|
600
695
|
### Reflection
|
package/dist/cli/generate.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default English translations for ApexDocs.
|
|
3
|
+
* These can be overridden by users in their configuration.
|
|
4
|
+
*/
|
|
5
|
+
type Translations = {
|
|
6
|
+
changelog: {
|
|
7
|
+
title: string;
|
|
8
|
+
newClasses: {
|
|
9
|
+
heading: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
newInterfaces: {
|
|
13
|
+
heading: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
newEnums: {
|
|
17
|
+
heading: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
newCustomObjects: {
|
|
21
|
+
heading: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
newTriggers: {
|
|
25
|
+
heading: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
removedTypes: {
|
|
29
|
+
heading: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
removedCustomObjects: {
|
|
33
|
+
heading: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
removedTriggers: {
|
|
37
|
+
heading: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
newOrModifiedMembers: {
|
|
41
|
+
heading: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
newOrRemovedCustomFields: {
|
|
45
|
+
heading: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
newOrRemovedCustomMetadataTypeRecords: {
|
|
49
|
+
heading: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
memberModifications: {
|
|
53
|
+
newEnumValue: string;
|
|
54
|
+
removedEnumValue: string;
|
|
55
|
+
newMethod: string;
|
|
56
|
+
removedMethod: string;
|
|
57
|
+
newProperty: string;
|
|
58
|
+
removedProperty: string;
|
|
59
|
+
newField: string;
|
|
60
|
+
removedField: string;
|
|
61
|
+
newType: string;
|
|
62
|
+
removedType: string;
|
|
63
|
+
newCustomMetadataRecord: string;
|
|
64
|
+
removedCustomMetadataRecord: string;
|
|
65
|
+
newTrigger: string;
|
|
66
|
+
removedTrigger: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
markdown: {
|
|
70
|
+
sections: {
|
|
71
|
+
methods: string;
|
|
72
|
+
properties: string;
|
|
73
|
+
fields: string;
|
|
74
|
+
constructors: string;
|
|
75
|
+
values: string;
|
|
76
|
+
classes: string;
|
|
77
|
+
enums: string;
|
|
78
|
+
interfaces: string;
|
|
79
|
+
namespace: string;
|
|
80
|
+
records: string;
|
|
81
|
+
publishBehavior: string;
|
|
82
|
+
};
|
|
83
|
+
details: {
|
|
84
|
+
type: string;
|
|
85
|
+
signature: string;
|
|
86
|
+
group: string;
|
|
87
|
+
author: string;
|
|
88
|
+
date: string;
|
|
89
|
+
see: string;
|
|
90
|
+
possibleValues: string;
|
|
91
|
+
parameters: string;
|
|
92
|
+
throws: string;
|
|
93
|
+
returnType: string;
|
|
94
|
+
apiName: string;
|
|
95
|
+
required: string;
|
|
96
|
+
inlineHelpText: string;
|
|
97
|
+
complianceGroup: string;
|
|
98
|
+
securityClassification: string;
|
|
99
|
+
protected: string;
|
|
100
|
+
};
|
|
101
|
+
typeSuffixes: {
|
|
102
|
+
class: string;
|
|
103
|
+
interface: string;
|
|
104
|
+
enum: string;
|
|
105
|
+
trigger: string;
|
|
106
|
+
};
|
|
107
|
+
triggerEvents: {
|
|
108
|
+
beforeInsert: string;
|
|
109
|
+
beforeUpdate: string;
|
|
110
|
+
beforeDelete: string;
|
|
111
|
+
afterInsert: string;
|
|
112
|
+
afterUpdate: string;
|
|
113
|
+
afterDelete: string;
|
|
114
|
+
afterUndelete: string;
|
|
115
|
+
};
|
|
116
|
+
publishBehaviors: {
|
|
117
|
+
publishImmediately: string;
|
|
118
|
+
publishAfterCommit: string;
|
|
119
|
+
};
|
|
120
|
+
inheritance: {
|
|
121
|
+
inheritance: string;
|
|
122
|
+
implements: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* User-provided partial translations that can override the defaults.
|
|
129
|
+
*/
|
|
130
|
+
type UserTranslations = DeepPartial<Translations>;
|
|
131
|
+
/**
|
|
132
|
+
* Utility type to make all properties in T optional recursively.
|
|
133
|
+
*/
|
|
134
|
+
type DeepPartial<T> = {
|
|
135
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
136
|
+
};
|
|
137
|
+
|
|
1
138
|
type Generators = 'markdown' | 'openapi' | 'changelog';
|
|
2
139
|
|
|
3
140
|
type LinkingStrategy =
|
|
@@ -42,6 +179,7 @@ type UserDefinedMarkdownConfig = {
|
|
|
42
179
|
targetGenerator: 'markdown';
|
|
43
180
|
excludeTags: string[];
|
|
44
181
|
exclude: string[];
|
|
182
|
+
translations?: UserTranslations['markdown'];
|
|
45
183
|
} & CliConfigurableMarkdownConfig &
|
|
46
184
|
Partial<MarkdownConfigurableHooks>;
|
|
47
185
|
|
|
@@ -68,6 +206,7 @@ type UserDefinedChangelogConfig = {
|
|
|
68
206
|
customObjectVisibility: string[];
|
|
69
207
|
exclude: string[];
|
|
70
208
|
skipIfNoChanges: boolean;
|
|
209
|
+
translations?: UserTranslations['changelog'];
|
|
71
210
|
} & Partial<ChangelogConfigurableHooks>;
|
|
72
211
|
|
|
73
212
|
type UserDefinedConfig = UserDefinedMarkdownConfig | UserDefinedOpenApiConfig | UserDefinedChangelogConfig;
|
|
@@ -247,4 +386,4 @@ type ConfigurableChangelogConfig = Omit<Partial<UserDefinedChangelogConfig>, 'ta
|
|
|
247
386
|
*/
|
|
248
387
|
declare function defineChangelogConfig(config: ConfigurableChangelogConfig): Partial<UserDefinedChangelogConfig>;
|
|
249
388
|
|
|
250
|
-
export { type ChangeLogPageData, type ChangelogConfigurableHooks, type ConfigurableChangelogConfig, type ConfigurableDocPageData, type ConfigurableDocPageReference, type ConfigurableMarkdownConfig, type ConfigurableOpenApiConfig, type DocPageData, type DocPageReference, type MacroFunction, type MacroSourceMetadata, type MarkdownConfigurableHooks, type ReferenceGuidePageData, type Skip, type SourceChangelog, type TransformChangelogPage, type TransformDocPage, type TransformDocs, type TransformReference, type TransformReferenceGuide, defineChangelogConfig, defineMarkdownConfig, defineOpenApiConfig, process, skip };
|
|
389
|
+
export { type ChangeLogPageData, type ChangelogConfigurableHooks, type ConfigurableChangelogConfig, type ConfigurableDocPageData, type ConfigurableDocPageReference, type ConfigurableMarkdownConfig, type ConfigurableOpenApiConfig, type DocPageData, type DocPageReference, type MacroFunction, type MacroSourceMetadata, type MarkdownConfigurableHooks, type ReferenceGuidePageData, type Skip, type SourceChangelog, type TransformChangelogPage, type TransformDocPage, type TransformDocs, type TransformReference, type TransformReferenceGuide, type Translations, type UserTranslations, defineChangelogConfig, defineMarkdownConfig, defineOpenApiConfig, process, skip };
|