@cparra/apexdocs 1.15.0 → 1.16.0
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/.gitattributes +2 -0
- package/.github/workflows/ci.yml +29 -0
- package/README.md +2 -0
- package/docs/404.html +24 -24
- package/docs/README.md +46 -46
- package/docs/Sample-Classes/SampleClass.md +112 -112
- package/docs/Sample-Classes/SampleClass2.md +112 -112
- package/docs/Sample-Classes/SampleClassMultipleAuthorsAndDates.md +120 -120
- package/docs/Sample-Interfaces/SampleInterface.md +29 -29
- package/docs/_config.yml +40 -40
- package/docs/assets/css/style.css +319 -319
- package/docs/index.md +48 -48
- package/examples/apex/SampleClassMultipleAuthorsAndDates.cls +100 -100
- package/lib/Command/Generate.d.ts +1 -1
- package/lib/Command/Generate.js +13 -1
- package/lib/MarkdownDocsProcessor.js +3 -0
- package/lib/MetadataProcessor.d.ts +3 -0
- package/lib/MetadataProcessor.js +15 -0
- package/lib/Parser/ClassParser.js +28 -17
- package/lib/application/Apexdocs.js +6 -3
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +6 -1
- package/lib/index.js.map +1 -1
- package/lib/model/ApexModel.d.ts +3 -0
- package/lib/model/ApexModel.js +8 -0
- package/lib/model/file.js +1 -0
- package/lib/model/file.js.map +1 -1
- package/lib/model/manifest-diff.js +1 -0
- package/lib/model/manifest-diff.js.map +1 -1
- package/lib/model/markdown-file.d.ts +2 -0
- package/lib/model/markdown-file.js +29 -0
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +7 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +24 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js +34 -12
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/index.js +13 -6
- package/lib/model/markdown-generation-util/index.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +5 -5
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js +5 -11
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.d.ts +1 -0
- package/lib/model/markdown-home-file.js +7 -5
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +10 -3
- package/lib/model/markdown-type-file.js +70 -10
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/types-repository.d.ts +8 -0
- package/lib/model/types-repository.js +22 -0
- package/lib/model/types-repository.js.map +1 -0
- package/lib/service/apex-file-reader.js +1 -0
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.js +1 -0
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.js +1 -0
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.js +1 -0
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/parser.js +1 -0
- package/lib/service/parser.js.map +1 -1
- package/lib/service/walkers/class-walker.js +1 -0
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.js +1 -0
- package/lib/service/walkers/enum-walker.js.map +1 -1
- package/lib/service/walkers/interface-walker.js +1 -0
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker-factory.js +1 -0
- package/lib/service/walkers/walker-factory.js.map +1 -1
- package/lib/service/walkers/walker.js +1 -0
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +3 -0
- package/lib/settings.js +7 -0
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/file-container.js +1 -0
- package/lib/transpiler/file-container.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +9 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +1 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.js +1 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/util/logger.js +1 -0
- package/lib/util/logger.js.map +1 -1
- package/package.json +2 -1
- package/src/Command/Generate.ts +17 -0
- package/src/MarkdownDocsProcessor.ts +5 -0
- package/src/MetadataProcessor.ts +16 -0
- package/src/Model/ApexModel.ts +11 -0
- package/src/Parser/ClassParser.ts +35 -17
- package/src/Settings.ts +10 -0
- package/src/cli/generate.ts +7 -0
package/docs/index.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: default
|
|
3
|
-
---
|
|
4
|
-
# Classes
|
|
5
|
-
## Sample Classes
|
|
6
|
-
|
|
7
|
-
### [SampleClass](/Sample-Classes/SampleClass.md)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
This is a class description.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### [SampleClass](/Sample-Classes/SampleClass.md)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
This is a class description.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### [SampleClass2](/Sample-Classes/SampleClass2.md)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
This is a class description.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### [SampleClassMultipleAuthorsAndDates](/Sample-Classes/SampleClassMultipleAuthorsAndDates.md)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
This is a class description.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Sample Interfaces
|
|
35
|
-
|
|
36
|
-
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
This is an interface description.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
This is an interface description.
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
---
|
|
4
|
+
# Classes
|
|
5
|
+
## Sample Classes
|
|
6
|
+
|
|
7
|
+
### [SampleClass](/Sample-Classes/SampleClass.md)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
This is a class description.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### [SampleClass](/Sample-Classes/SampleClass.md)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
This is a class description.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### [SampleClass2](/Sample-Classes/SampleClass2.md)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
This is a class description.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### [SampleClassMultipleAuthorsAndDates](/Sample-Classes/SampleClassMultipleAuthorsAndDates.md)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
This is a class description.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Sample Interfaces
|
|
35
|
+
|
|
36
|
+
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
This is an interface description.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
This is an interface description.
|
|
47
|
+
|
|
48
|
+
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This is a class description.
|
|
3
|
-
* @author John Doe
|
|
4
|
-
* @date 1/1/2021
|
|
5
|
-
* @author Jane Doe
|
|
6
|
-
* @date 2/2/2022
|
|
7
|
-
* @group Sample Classes
|
|
8
|
-
* @see SampleInterface
|
|
9
|
-
* @see SampleClass2
|
|
10
|
-
*/
|
|
11
|
-
@NamespaceAccessible
|
|
12
|
-
public with sharing class SampleClassMultipleAuthorsAndDates {
|
|
13
|
-
/**
|
|
14
|
-
* @description Constructs a SampleClassMultipleAuthorsAndDates without any arguments.
|
|
15
|
-
* @example
|
|
16
|
-
* <pre>
|
|
17
|
-
* SampleClassMultipleAuthorsAndDates sampleInstance = new SampleClassMultipleAuthorsAndDates();
|
|
18
|
-
*/
|
|
19
|
-
@NamespaceAccessible
|
|
20
|
-
public SampleClassMultipleAuthorsAndDates() {
|
|
21
|
-
System.debug('Constructor');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @description Constructs a SampleClassMultipleAuthorsAndDates with an argument.
|
|
26
|
-
* @param argument Some argument
|
|
27
|
-
*/
|
|
28
|
-
public SampleClassMultipleAuthorsAndDates(String argument) {
|
|
29
|
-
System.debug('Constructor');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @description Executes commands based on the passed in argument.
|
|
34
|
-
* @example
|
|
35
|
-
* <pre>
|
|
36
|
-
* String result = SampleClassMultipleAuthorsAndDates.testMethod();
|
|
37
|
-
* System.debug(result);
|
|
38
|
-
*/
|
|
39
|
-
@NamespaceAccessible
|
|
40
|
-
public static String testMethod(String argument) {
|
|
41
|
-
System.debug('Execute');
|
|
42
|
-
return '';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @description Calls the method.
|
|
48
|
-
* This methods allows you to call it.
|
|
49
|
-
*/
|
|
50
|
-
public static void call() {
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @description This is a String property.
|
|
55
|
-
*/
|
|
56
|
-
public String MyProp { get; set; }
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @description This is a Decimal property.
|
|
60
|
-
*/
|
|
61
|
-
public Decimal AnotherProp { get; private set; }
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
65
|
-
*/
|
|
66
|
-
public class InnerClass {
|
|
67
|
-
/**
|
|
68
|
-
* @description Description of the inner property.
|
|
69
|
-
*/
|
|
70
|
-
public InnerProp {
|
|
71
|
-
get; set;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @description Executes from the inner class.
|
|
76
|
-
*/
|
|
77
|
-
public void innerMethod() {
|
|
78
|
-
System.debug('Executing inner method.');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
84
|
-
*/
|
|
85
|
-
public class AnotherInnerClass {
|
|
86
|
-
/**
|
|
87
|
-
* @description Description of the inner property.
|
|
88
|
-
*/
|
|
89
|
-
public InnerProp {
|
|
90
|
-
get; set;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @description Executes from the inner class.
|
|
95
|
-
*/
|
|
96
|
-
public void innerMethod() {
|
|
97
|
-
System.debug('Executing inner method.');
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @description This is a class description.
|
|
3
|
+
* @author John Doe
|
|
4
|
+
* @date 1/1/2021
|
|
5
|
+
* @author Jane Doe
|
|
6
|
+
* @date 2/2/2022
|
|
7
|
+
* @group Sample Classes
|
|
8
|
+
* @see SampleInterface
|
|
9
|
+
* @see SampleClass2
|
|
10
|
+
*/
|
|
11
|
+
@NamespaceAccessible
|
|
12
|
+
public with sharing class SampleClassMultipleAuthorsAndDates {
|
|
13
|
+
/**
|
|
14
|
+
* @description Constructs a SampleClassMultipleAuthorsAndDates without any arguments.
|
|
15
|
+
* @example
|
|
16
|
+
* <pre>
|
|
17
|
+
* SampleClassMultipleAuthorsAndDates sampleInstance = new SampleClassMultipleAuthorsAndDates();
|
|
18
|
+
*/
|
|
19
|
+
@NamespaceAccessible
|
|
20
|
+
public SampleClassMultipleAuthorsAndDates() {
|
|
21
|
+
System.debug('Constructor');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @description Constructs a SampleClassMultipleAuthorsAndDates with an argument.
|
|
26
|
+
* @param argument Some argument
|
|
27
|
+
*/
|
|
28
|
+
public SampleClassMultipleAuthorsAndDates(String argument) {
|
|
29
|
+
System.debug('Constructor');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @description Executes commands based on the passed in argument.
|
|
34
|
+
* @example
|
|
35
|
+
* <pre>
|
|
36
|
+
* String result = SampleClassMultipleAuthorsAndDates.testMethod();
|
|
37
|
+
* System.debug(result);
|
|
38
|
+
*/
|
|
39
|
+
@NamespaceAccessible
|
|
40
|
+
public static String testMethod(String argument) {
|
|
41
|
+
System.debug('Execute');
|
|
42
|
+
return '';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description Calls the method.
|
|
48
|
+
* This methods allows you to call it.
|
|
49
|
+
*/
|
|
50
|
+
public static void call() {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @description This is a String property.
|
|
55
|
+
*/
|
|
56
|
+
public String MyProp { get; set; }
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @description This is a Decimal property.
|
|
60
|
+
*/
|
|
61
|
+
public Decimal AnotherProp { get; private set; }
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
65
|
+
*/
|
|
66
|
+
public class InnerClass {
|
|
67
|
+
/**
|
|
68
|
+
* @description Description of the inner property.
|
|
69
|
+
*/
|
|
70
|
+
public InnerProp {
|
|
71
|
+
get; set;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @description Executes from the inner class.
|
|
76
|
+
*/
|
|
77
|
+
public void innerMethod() {
|
|
78
|
+
System.debug('Executing inner method.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
84
|
+
*/
|
|
85
|
+
public class AnotherInnerClass {
|
|
86
|
+
/**
|
|
87
|
+
* @description Description of the inner property.
|
|
88
|
+
*/
|
|
89
|
+
public InnerProp {
|
|
90
|
+
get; set;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @description Executes from the inner class.
|
|
95
|
+
*/
|
|
96
|
+
public void innerMethod() {
|
|
97
|
+
System.debug('Executing inner method.');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import ClassModel from '../Model/ClassModel';
|
|
2
|
-
export declare function generate(sourceDirectories: (string | number)[], recursive?: boolean, scope?: string[], outputDir?: string, targetGenerator?: string, configPath?: string, group?: boolean): ClassModel[];
|
|
2
|
+
export declare function generate(sourceDirectories: (string | number)[], recursive?: boolean, scope?: string[], outputDir?: string, targetGenerator?: string, configPath?: string, group?: boolean, indexOnly?: boolean): ClassModel[];
|
package/lib/Command/Generate.js
CHANGED
|
@@ -7,9 +7,11 @@ const FileParser_1 = require("../Parser/FileParser");
|
|
|
7
7
|
const DocsifyDocsProcessor_1 = require("../DocsifyDocsProcessor");
|
|
8
8
|
const JekyllDocsProcessor_1 = require("../JekyllDocsProcessor");
|
|
9
9
|
const AsJsDocsProcessor_1 = require("../AsJsDocsProcessor");
|
|
10
|
-
|
|
10
|
+
const MetadataProcessor_1 = require("../MetadataProcessor");
|
|
11
|
+
function generate(sourceDirectories, recursive = true, scope = ['global', 'public', 'namespaceaccessible'], outputDir = 'docs', targetGenerator = 'jekyll', configPath, group, indexOnly = false) {
|
|
11
12
|
Settings_1.default.getInstance().setScope(scope);
|
|
12
13
|
Settings_1.default.getInstance().setOutputDir(outputDir);
|
|
14
|
+
Settings_1.default.getInstance().setIndexOnly(indexOnly);
|
|
13
15
|
if (targetGenerator === 'jekyll') {
|
|
14
16
|
Settings_1.default.getInstance().setDocsProcessor(new JekyllDocsProcessor_1.default());
|
|
15
17
|
}
|
|
@@ -47,6 +49,16 @@ function getClassesFromDirectory(sourceDirectories, recursive) {
|
|
|
47
49
|
}
|
|
48
50
|
const rawFile = fs.readFileSync(currentPath);
|
|
49
51
|
const response = new FileParser_1.default().parseFileContents(rawFile.toString());
|
|
52
|
+
const rawFileMetadata = fs.existsSync(currentPath + '-meta.xml') ? fs.readFileSync(currentPath + '-meta.xml') : null;
|
|
53
|
+
if (!response) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (rawFileMetadata != null && response != null) {
|
|
57
|
+
let metadataGenericParams = MetadataProcessor_1.default.process(rawFileMetadata.toString());
|
|
58
|
+
metadataGenericParams.forEach((value, key) => {
|
|
59
|
+
response.setGeneric(key, value);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
50
62
|
if (!response) {
|
|
51
63
|
return;
|
|
52
64
|
}
|
|
@@ -65,6 +65,9 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
65
65
|
var _a, _b;
|
|
66
66
|
const generator = new MarkdownHelper_1.default(this.classes);
|
|
67
67
|
this.onBeforeClassFileCreated(generator);
|
|
68
|
+
if (Settings_1.default.getInstance().getIndexOnly() === true) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
68
71
|
const startingHeadingLevel = ((_b = (_a = Configuration_1.default.getConfig()) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.startingHeadingLevel) || 1;
|
|
69
72
|
this.generateDocsForClass(generator, classModel, startingHeadingLevel);
|
|
70
73
|
if (!fs.existsSync(outputDir)) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
4
|
+
class MetadataProcessor {
|
|
5
|
+
static process(input) {
|
|
6
|
+
let map = new Map();
|
|
7
|
+
let xml = new fast_xml_parser_1.XMLParser().parse(input);
|
|
8
|
+
let apiVersion = xml.ApexClass.apiVersion;
|
|
9
|
+
map.set('apiVersion', apiVersion !== null ? apiVersion : '');
|
|
10
|
+
let status = xml.ApexClass.status;
|
|
11
|
+
map.set('status', status !== null ? status : '');
|
|
12
|
+
return map;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = MetadataProcessor;
|
|
@@ -13,27 +13,30 @@ class ClassParser {
|
|
|
13
13
|
cModel.setNameLine(name, iLine);
|
|
14
14
|
if (name.toLowerCase().includes(' interface '))
|
|
15
15
|
cModel.setIsInterface(true);
|
|
16
|
+
let multiline = false;
|
|
16
17
|
let inDescription = false;
|
|
18
|
+
let inHistory = false;
|
|
17
19
|
let i = 0;
|
|
20
|
+
let reAnyAnnotation = new RegExp('@([A-Za-z]*)\s*(.*)');
|
|
18
21
|
for (let comment of lstComments) {
|
|
19
22
|
i++;
|
|
20
23
|
comment = comment.trim();
|
|
21
24
|
let idxStart = comment.toLowerCase().indexOf('@author');
|
|
22
25
|
if (idxStart !== -1) {
|
|
23
26
|
cModel.addAuthor(comment.substring(idxStart + 7).trim());
|
|
24
|
-
|
|
27
|
+
multiline = false;
|
|
25
28
|
continue;
|
|
26
29
|
}
|
|
27
30
|
idxStart = comment.toLowerCase().indexOf('@date');
|
|
28
31
|
if (idxStart !== -1) {
|
|
29
32
|
cModel.addDate(comment.substring(idxStart + 5).trim());
|
|
30
|
-
|
|
33
|
+
multiline = false;
|
|
31
34
|
continue;
|
|
32
35
|
}
|
|
33
36
|
idxStart = comment.toLowerCase().indexOf('@see');
|
|
34
37
|
if (idxStart !== -1) {
|
|
35
38
|
cModel.addSee(comment.substring(idxStart + 4).trim());
|
|
36
|
-
|
|
39
|
+
multiline = false;
|
|
37
40
|
continue;
|
|
38
41
|
}
|
|
39
42
|
idxStart = comment.toLowerCase().indexOf('@group '); // needed to include space to not match group-content.
|
|
@@ -42,38 +45,46 @@ class ClassParser {
|
|
|
42
45
|
if (group) {
|
|
43
46
|
cModel.setClassGroup(group);
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
multiline = false;
|
|
46
49
|
continue;
|
|
47
50
|
}
|
|
48
51
|
idxStart = comment.toLowerCase().indexOf('@group-content');
|
|
49
52
|
if (idxStart !== -1) {
|
|
50
53
|
cModel.setClassGroupContent(comment.substring(idxStart + 14).trim());
|
|
51
|
-
|
|
54
|
+
multiline = false;
|
|
52
55
|
continue;
|
|
53
56
|
}
|
|
54
57
|
idxStart = comment.toLowerCase().indexOf('@description');
|
|
55
|
-
if (idxStart !== -1 || i === 1) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
else {
|
|
59
|
-
const found = comment.match('\\s');
|
|
60
|
-
if (found && found.index) {
|
|
61
|
-
cModel.setDescription(comment.substring(found.index).trim());
|
|
62
|
-
}
|
|
63
|
-
}
|
|
58
|
+
if (idxStart !== -1 || (i === 1 && !reAnyAnnotation.test(comment))) {
|
|
59
|
+
cModel.setDescription(comment.substring(idxStart + 12).trim());
|
|
60
|
+
multiline = true;
|
|
64
61
|
inDescription = true;
|
|
62
|
+
inHistory = false;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
let anyStart = reAnyAnnotation.exec(comment);
|
|
66
|
+
idxStart = (typeof (anyStart === null || anyStart === void 0 ? void 0 : anyStart.index) !== 'undefined') ? anyStart.index : -1;
|
|
67
|
+
if (idxStart !== -1 && anyStart !== null) {
|
|
68
|
+
let genericName = anyStart[1];
|
|
69
|
+
let genericValue = anyStart[2];
|
|
70
|
+
cModel.setGeneric(genericName, genericValue);
|
|
71
|
+
multiline = false;
|
|
72
|
+
inDescription = false;
|
|
73
|
+
inHistory = false;
|
|
65
74
|
continue;
|
|
66
75
|
}
|
|
67
76
|
// handle multiple lines for description.
|
|
68
|
-
if (
|
|
77
|
+
if (multiline === true) {
|
|
69
78
|
let j;
|
|
70
79
|
for (j = 0; j < comment.length; j++) {
|
|
71
80
|
const ch = comment.charAt(j);
|
|
72
81
|
if (ch !== '*' && ch !== ' ')
|
|
73
82
|
break;
|
|
74
83
|
}
|
|
75
|
-
if (j < comment.length) {
|
|
76
|
-
|
|
84
|
+
if (j < comment.length && !reAnyAnnotation.test(comment)) {
|
|
85
|
+
if (inDescription) {
|
|
86
|
+
cModel.setDescription(cModel.getDescription() + ' ' + comment.substring(j));
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
continue;
|
|
79
90
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Apexdocs = void 0;
|
|
3
4
|
const apex_file_reader_1 = require("../service/apex-file-reader");
|
|
4
5
|
const file_system_1 = require("../service/file-system");
|
|
5
6
|
const apex_reflection_1 = require("@cparra/apex-reflection");
|
|
@@ -9,6 +10,7 @@ const parser_1 = require("../service/parser");
|
|
|
9
10
|
const settings_1 = require("../settings");
|
|
10
11
|
const transpiler_1 = require("../transpiler/transpiler");
|
|
11
12
|
const file_writer_1 = require("../service/file-writer");
|
|
13
|
+
const types_repository_1 = require("../model/types-repository");
|
|
12
14
|
/**
|
|
13
15
|
* Application entry-point to generate documentation out of Apex source files.
|
|
14
16
|
*/
|
|
@@ -19,10 +21,11 @@ class Apexdocs {
|
|
|
19
21
|
static generate() {
|
|
20
22
|
const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
|
|
21
23
|
const manifest = manifest_factory_1.createManifest(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
+
const filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
|
|
25
|
+
types_repository_1.TypesRepository.getInstance().populate(filteredTypes);
|
|
26
|
+
logger_1.Logger.log(`Parsed ${filteredTypes.length} files`);
|
|
24
27
|
const processor = settings_1.Settings.getInstance().typeTranspiler;
|
|
25
|
-
transpiler_1.default.generate(
|
|
28
|
+
transpiler_1.default.generate(filteredTypes, processor);
|
|
26
29
|
const generatedFiles = processor.fileBuilder().files();
|
|
27
30
|
file_writer_1.FileWriter.write(generatedFiles, (fileName) => {
|
|
28
31
|
logger_1.Logger.log(`${fileName} processed.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAA0E;AAC1E,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAE5D;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,iCAAc,CAAC,IAAI,sBAAa,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAE3F,MAAM,aAAa,GAAW,QAAQ,CAAC,sCAAsC,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5G,kCAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAEtD,eAAM,CAAC,GAAG,CAAC,UAAU,aAAa,CAAC,MAAM,QAAQ,CAAC,CAAC;QACnD,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACxD,oBAAU,CAAC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QACvD,wBAAU,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;YACpD,eAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,aAAa,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;;AAlBH,4BA2BC;AAPQ,8BAAqB,GAAG,CAAC,eAAuB,EAAoB,EAAE;;IAC3E,MAAM,MAAM,GAAG,yBAAO,CAAC,eAAe,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,eAAM,CAAC,GAAG,CAAC,iBAAiB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;KACtD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.js
CHANGED
|
@@ -48,6 +48,11 @@ const argv = yargs.options({
|
|
|
48
48
|
describe: 'Define whether the generated files should be grouped by the @group tag on the top level classes.' +
|
|
49
49
|
'If set to true, a sub directory will be created per group inside of the specified target directory.',
|
|
50
50
|
},
|
|
51
|
+
indexOnly: {
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
default: false,
|
|
54
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
55
|
+
}
|
|
51
56
|
}).argv;
|
|
52
|
-
const generatedClassModels = Generate_1.generate(argv.sourceDir, argv.recursive, argv.scope, argv.targetDir, argv.targetGenerator, argv.configPath, argv.group);
|
|
57
|
+
const generatedClassModels = Generate_1.generate(argv.sourceDir, argv.recursive, argv.scope, argv.targetDir, argv.targetGenerator, argv.configPath, argv.group, argv.indexOnly);
|
|
53
58
|
new FileManager_1.default(generatedClassModels).generate();
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2C"}
|
package/lib/model/ApexModel.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class ApexModel {
|
|
|
8
8
|
private example;
|
|
9
9
|
private scope;
|
|
10
10
|
private isNamespaceAccessible;
|
|
11
|
+
private generics;
|
|
11
12
|
getNameLine(): string;
|
|
12
13
|
getInameLine(): number | undefined;
|
|
13
14
|
setNameLine(nameLine: string, iLine: number): void;
|
|
@@ -25,6 +26,8 @@ export default class ApexModel {
|
|
|
25
26
|
setScope(scope: string): void;
|
|
26
27
|
setIsNamespaceAccessible(isNamespaceAccessible: boolean): void;
|
|
27
28
|
getIsNamespaceAccessible(): boolean;
|
|
29
|
+
setGeneric(name: string, value: string): void;
|
|
30
|
+
getGeneric(name: string): string;
|
|
28
31
|
private parseScope;
|
|
29
32
|
private getScopeFromSettings;
|
|
30
33
|
}
|
package/lib/model/ApexModel.js
CHANGED
|
@@ -11,6 +11,7 @@ class ApexModel {
|
|
|
11
11
|
this.example = '';
|
|
12
12
|
this.scope = '';
|
|
13
13
|
this.isNamespaceAccessible = false;
|
|
14
|
+
this.generics = new Map();
|
|
14
15
|
}
|
|
15
16
|
getNameLine() {
|
|
16
17
|
return this.nameLine;
|
|
@@ -65,6 +66,13 @@ class ApexModel {
|
|
|
65
66
|
getIsNamespaceAccessible() {
|
|
66
67
|
return this.isNamespaceAccessible;
|
|
67
68
|
}
|
|
69
|
+
setGeneric(name, value) {
|
|
70
|
+
this.generics.set(name, value);
|
|
71
|
+
}
|
|
72
|
+
getGeneric(name) {
|
|
73
|
+
let value = this.generics.get(name);
|
|
74
|
+
return value ? value : '';
|
|
75
|
+
}
|
|
68
76
|
parseScope() {
|
|
69
77
|
this.scope = '';
|
|
70
78
|
const str = this.getScopeFromSettings(this.nameLine);
|
package/lib/model/file.js
CHANGED
package/lib/model/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/model/file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/model/file.ts"],"names":[],"mappings":";;;AAAA,iDAAuC;AAEvC,MAAsB,IAAI;IAGxB,YAAmB,QAAgB,EAAS,GAAW;QAApC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAFvD,cAAS,GAAG,EAAE,CAAC;IAE2C,CAAC;IAI3D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,IAAI;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,sBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzB,CAAC;CACF;AApBD,oBAoBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-diff.js","sourceRoot":"","sources":["../../src/model/manifest-diff.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-diff.js","sourceRoot":"","sources":["../../src/model/manifest-diff.ts"],"names":[],"mappings":";;;AAIA,MAAa,YAAY;IAAzB;QACE,UAAK,GAAW,EAAE,CAAC;QACnB,YAAO,GAAW,EAAE,CAAC;QACrB,YAAO,GAAiB,EAAE,CAAC;IA6B7B,CAAC;IA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,CAAC,iBAAiB,GAAG;YACvB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBACrC,OAAO,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACrD,CAAC,CAAC;YACF,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBACvC,OAAO,sBAAsB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YACvD,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarkdownFile = void 0;
|
|
3
4
|
const file_1 = require("./file");
|
|
5
|
+
const class_file_generatorHelper_1 = require("../transpiler/markdown/class-file-generatorHelper");
|
|
4
6
|
class MarkdownFile extends file_1.File {
|
|
5
7
|
fileExtension() {
|
|
6
8
|
return '.md';
|
|
@@ -46,6 +48,33 @@ class MarkdownFile extends file_1.File {
|
|
|
46
48
|
columns.forEach((column) => {
|
|
47
49
|
this._contents += column + '|';
|
|
48
50
|
});
|
|
51
|
+
this.addBlankLine();
|
|
52
|
+
}
|
|
53
|
+
addListItem(text) {
|
|
54
|
+
this._contents += `* ${text}`;
|
|
55
|
+
}
|
|
56
|
+
static replaceInlineLinks(text) {
|
|
57
|
+
// Parsing text to extract possible linking classes.
|
|
58
|
+
const possibleLinks = text.match(/<<.*?>>/g);
|
|
59
|
+
possibleLinks === null || possibleLinks === void 0 ? void 0 : possibleLinks.forEach((currentMatch) => {
|
|
60
|
+
const classNameForMatch = currentMatch.replace('<<', '').replace('>>', '');
|
|
61
|
+
text = text.replace(currentMatch, class_file_generatorHelper_1.default.getFileLinkByTypeName(classNameForMatch));
|
|
62
|
+
});
|
|
63
|
+
// Parsing links using {@link ClassName} format
|
|
64
|
+
const linkFormatRegEx = '{@link (.*?)}';
|
|
65
|
+
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
66
|
+
let match;
|
|
67
|
+
const matches = [];
|
|
68
|
+
do {
|
|
69
|
+
match = expression.exec(text);
|
|
70
|
+
if (match) {
|
|
71
|
+
matches.push(match);
|
|
72
|
+
}
|
|
73
|
+
} while (match);
|
|
74
|
+
for (const currentMatch of matches) {
|
|
75
|
+
text = text.replace(currentMatch[0], class_file_generatorHelper_1.default.getFileLinkByTypeName(currentMatch[1]));
|
|
76
|
+
}
|
|
77
|
+
return text;
|
|
49
78
|
}
|
|
50
79
|
}
|
|
51
80
|
exports.MarkdownFile = MarkdownFile;
|