@cparra/apexdocs 3.14.0 → 3.14.1
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 +66 -68
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,14 +18,14 @@ create a documentation site that fits your needs, hosted in any static web hosti
|
|
|
18
18
|
- [🚀 Features](#-features)
|
|
19
19
|
- [💿 Installation](#-installation)
|
|
20
20
|
- [⚡ Quick Start](#-quick-start)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
- [CLI](#cli)
|
|
22
|
+
- [Markdown](#markdown)
|
|
23
|
+
- [OpenApi](#openapi)
|
|
24
|
+
- [Changelog](#changelog)
|
|
25
25
|
- [▶️ Available Commands](#️-available-commands)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- [Markdown](#markdown-1)
|
|
27
|
+
- [OpenApi](#openapi-1)
|
|
28
|
+
- [Changelog](#changelog-1)
|
|
29
29
|
- [🔬 Defining a configuration file](#-defining-a-configuration-file)
|
|
30
30
|
- [🌐 Translation](#-translation)
|
|
31
31
|
- [⤵︎ Importing to your project](#︎-importing-to-your-project)
|
|
@@ -110,7 +110,7 @@ apexdocs markdown -s force-app
|
|
|
110
110
|
apexdocs markdown --useSfdxProjectJson
|
|
111
111
|
|
|
112
112
|
# Specify multiple source directories
|
|
113
|
-
apexdocs markdown --
|
|
113
|
+
apexdocs markdown --sourceDir force-app force-lwc force-utils
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
#### OpenApi
|
|
@@ -140,9 +140,8 @@ apexdocs changelog --previousVersionDir force-app-previous --currentVersionDir f
|
|
|
140
140
|
|
|
141
141
|
| Flag | Alias | Description | Default | Required |
|
|
142
142
|
|-----------------------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|----------|
|
|
143
|
-
| `--sourceDir` | `-s` | The directory where the source files are located.
|
|
144
|
-
| `--
|
|
145
|
-
| `--useSfdxProjectJson` | N/A | Read source directories from `sfdx-project.json` packageDirectories. Cannot be used with `--sourceDir` or `--sourceDirs`. | `false` | * |
|
|
143
|
+
| `--sourceDir` | `-s` | The directory or directories where the source files are located. | N/A | * |
|
|
144
|
+
| `--useSfdxProjectJson` | N/A | Read source directories from `sfdx-project.json` packageDirectories. Cannot be used with `--sourceDir`. | `false` | * |
|
|
146
145
|
| `--sfdxProjectPath` | N/A | Path to directory containing `sfdx-project.json` (defaults to current directory). Only used with `--useSfdxProjectJson`. | `process.cwd()` | No |
|
|
147
146
|
| `--targetDir` | `-t` | The directory where the generated files will be placed. | `docs` | No |
|
|
148
147
|
| `--scope` | `-p` | A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. | `[global]` | No |
|
|
@@ -158,8 +157,7 @@ apexdocs changelog --previousVersionDir force-app-previous --currentVersionDir f
|
|
|
158
157
|
| `--includeInlineHelpTextMetadata` | N/A | Whether to include the inline help text for fields in the generated files. | `false` | No |
|
|
159
158
|
|
|
160
159
|
> **Note:** The `*` in the Required column indicates that **one** of the source directory options must be specified:
|
|
161
|
-
> - `--sourceDir` (single directory)
|
|
162
|
-
> - `--sourceDirs` (multiple directories)
|
|
160
|
+
> - `--sourceDir` (single directory or array of directories)
|
|
163
161
|
> - `--useSfdxProjectJson` (read from sfdx-project.json)
|
|
164
162
|
>
|
|
165
163
|
> These options are mutually exclusive - you cannot use more than one at the same time.
|
|
@@ -396,61 +394,6 @@ There are hooks for both Markdown and Changelog operations (but not for OpenApi)
|
|
|
396
394
|
|
|
397
395
|
#### Markdown Hooks
|
|
398
396
|
|
|
399
|
-
##### **macros**
|
|
400
|
-
|
|
401
|
-
Allows defining custom macros that can be used in the documentation.
|
|
402
|
-
|
|
403
|
-
Macros are reusable pieces of text that can be injected into the documentation,
|
|
404
|
-
allowing you to define common pieces of text that you can use across multiple files.
|
|
405
|
-
|
|
406
|
-
A common use case is injecting copyright or license information, without
|
|
407
|
-
having to copy-paste the same text across multiple classes, polluting your
|
|
408
|
-
source code.
|
|
409
|
-
|
|
410
|
-
A macro can be defined in your documentation using the `{{macro_name}}` syntax.
|
|
411
|
-
In the configuration file, you can then define the macro behavior as a key-value pair, where the key is the name of the
|
|
412
|
-
macro, and the value is a function that returns the text to inject in place of the macro.
|
|
413
|
-
|
|
414
|
-
**Type**
|
|
415
|
-
|
|
416
|
-
```typescript
|
|
417
|
-
type MacroSourceMetadata = {
|
|
418
|
-
type: 'apex' | 'customobject' | 'customfield' | 'custommetadata' | 'trigger';
|
|
419
|
-
name: string;
|
|
420
|
-
filePath: string;
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
type MacroFunction = (metadata: MacroSourceMetadata) => string;
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
Notice that the `metadata` object contains information about the source of the file for which the macro is being
|
|
427
|
-
injected. This allows you to optionally
|
|
428
|
-
return different text based on the source of the file.
|
|
429
|
-
|
|
430
|
-
Example: Injecting a copyright notice
|
|
431
|
-
|
|
432
|
-
```typescript
|
|
433
|
-
//...
|
|
434
|
-
macros: {
|
|
435
|
-
copyright: () => {
|
|
436
|
-
return `@copyright Copyright (c) ${new Date().getFullYear()} My Name`;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
//...
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
And then in your source code, you can use the macro like this:
|
|
443
|
-
|
|
444
|
-
```apex
|
|
445
|
-
/**
|
|
446
|
-
* {{copyright}}
|
|
447
|
-
* @description This is a class
|
|
448
|
-
*/
|
|
449
|
-
public class MyClass {
|
|
450
|
-
//...
|
|
451
|
-
}
|
|
452
|
-
```
|
|
453
|
-
|
|
454
397
|
##### **transformReferenceGuide**
|
|
455
398
|
|
|
456
399
|
Allows changing the frontmatter and content of the reference guide, or if creating a reference guide page altogether
|
|
@@ -563,6 +506,61 @@ export default {
|
|
|
563
506
|
};
|
|
564
507
|
```
|
|
565
508
|
|
|
509
|
+
##### **macros**
|
|
510
|
+
|
|
511
|
+
Allows defining custom macros that can be used in the documentation.
|
|
512
|
+
|
|
513
|
+
Macros are reusable pieces of text that can be injected into the documentation,
|
|
514
|
+
allowing you to define common pieces of text that you can use across multiple files.
|
|
515
|
+
|
|
516
|
+
A common use case is injecting copyright or license information, without
|
|
517
|
+
having to copy-paste the same text across multiple classes, polluting your
|
|
518
|
+
source code.
|
|
519
|
+
|
|
520
|
+
A macro can be defined in your documentation using the `{{macro_name}}` syntax.
|
|
521
|
+
In the configuration file, you can then define the macro behavior as a key-value pair, where the key is the name of the
|
|
522
|
+
macro, and the value is a function that returns the text to inject in place of the macro.
|
|
523
|
+
|
|
524
|
+
**Type**
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
type MacroSourceMetadata = {
|
|
528
|
+
type: 'apex' | 'customobject' | 'customfield' | 'custommetadata' | 'trigger';
|
|
529
|
+
name: string;
|
|
530
|
+
filePath: string;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
type MacroFunction = (metadata: MacroSourceMetadata) => string;
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Notice that the `metadata` object contains information about the source of the file for which the macro is being
|
|
537
|
+
injected. This allows you to optionally
|
|
538
|
+
return different text based on the source of the file.
|
|
539
|
+
|
|
540
|
+
Example: Injecting a copyright notice
|
|
541
|
+
|
|
542
|
+
```typescript
|
|
543
|
+
//...
|
|
544
|
+
macros: {
|
|
545
|
+
copyright: () => {
|
|
546
|
+
return `@copyright Copyright (c) ${new Date().getFullYear()} My Name`;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
//...
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
And then in your source code, you can use the macro like this:
|
|
553
|
+
|
|
554
|
+
```apex
|
|
555
|
+
/**
|
|
556
|
+
* {{copyright}}
|
|
557
|
+
* @description This is a class
|
|
558
|
+
*/
|
|
559
|
+
public class MyClass {
|
|
560
|
+
//...
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
566
564
|
#### Changelog Hooks
|
|
567
565
|
|
|
568
566
|
##### **transformChangeLogPage**
|