@@ -41,10 +41,19 @@ annotated with `@RestResource`:
4141apexdocs openapi -s force-app
4242```
4343
44+ #### Changelog
45+
46+ Run the following command to generate a changelog for your Salesforce Apex classes:
47+
48+ ``` bash
49+ apexdocs changelog --previousVersionDir force-app-previous --currentVersionDir force-app
50+ ```
51+
4452## 🚀 Features
4553
4654* Generate documentation for Salesforce Apex classes as Markdown files
4755* Generate an OpenApi REST specification based on ` @RestResource ` classes
56+ * Generate a changelog based on the differences between two versions of your Salesforce Apex classes
4857* Support for grouping blocks of related code within a class
4958* Support for ignoring files and members from being documented
5059* Namespace support
@@ -146,6 +155,28 @@ apexdocs markdown -s force-app -t docs -p global public namespaceaccessible -n M
146155apexdocs openapi -s force-app -t docs -n MyNamespace --title " My Custom OpenApi Title"
147156```
148157
158+ ### Changelog
159+
160+ ` changelog `
161+
162+ #### Flags
163+
164+ | Flag | Alias | Description | Default | Required |
165+ | ------------------------| -------| --------------------------------------------------------------------| -------------| ----------|
166+ | ` --previousVersionDir ` | ` -p ` | The directory location of the previous version of the source code. | N/A | Yes |
167+ | ` --currentVersionDir ` | ` -t ` | The directory location of the current version of the source code. | N/A | Yes |
168+ | ` --targetDir ` | ` -t ` | The directory location where the changelog file will be generated. | ` ./docs/ ` | No |
169+ | ` --fileName ` | N/A | The name of the changelog file to be generated. | ` changelog ` | No |
170+ | ` --scope ` | N/A | The list of scope to respect when generating the changelog. | [ 'global'] | No |
171+
172+ #### Sample Usage
173+
174+ ``` bash
175+ apexdocs changelog -p force-app-previous -t force-app
176+ ```
177+
178+ ---
179+
149180## 🔬 Defining a configuration file
150181
151182You can also use a configuration file to define the parameters that will be used when generating the documentation.
@@ -187,7 +218,7 @@ CLI will be used, or the default value will be used.
187218
188219### Config Intellisense
189220
190- Using the ` defineMarkdownConfig ` (or the ` defineOpenApiConfig ` for OpenApi documentation)
221+ Using the ` defineMarkdownConfig ` (or the ` defineOpenApiConfig ` for OpenApi documentation)
191222helper will provide Typescript-powered intellisense
192223for the configuration file options. This should work with both Javascript and Typescript files.
193224
@@ -202,8 +233,44 @@ export default defineMarkdownConfig({
202233});
203234```
204235
236+ ### Generating Different Types of Documentation
237+
238+ You might want to generate different types of documentation using a single command. For example, if you are releasing
239+ a new version of your project, you might want to generate updated documentation Markdown files, and at the
240+ same time generate a changelog listing everything new.
241+
242+ You can do this by providing a configuration file that exports a configuration object which keys are the type of
243+ documentation you want to generate.
244+
245+ ``` typescript
246+ import { defineMarkdownConfig , defineChangelogConfig } from ' @cparra/apexdocs' ;
247+
248+ export default {
249+ markdown: defineMarkdownConfig ({
250+ sourceDir: ' force-app' ,
251+ targetDir: ' docs' ,
252+ scope: [' global' , ' public' ],
253+ ...
254+ }),
255+ changelog: defineChangelogConfig ({
256+ previousVersionDir: ' force-app-previous' ,
257+ currentVersionDir: ' force-app' ,
258+ targetDir: ' docs' ,
259+ scope: [' global' , ' public' ],
260+ })
261+ };
262+ ```
263+
264+ Then you only need to run the top level ` apexdocs ` command, and it will generate both types of documentation.
265+
266+ ``` bash
267+ apexdocs
268+ ```
269+
205270### Excluding Tags from Appearing in the Documentation
206271
272+ Note: Only works for Markdown documentation.
273+
207274You can exclude tags from appearing in the documentation by using the ` excludeTags ` property in the configuration file,
208275which allow you to pass a list of tags that you want to exclude from the documentation.
209276
@@ -221,7 +288,7 @@ export default defineMarkdownConfig({
221288
222289### Excluding Files from Being Documented
223290
224- You can exclude one or multiple files from being documented by providing a list of glob patterns to
291+ You can exclude one or multiple files from being documented by providing a list of glob patterns to
225292the ` exclude ` property in the configuration file.
226293
227294``` typescript
0 commit comments