Skip to content

Commit 60ac018

Browse files
committed
Documentation updates and publishing version
1 parent a6d4d20 commit 60ac018

File tree

8 files changed

+38
-48
lines changed

8 files changed

+38
-48
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the [Java based ApexDoc tool](https://github.com/SalesforceFoundation/ApexDoc) o
1313
later maintained by Salesforce.org, as that tool is no longer being maintained.
1414

1515
ApexDocs is a Node.js library built on Typescript and hosted on [npm](https://www.npmjs.com/package/@cparra/apexdocs).
16-
It offers CLI capabilities to automatically docGenerator a set of files that fully document each one of you classes.
16+
It offers CLI capabilities to automatically document your source code, based on the ApexDoc style of documentation.
1717
Additionally, it can be imported and consumed directly by your JavaScript code.
1818

1919
There are some key differences between ApexDocs and the Java based ApexDoc tool:
@@ -71,7 +71,10 @@ public class MyClass {
7171
* Apex docs blocks can now all be in a single line
7272
* Support for grouping blocks of related code within a class
7373
* Support for HTML tags
74-
* And more!
74+
* OpenApi REST specification generation
75+
* Support for ignoring files and members from being documented
76+
* Namespace support
77+
* And much, much more!
7578

7679
### Demo
7780

@@ -329,6 +332,23 @@ To fix this issue, when not sanitizing HTML, you should wrap any code that conta
329332
treated as HTML within '\`'
330333
or within `<code>` tags.
331334

335+
336+
### Ignoring files and members
337+
338+
You can ignore files and members by using the `@ignore` tag on any ApexDoc block. If used at the class level, the entire
339+
file will be ignored. If used at the member level, only that member will be ignored.
340+
341+
Example
342+
343+
```apex
344+
/**
345+
* @ignore
346+
*/
347+
public class MyClass {
348+
public static void myMethod() {}
349+
}
350+
```
351+
332352
## Generating OpenApi REST Definitions
333353

334354
ApexDocs supports generating OpenApi 3.1.0 REST definitions based on any `@RestResource` classes in your source code.

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cparra/apexdocs",
3-
"version": "2.13.0-alpha.4",
3+
"version": "2.13.0",
44
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
55
"keywords": [
66
"apex",
@@ -66,7 +66,7 @@
6666
]
6767
},
6868
"dependencies": {
69-
"@cparra/apex-reflection": "2.2.0",
69+
"@cparra/apex-reflection": "2.3.0",
7070
"chalk": "^4.1.2",
7171
"fast-xml-parser": "^4.0.1",
7272
"js-yaml": "^4.1.0",

src/model/markdown-home-file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Type } from '@cparra/apex-reflection';
22
import ClassFileGeneratorHelper from '../transpiler/markdown/class-file-generatorHelper';
33
import { MarkdownFile } from './markdown-file';
4-
import { stringUtils } from '../util/string-utils';
4+
import { truncate } from '../util/string-utils';
55
import { Settings } from '../settings';
66

77
export class MarkdownHomeFile extends MarkdownFile {
@@ -34,7 +34,7 @@ export class MarkdownHomeFile extends MarkdownFile {
3434
(previous, current) => previous + current + '\n',
3535
'',
3636
);
37-
this.addText(stringUtils(description, 300));
37+
this.addText(truncate(description, 300));
3838
this.addBlankLine();
3939
}
4040
}

src/transpiler/openapi/__tests__/open-api-docs-processor.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ it('should add a path based on the @UrlResource annotation on the class', functi
2121
const processor = new OpenApiDocsProcessor();
2222
processor.onProcess(classMirror);
2323

24-
expect(processor.openApiModel.paths).toHaveProperty('/Account/');
24+
expect(processor.openApiModel.paths).toHaveProperty('Account/');
2525
});
2626

2727
it('should contain a path with a description when the class has an ApexDoc comment', function () {
@@ -37,5 +37,5 @@ it('should contain a path with a description when the class has an ApexDoc comme
3737
const processor = new OpenApiDocsProcessor();
3838
processor.onProcess(classMirror);
3939

40-
expect(processor.openApiModel.paths['/Account/'].description).toBe('My Description');
40+
expect(processor.openApiModel.paths['Account/'].description).toBe('My Description');
4141
});

src/transpiler/openapi/parsers/ReferenceBuilder.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { TypeBundle, TypesRepository } from '../../../model/types-repository';
1010
import { ClassMirror, DocCommentAnnotation, FieldMirror, PropertyMirror } from '@cparra/apex-reflection';
1111
import { ListObjectType, ReferencedType } from '@cparra/apex-reflection';
1212
import { ApexDocSchemaObject } from '../../../model/openapi/apex-doc-types';
13-
import { ReferenceRepository } from '../utils/ReferenceRepository';
1413

1514
type TypeBundleWithIsCollectionAndReferenceOverrides = TypeBundle & {
1615
originalTypeName: string;

src/transpiler/openapi/utils/ReferenceRepository.ts

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

src/util/string-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function stringUtils(str: string, n: number) {
1+
export function truncate(str: string, n: number) {
22
return str.length > n ? str.substr(0, n - 1) + '&hellip;' : str;
33
}
44

0 commit comments

Comments
 (0)