Skip to content

Commit 7e0e85a

Browse files
authored
Merge pull request #279 from cesarParra/jsdocs
LWC documentation support.
2 parents a32ce78 + 81ebac4 commit 7e0e85a

File tree

60 files changed

+11573
-5705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+11573
-5705
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Here are some live projects using ApexDocs:
7777

7878
## 🚀 Features
7979

80-
* Generate documentation for Salesforce Apex classes as Markdown files
80+
* Generate documentation for Salesforce code (Apex, triggers, custom objects, LWCs) as Markdown files
8181
* Generate an OpenApi REST specification based on `@RestResource` classes
8282
* Generate a changelog based on the differences between two versions of your Salesforce Apex classes
8383
* Support for grouping blocks of related code within a class
@@ -149,10 +149,11 @@ apexdocs changelog --previousVersionDir force-app-previous --currentVersionDir f
149149
| `--defaultGroupName` | N/A | The default group name to use when a group is not specified. | `Miscellaneous` | No |
150150
| `--namespace` | N/A | The package namespace, if any. If provided, it will be added to the generated files. | N/A | No |
151151
| `--sortAlphabetically` | N/A | Sorts files appearing in the Reference Guide alphabetically, as well as the members of a class, interface or enum alphabetically. If false, the members will be displayed in the same order as the code. | `false` | No |
152-
| `--includeMetadata ` | N/A | Whether to include the file's meta.xml information: Whether it is active and and the API version | `false` | No |
152+
| `--includeMetadata ` | N/A | Whether to include the file's meta.xml information: Whether it is active and the API version | `false` | No |
153153
| `--linkingStrategy` | N/A | The strategy to use when linking to other classes. Possible values are `relative`, `no-link`, and `none` | `relative` | No |
154154
| `--customObjectsGroupName` | N/A | The name under which custom objects will be grouped in the Reference Guide | `Custom Objects` | No |
155155
| `--triggersGroupName` | N/A | The name under which triggers will be grouped in the Reference Guide | `Triggers` | No |
156+
| `--lwcGroupName` | N/A | The name under which Lightning Web Components will be grouped in the Reference Guide | `Triggers` | No |
156157
| `--includeFieldSecurityMetadata` | N/A | Whether to include the compliance category and security classification for fields in the generated files. | `false` | No |
157158
| `--includeInlineHelpTextMetadata` | N/A | Whether to include the inline help text for fields in the generated files. | `false` | No |
158159

@@ -336,6 +337,15 @@ Then you only need to run the top level `apexdocs` command, and it will generate
336337
Note that you can still run the individual commands if you only want to generate one type of documentation by
337338
providing the subcommand, e.g `apexdocs markdown` or `apexdocs changelog`.
338339

340+
### LWC Documentation Limitations
341+
342+
ApexDocs supports generating documentation for Lightning Web Components (LWC) as well, but please
343+
be aware of the following limitations:
344+
345+
* Only components marked as `isExposed=true` in the component's meta.xml file will be documented.
346+
* At the moment, any JSDoc comments are ignored, documentation is based solely on the component's metadata.
347+
* Changelog generation does not include changes to LWCs.
348+
339349
### Excluding Files from Being Documented
340350

341351
Any pattern included in the `.forceignore` file will be excluded from the documentation.
@@ -525,7 +535,7 @@ macro, and the value is a function that returns the text to inject in place of t
525535

