Skip to content

Commit 04ea220

Browse files
authored
Merge pull request #273 from cesarParra/doc-update
Documentation updates
2 parents ce06a43 + 457c961 commit 04ea220

File tree

12 files changed

+65
-915
lines changed

12 files changed

+65
-915
lines changed

README.md

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ create a documentation site that fits your needs, hosted in any static web hosti
1818
- [🚀 Features](#-features)
1919
- [💿 Installation](#-installation)
2020
- [⚡ Quick Start](#-quick-start)
21-
- [CLI](#cli)
22-
- [Markdown](#markdown)
23-
- [OpenApi](#openapi)
24-
- [Changelog](#changelog)
21+
- [CLI](#cli)
22+
- [Markdown](#markdown)
23+
- [OpenApi](#openapi)
24+
- [Changelog](#changelog)
2525
- [▶️ Available Commands](#️-available-commands)
26-
- [Markdown](#markdown-1)
27-
- [OpenApi](#openapi-1)
28-
- [Changelog](#changelog-1)
26+
- [Markdown](#markdown-1)
27+
- [OpenApi](#openapi-1)
28+
- [Changelog](#changelog-1)
2929
- [🔬 Defining a configuration file](#-defining-a-configuration-file)
3030
- [🌐 Translation](#-translation)
3131
- [⤵︎ Importing to your project](#︎-importing-to-your-project)
@@ -140,9 +140,8 @@ apexdocs changelog --previousVersionDir force-app-previous --currentVersionDir f
140140

141141
| Flag | Alias | Description | Default | Required |
142142
|-----------------------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|----------|
143-
| `--sourceDir` | `-s` | The directory where the source files are located. | N/A | * |
144-
| `--sourceDirs` | N/A | Multiple source directories (space-separated). Cannot be used with `--sourceDir` or `--useSfdxProjectJson`. | N/A | * |
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` | * |
146145
| `--sfdxProjectPath` | N/A | Path to directory containing `sfdx-project.json` (defaults to current directory). Only used with `--useSfdxProjectJson`. | `process.cwd()` | No |
147146
| `--targetDir` | `-t` | The directory where the generated files will be placed. | `docs` | No |
148147
| `--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
158157
| `--includeInlineHelpTextMetadata` | N/A | Whether to include the inline help text for fields in the generated files. | `false` | No |
159158

160159
> **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)
163161
> - `--useSfdxProjectJson` (read from sfdx-project.json)
164162
>
165163
> 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)
396394

397395
#### Markdown Hooks
398396

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-
454397
##### **transformReferenceGuide**
455398

456399
Allows changing the frontmatter and content of the reference guide, or if creating a reference guide page altogether
@@ -563,6 +506,61 @@ export default {
563506
};
564507
```
565508

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+
566564
#### Changelog Hooks
567565

568566
##### **transformChangeLogPage**

examples/sfdx-multi-dir/README.md

Lines changed: 0 additions & 101 deletions
This file was deleted.

examples/sfdx-multi-dir/docs/account-management/AccountService.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

examples/sfdx-multi-dir/docs/index.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)