526536
```typescript
527537
type MacroSourceMetadata = {
528-
type: 'apex' | 'customobject' | 'customfield' | 'custommetadata' | 'trigger';
538+
type: 'apex' | 'customobject' | 'customfield' | 'custommetadata' | 'trigger' | 'lwc';
529539
name: string;
530540
filePath: string;
531541
};

examples/markdown/docs/custom-objects/Event__c.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ Represents an event that people can register for.
4545

4646
Used to store the U.S. social security number in 9 digit format.
4747

48-
**Compliance Group**
49-
PII
50-
51-
**Security Classification**
52-
Internal
53-
5448
**API Name**
5549

5650
`ns__Social_Security_Number__c`

examples/markdown/docs/index.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,30 @@ Represents an event that people can register for.
1212

1313
### [Price_Component__c](custom-objects/Price_Component__c.md)
1414

15-
### [Product_Price_Component__c](custom-objects/Product_Price_Component__c.md)
16-
1715
### [Product__c](custom-objects/Product__c.md)
1816

1917
Product that is sold or available for sale.
2018

21-
### [Sales_Order_Line__c](custom-objects/Sales_Order_Line__c.md)
22-
23-
Represents a line item on a sales order.
19+
### [Product_Price_Component__c](custom-objects/Product_Price_Component__c.md)
2420

2521
### [Sales_Order__c](custom-objects/Sales_Order__c.md)
2622

2723
Custom object for tracking sales orders.
2824

25+
### [Sales_Order_Line__c](custom-objects/Sales_Order_Line__c.md)
26+
27+
Represents a line item on a sales order.
28+
2929
### [Speaker__c](custom-objects/Speaker__c.md)
3030

3131
Represents a speaker at an event.
3232

33+
## Lightning Web Components
34+
35+
### [accordion](lightning-web-components/accordion.md)
36+
37+
Accordion
38+
3339
## Miscellaneous
3440

3541
### [BaseClass](miscellaneous/BaseClass.md)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# accordion
2+
3+
`Exposed`
4+
5+
Accordion
6+
7+
## Targets
8+
- lightningCommunity__Default
9+
- lightningCommunity__Page
10+
11+
## Target Configs
12+
13+
### lightningCommunity__Default
14+
15+
#### Properties
16+
17+
**Auto Collapse** `autoCollapse`
18+
19+
Whether to automatically collapse the accordion when a new section is expanded.
20+
21+
- **Type:** Boolean
22+
- **Required:** false
23+
24+
**Context URL Parameter** `contextUrlParam`
25+
26+
Optional - The name of the URL parameter that contains the context ID.
27+
28+
- **Type:** String
29+
- **Required:** false
30+
31+
**Formula Expression** `expr`
32+
33+
Formula expression to be evaluated.
34+
35+
- **Type:** String
36+
- **Required:** true
37+
38+
**Flush Style** `flushStyle`
39+
40+
Removes the background color and rounded borders from the accordion component.
41+
42+
- **Type:** Boolean
43+
- **Required:** false
44+
45+
**Preview Context ID** `previewContextId`
46+
47+
Optional - The ID of the context record to use when previewing the component in the builder.
48+
49+
- **Type:** String
50+
- **Required:** false
51+
52+
**Respect Sharing** `respectSharing`
53+
54+
Whether to run the evaluation with or without sharing.
55+
56+
- **Type:** Boolean
57+
- **Required:** false

examples/markdown/docs/miscellaneous/SampleException.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a sample exception.
44

5-
**Usage**
5+
**Usage**
66

77
You can use the exception the following way.
88
You can also take a look at [SampleClass](../samplegroup/SampleClass.md) to see how it is used.

examples/markdown/docs/miscellaneous/SampleInterface.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This is a sample interface
66

7-
**Mermaid**
7+
**Mermaid**
88

99
```mermaid
1010
graph TD
@@ -40,15 +40,15 @@ sampleInterface.sampleMethod();
4040

4141
This is a sample method
4242

43-
**Custom Tag**
43+
**Custom Tag**
4444

4545
This is a custom tag
4646

47-
**Another Custom Tag**
47+
**Another Custom Tag**
4848

4949
This is another custom tag
5050

51-
**Mermaid**
51+
**Mermaid**
5252

5353
graph TD
5454
A[SampleInterface] -->|extends| B[ParentInterface]

examples/markdown/docs/miscellaneous/Url.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ global Url(String spec)
9797

9898
Creates a new instance of the URL class by parsing the specified spec within the specified context.
9999

100-
**Usage**
100+
**Usage**
101101

102102
The new URL is created from the given context URL and the spec argument as described in RFC2396 "Uniform Resource Identifiers : Generic * Syntax" :
103103
```xml
@@ -176,7 +176,7 @@ The authority portion of the current URL.
176176

177177
Returns the URL of an entire request on a Salesforce instance.
178178

179-
**Usage**
179+
**Usage**
180180

181181
An example of a URL for an entire request is https://yourInstance.salesforce.com/apex/myVfPage.apexp.
182182

@@ -196,7 +196,7 @@ The URL of the entire request.
196196

197197
Returns the default port number of the protocol associated with the current URL.
198198

199-
**Usage**
199+
**Usage**
200200

201201
Returns -1 if the URL scheme or the stream protocol handler for the URL doesn't define a default port number.
202202

@@ -276,15 +276,15 @@ The host name of the current URL.
276276

277277
Returns the canonical URL for your org. For example, https://MyDomainName.my.salesforce.com.
278278

279-
**Usage**
279+
**Usage**
280280

281281
Use getOrgDomainUrl() to interact with Salesforce REST and SOAP APIs in Apex code. Get endpoints for User Interface API calls, for creating and customizing picklist value sets and custom fields, and more.
282282

283283
`getOrgDomainUrl()` can access the domain URL only for the org in which the Apex code is running.
284284

285285
You don't need a RemoteSiteSetting for your org to interact with the Salesforce APIs using domain URLs retrieved with this method.
286286

287-
**See Also**
287+
**See Also**
288288

289289
* [Lightning Aura Components Developer Guide: Making API Calls from Apex](https://developer.salesforce.com/docs/atlas.en-us.250.0.lightning.meta/lightning/apex_api_calls.htm)
290290

examples/markdown/docs/sample-enums/SampleEnum.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ This is a sample enum. This references [ReferencedEnum](../miscellaneous/Referen
66

77
This description has several lines
88

9-
**Some Custom**
9+
**Some Custom**
1010

1111
Test. I can also have a [ReferencedEnum](../miscellaneous/ReferencedEnum.md) here.
1212
And it can be multiline.
1313

14-
**Mermaid**
14+
**Mermaid**
1515

1616
graph TD
1717
A[SampleEnum] -->|references| B[ReferencedEnum]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
3+
<div if:true={ready}>
4+
<c-accordion-base items={computed} auto-collapse={autoCollapse} flush-style={flushStyle}></c-accordion-base>
5+
</div>
6+
</c-expression-element-container>
7+
</template>

0 commit comments

Comments
 (0)