@cparra/apexdocs 2.22.0 → 2.23.0-beta.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/README.md +52 -16
- package/apexdocs.config.ts +3 -1
- package/docs/types/Classes/nspc.ChildClass.md +97 -94
- package/docs/types/Main/nspc.SampleClass.md +189 -189
- package/examples/force-app/main/default/classes/ChildClass.cls +1 -0
- package/lib/cli/generate.js +7 -1
- package/lib/cli/generate.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js +1 -9
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-type-file.js +1 -9
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/service/walkers/class-walker.js +6 -6
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.js.map +1 -1
- package/lib/service/walkers/interface-walker.js +1 -1
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker.d.ts +3 -0
- package/lib/service/walkers/walker.js +7 -0
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +11 -0
- package/lib/settings.js +10 -0
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +2 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +26 -3
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/generate.ts +6 -0
- package/src/model/markdown-generation-util/field-declaration-util.ts +3 -9
- package/src/model/markdown-type-file.ts +4 -10
- package/src/service/walkers/class-walker.ts +6 -7
- package/src/service/walkers/enum-walker.ts +0 -1
- package/src/service/walkers/interface-walker.ts +1 -1
- package/src/service/walkers/walker.ts +8 -1
- package/src/settings.ts +21 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -2
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +26 -3
- package/ROADMAP.md +0 -16
package/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AA4CA,MAAa,QAAQ;IAGnB,YAA2B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,MAAM,CAAC,KAAK,CAAC,MAAsB;QACxC,QAAQ,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IAClC,CAAC;IAEM,mBAAmB;QACxB,OAAO,I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,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;SAC5C;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAtGD,4BAsGC"}
|
|
@@ -37,12 +37,12 @@ class ClassFileGeneratorHelper {
|
|
|
37
37
|
return './';
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
// If the types have different groups then we have to go up a directory
|
|
40
|
+
// If the types have different groups, then we have to go up a directory
|
|
41
41
|
return `../${this.getSanitizedGroup(classModel)}/`;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
// If nothing is being processed then we assume we are at the root and links should include the groups
|
|
45
|
+
// If nothing is being processed, then we assume we are at the root and links should include the groups
|
|
46
46
|
return `./${this.getSanitizedGroup(classModel)}/`;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAC1C,+CAAwC;AACxC,wCAAmD;AAEnD,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAgB;;QACxC,MAAM,iBAAiB,GAAG,MAAA,mBAAQ,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,mCAAI,EAAE,CAAC;QACpE,MAAM,aAAa,GAAG,GAAG,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;QACjF,MAAM,aAAa,GAAG,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,kBAAkB,EAAE,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QACzF,OAAO,IAAI,aAAa,KAAK,aAAa,GAAG,aAAa,MAAM,CAAC;IACnE,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,MAAM,IAAI,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,EAAE;YACT,sFAAsF;YACtF,OAAO,IAAI,QAAQ,KAAK,QAAQ,GAAG,CAAC;SACrC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,UAAgB;QAC9C,iEAAiE;QACjE,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;QACzD,IAAI,+BAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,KAAK,eAAe,EAAE;YACjF,OAAO,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;SAClD;QAED,uDAAuD;QACvD,MAAM,kBAAkB,GAAG,eAAK,CAAC,WAAW,EAAE,CAAC,qBAAqB,EAAE,CAAC;QACvE,IAAI,kBAAkB,EAAE;YACtB,IAAI,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;gBAC7E,yEAAyE;gBACzE,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,
|
|
1
|
+
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAC1C,+CAAwC;AACxC,wCAAmD;AAEnD,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAA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AAI,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;gBAC7E,yEAAyE;gBACzE,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,wEAAwE;gBACxE,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;aACpD;SACF;aAAM;YACL,uGAAuG;YACvG,OAAO,KAAK,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;SACnD;IACH,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,GAAG,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAC7D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAC1D,CAAC;QACF,OAAO,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAnDD,2CAmDC"}
|
|
@@ -5,6 +5,7 @@ export declare class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
|
5
5
|
homeFileName(): string;
|
|
6
6
|
onBeforeProcess: (types: Type[]) => void;
|
|
7
7
|
onProcess(type: Type): void;
|
|
8
|
-
get
|
|
8
|
+
get frontMatterForHomeFile(): string;
|
|
9
|
+
getFrontMatterHeader(type: Type): string;
|
|
9
10
|
getLinkingStrategy(): LinkingStrategy;
|
|
10
11
|
}
|
|
@@ -4,22 +4,45 @@ exports.JekyllDocsProcessor = void 0;
|
|
|
4
4
|
const markdown_transpiler_base_1 = require("../markdown-transpiler-base");
|
|
5
5
|
const markdown_home_file_1 = require("../../../model/markdown-home-file");
|
|
6
6
|
const markdown_type_file_1 = require("../../../model/markdown-type-file");
|
|
7
|
+
const settings_1 = require("../../../settings");
|
|
7
8
|
class JekyllDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspilerBase {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
10
11
|
this.onBeforeProcess = (types) => {
|
|
11
|
-
this._fileContainer.pushFile(new markdown_home_file_1.MarkdownHomeFile(this.homeFileName(), types, this.
|
|
12
|
+
this._fileContainer.pushFile(new markdown_home_file_1.MarkdownHomeFile(this.homeFileName(), types, this.frontMatterForHomeFile));
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
homeFileName() {
|
|
15
16
|
return 'index';
|
|
16
17
|
}
|
|
17
18
|
onProcess(type) {
|
|
18
|
-
this._fileContainer.pushFile(new markdown_type_file_1.MarkdownTypeFile(type, 1, this.
|
|
19
|
+
this._fileContainer.pushFile(new markdown_type_file_1.MarkdownTypeFile(type, 1, this.getFrontMatterHeader(type)));
|
|
19
20
|
}
|
|
20
|
-
get
|
|
21
|
+
get frontMatterForHomeFile() {
|
|
21
22
|
return '---\nlayout: default\n---';
|
|
22
23
|
}
|
|
24
|
+
getFrontMatterHeader(type) {
|
|
25
|
+
var _a;
|
|
26
|
+
const headerLines = ['---'];
|
|
27
|
+
// "layout: default" is a required front matter header for Jekyll
|
|
28
|
+
headerLines.push('layout: default');
|
|
29
|
+
// Add any additional front matter headers that might have been configured in the settings
|
|
30
|
+
const targetType = {
|
|
31
|
+
name: type.name,
|
|
32
|
+
typeName: type.type_name,
|
|
33
|
+
accessModifier: type.access_modifier,
|
|
34
|
+
group: type.group,
|
|
35
|
+
description: (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.description,
|
|
36
|
+
};
|
|
37
|
+
const configuredHeaders = settings_1.Settings.getInstance().frontMatterHeader(targetType);
|
|
38
|
+
if (configuredHeaders) {
|
|
39
|
+
configuredHeaders.forEach((header) => {
|
|
40
|
+
headerLines.push(header);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
headerLines.push('---');
|
|
44
|
+
return headerLines.join('\n');
|
|
45
|
+
}
|
|
23
46
|
getLinkingStrategy() {
|
|
24
47
|
return 'path-relative';
|
|
25
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jekyll-docsProcessor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts"],"names":[],"mappings":";;;AAAA,0EAAqE;AAErE,0EAAqE;AACrE,0EAAqE;
|
|
1
|
+
{"version":3,"file":"jekyll-docsProcessor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts"],"names":[],"mappings":";;;AAAA,0EAAqE;AAErE,0EAAqE;AACrE,0EAAqE;AAErE,gDAA6C;AAE7C,MAAa,mBAAoB,SAAQ,iDAAsB;IAA/D;;QAKE,oBAAe,GAAG,CAAC,KAAa,EAAE,EAAE;YAClC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,qCAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC9G,CAAC,CAAC;IAmCJ,CAAC;IAzCC,YAAY;QACV,OAAO,OAAO,CAAC;IACjB,CAAC;IAMD,SAAS,CAAC,IAAU;QAClB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,qCAAgB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,IAAI,sBAAsB;QACxB,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED,oBAAoB,CAAC,IAAU;;QAC7B,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC,CAAC;QAC5B,iEAAiE;QACjE,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACpC,0FAA0F;QAC1F,MAAM,UAAU,GAAG;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,WAAW;SAC1C,CAAC;QACF,MAAM,iBAAiB,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,iBAAiB,EAAE;YACrB,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACnC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;SACJ;QACD,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,kBAAkB;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AA1CD,kDA0CC"}
|
package/package.json
CHANGED
package/src/cli/generate.ts
CHANGED
|
@@ -85,6 +85,10 @@ result.then((config) => {
|
|
|
85
85
|
describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
|
|
86
86
|
default: 'openapi',
|
|
87
87
|
},
|
|
88
|
+
sortMembersAlphabetically: {
|
|
89
|
+
type: 'boolean',
|
|
90
|
+
describe: 'Whether to sort members alphabetically.',
|
|
91
|
+
},
|
|
88
92
|
includeMetadata: {
|
|
89
93
|
type: 'boolean',
|
|
90
94
|
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
@@ -114,10 +118,12 @@ result.then((config) => {
|
|
|
114
118
|
title: argv.title,
|
|
115
119
|
namespace: argv.namespace,
|
|
116
120
|
openApiFileName: argv.openApiFileName,
|
|
121
|
+
sortMembersAlphabetically: argv.sortMembersAlphabetically,
|
|
117
122
|
includeMetadata: argv.includeMetadata,
|
|
118
123
|
rootDir: argv.documentationRootDir,
|
|
119
124
|
onAfterProcess: config?.config?.onAfterProcess,
|
|
120
125
|
onBeforeFileWrite: config?.config?.onBeforeFileWrite,
|
|
126
|
+
frontMatterHeader: config?.config?.frontMatterHeader,
|
|
121
127
|
});
|
|
122
128
|
|
|
123
129
|
try {
|
|
@@ -8,15 +8,9 @@ export function declareField(
|
|
|
8
8
|
grouped = false,
|
|
9
9
|
) {
|
|
10
10
|
markdownFile.addBlankLine();
|
|
11
|
-
fields
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (propA.name > propB.name) return 1;
|
|
15
|
-
return 0;
|
|
16
|
-
})
|
|
17
|
-
.forEach((propertyModel) => {
|
|
18
|
-
addFieldSection(markdownFile, propertyModel, startingHeadingLevel, grouped);
|
|
19
|
-
});
|
|
11
|
+
fields.forEach((propertyModel) => {
|
|
12
|
+
addFieldSection(markdownFile, propertyModel, startingHeadingLevel, grouped);
|
|
13
|
+
});
|
|
20
14
|
|
|
21
15
|
markdownFile.addHorizontalRule();
|
|
22
16
|
}
|
|
@@ -91,16 +91,10 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
|
|
|
91
91
|
|
|
92
92
|
private addInnerTypes(title: string, types: Type[], addSeparator = true) {
|
|
93
93
|
this.addTitle(title, this.headingLevel + 1);
|
|
94
|
-
types
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return 0;
|
|
99
|
-
})
|
|
100
|
-
.forEach((currentType) => {
|
|
101
|
-
const innerFile = new MarkdownTypeFile(currentType, this.headingLevel + 2, undefined, true);
|
|
102
|
-
this.addText(innerFile._contents);
|
|
103
|
-
});
|
|
94
|
+
types.forEach((currentType) => {
|
|
95
|
+
const innerFile = new MarkdownTypeFile(currentType, this.headingLevel + 2, undefined, true);
|
|
96
|
+
this.addText(innerFile._contents);
|
|
97
|
+
});
|
|
104
98
|
if (addSeparator) {
|
|
105
99
|
this.addHorizontalRule();
|
|
106
100
|
}
|
|
@@ -5,27 +5,26 @@ export class ClassWalker extends Walker {
|
|
|
5
5
|
walk(listener: WalkerListener): void {
|
|
6
6
|
listener.onTypeDeclaration(this.type);
|
|
7
7
|
const classMirror = this.type as ClassMirror;
|
|
8
|
-
|
|
9
8
|
if (classMirror.constructors.length) {
|
|
10
9
|
listener.onConstructorDeclaration(this.type.name, classMirror.constructors);
|
|
11
10
|
}
|
|
12
11
|
if (classMirror.fields.length) {
|
|
13
|
-
listener.onFieldsDeclaration(classMirror.fields);
|
|
12
|
+
listener.onFieldsDeclaration(this.sortType(classMirror.fields));
|
|
14
13
|
}
|
|
15
14
|
if (classMirror.properties.length) {
|
|
16
|
-
listener.onPropertiesDeclaration(classMirror.properties);
|
|
15
|
+
listener.onPropertiesDeclaration(this.sortType(classMirror.properties));
|
|
17
16
|
}
|
|
18
17
|
if (classMirror.methods.length) {
|
|
19
|
-
listener.onMethodsDeclaration(classMirror.methods);
|
|
18
|
+
listener.onMethodsDeclaration(this.sortType(classMirror.methods));
|
|
20
19
|
}
|
|
21
20
|
if (classMirror.enums.length) {
|
|
22
|
-
listener.onInnerEnumsDeclaration(classMirror.enums);
|
|
21
|
+
listener.onInnerEnumsDeclaration(this.sortType(classMirror.enums));
|
|
23
22
|
}
|
|
24
23
|
if (classMirror.classes.length) {
|
|
25
|
-
listener.onInnerClassesDeclaration(classMirror.classes);
|
|
24
|
+
listener.onInnerClassesDeclaration(this.sortType(classMirror.classes));
|
|
26
25
|
}
|
|
27
26
|
if (classMirror.interfaces.length) {
|
|
28
|
-
listener.onInnerInterfacesDeclaration(classMirror.interfaces);
|
|
27
|
+
listener.onInnerInterfacesDeclaration(this.sortType(classMirror.interfaces));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -6,7 +6,7 @@ export class InterfaceWalker extends Walker {
|
|
|
6
6
|
listener.onTypeDeclaration(this.type);
|
|
7
7
|
const interfaceMirror = this.type as InterfaceMirror;
|
|
8
8
|
if (interfaceMirror.methods.length) {
|
|
9
|
-
listener.onMethodsDeclaration(interfaceMirror.methods);
|
|
9
|
+
listener.onMethodsDeclaration(this.sortType(interfaceMirror.methods));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PropertyMirror,
|
|
9
9
|
Type,
|
|
10
10
|
} from '@cparra/apex-reflection';
|
|
11
|
-
import {
|
|
11
|
+
import { Settings } from '../../settings';
|
|
12
12
|
|
|
13
13
|
export interface WalkerListener {
|
|
14
14
|
onTypeDeclaration(typeMirror: Type): void;
|
|
@@ -32,4 +32,11 @@ export abstract class Walker {
|
|
|
32
32
|
constructor(public type: Type) {}
|
|
33
33
|
|
|
34
34
|
abstract walk(listener: WalkerListener): void;
|
|
35
|
+
|
|
36
|
+
protected sortType<T extends { name: string }>(types: T[]): T[] {
|
|
37
|
+
if (Settings.getInstance().sortMembersAlphabetically()) {
|
|
38
|
+
return types.sort((a, b) => a.name.localeCompare(b.name));
|
|
39
|
+
}
|
|
40
|
+
return types;
|
|
41
|
+
}
|
|
35
42
|
}
|
package/src/settings.ts
CHANGED
|
@@ -13,6 +13,14 @@ export type OutputDir = {
|
|
|
13
13
|
fileDir: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
export type TargetType = {
|
|
17
|
+
name: string;
|
|
18
|
+
typeName: 'class' | 'interface' | 'enum';
|
|
19
|
+
accessModifier: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
group?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
16
24
|
export interface SettingsConfig {
|
|
17
25
|
sourceDirectory: string;
|
|
18
26
|
recursive: boolean;
|
|
@@ -28,8 +36,10 @@ export interface SettingsConfig {
|
|
|
28
36
|
openApiFileName: string;
|
|
29
37
|
includeMetadata: boolean;
|
|
30
38
|
rootDir?: string;
|
|
39
|
+
sortMembersAlphabetically?: boolean;
|
|
31
40
|
onAfterProcess?: (files: TargetFile[]) => void;
|
|
32
41
|
onBeforeFileWrite?: (file: TargetFile) => TargetFile;
|
|
42
|
+
frontMatterHeader?: (file: TargetType) => string[];
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
export class Settings {
|
|
@@ -107,6 +117,10 @@ export class Settings {
|
|
|
107
117
|
return this.config.includeMetadata;
|
|
108
118
|
}
|
|
109
119
|
|
|
120
|
+
public sortMembersAlphabetically(): boolean {
|
|
121
|
+
return this.config.sortMembersAlphabetically ?? false;
|
|
122
|
+
}
|
|
123
|
+
|
|
110
124
|
public getRootDir(): string | undefined {
|
|
111
125
|
return this.config.rootDir;
|
|
112
126
|
}
|
|
@@ -123,4 +137,11 @@ export class Settings {
|
|
|
123
137
|
}
|
|
124
138
|
return file;
|
|
125
139
|
}
|
|
140
|
+
|
|
141
|
+
public frontMatterHeader(file: TargetType): string[] {
|
|
142
|
+
if (this.config.frontMatterHeader) {
|
|
143
|
+
return this.config.frontMatterHeader(file);
|
|
144
|
+
}
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
126
147
|
}
|
|
@@ -40,11 +40,11 @@ export default class ClassFileGeneratorHelper {
|
|
|
40
40
|
// If the types the same groups then we simply link directly to that file
|
|
41
41
|
return './';
|
|
42
42
|
} else {
|
|
43
|
-
// If the types have different groups then we have to go up a directory
|
|
43
|
+
// If the types have different groups, then we have to go up a directory
|
|
44
44
|
return `../${this.getSanitizedGroup(classModel)}/`;
|
|
45
45
|
}
|
|
46
46
|
} else {
|
|
47
|
-
// If nothing is being processed then we assume we are at the root and links should include the groups
|
|
47
|
+
// If nothing is being processed, then we assume we are at the root and links should include the groups
|
|
48
48
|
return `./${this.getSanitizedGroup(classModel)}/`;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -3,6 +3,7 @@ import { Type } from '@cparra/apex-reflection';
|
|
|
3
3
|
import { MarkdownHomeFile } from '../../../model/markdown-home-file';
|
|
4
4
|
import { MarkdownTypeFile } from '../../../model/markdown-type-file';
|
|
5
5
|
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
6
|
+
import { Settings } from '../../../settings';
|
|
6
7
|
|
|
7
8
|
export class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
8
9
|
homeFileName(): string {
|
|
@@ -10,17 +11,39 @@ export class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
onBeforeProcess = (types: Type[]) => {
|
|
13
|
-
this._fileContainer.pushFile(new MarkdownHomeFile(this.homeFileName(), types, this.
|
|
14
|
+
this._fileContainer.pushFile(new MarkdownHomeFile(this.homeFileName(), types, this.frontMatterForHomeFile));
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
onProcess(type: Type): void {
|
|
17
|
-
this._fileContainer.pushFile(new MarkdownTypeFile(type, 1, this.
|
|
18
|
+
this._fileContainer.pushFile(new MarkdownTypeFile(type, 1, this.getFrontMatterHeader(type)));
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
get
|
|
21
|
+
get frontMatterForHomeFile(): string {
|
|
21
22
|
return '---\nlayout: default\n---';
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
getFrontMatterHeader(type: Type): string {
|
|
26
|
+
const headerLines = ['---'];
|
|
27
|
+
// "layout: default" is a required front matter header for Jekyll
|
|
28
|
+
headerLines.push('layout: default');
|
|
29
|
+
// Add any additional front matter headers that might have been configured in the settings
|
|
30
|
+
const targetType = {
|
|
31
|
+
name: type.name,
|
|
32
|
+
typeName: type.type_name,
|
|
33
|
+
accessModifier: type.access_modifier,
|
|
34
|
+
group: type.group,
|
|
35
|
+
description: type.docComment?.description,
|
|
36
|
+
};
|
|
37
|
+
const configuredHeaders = Settings.getInstance().frontMatterHeader(targetType);
|
|
38
|
+
if (configuredHeaders) {
|
|
39
|
+
configuredHeaders.forEach((header) => {
|
|
40
|
+
headerLines.push(header);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
headerLines.push('---');
|
|
44
|
+
return headerLines.join('\n');
|
|
45
|
+
}
|
|
46
|
+
|
|
24
47
|
getLinkingStrategy(): LinkingStrategy {
|
|
25
48
|
return 'path-relative';
|
|
26
49
|
}
|
package/ROADMAP.md
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[ ] Respect access modifiers where the properties/methods are different from the class declaration. For example,
|
|
2
|
-
AuraEnabled properties do not live in an AuraEnabled class, so there's no way to just generate docs to showcase the
|
|
3
|
-
AuraEnabled properties of a class without some sort of combination of also exposing other public/globals
|
|
4
|
-
|
|
5
|
-
[ ] Versioning capabilities. When creating the doc you specify a version number, and a new directory is created for the
|
|
6
|
-
files, instead of just overriding
|
|
7
|
-
|
|
8
|
-
[ ] New generatortype: To JsDocs from AuraEnabled
|
|
9
|
-
|
|
10
|
-
[ ] More unit tests
|
|
11
|
-
|
|
12
|
-
[ ] config.js support to allow for injections, home header, etc.
|
|
13
|
-
|
|
14
|
-
[ ] Add configuration setting that allows someone to set the "namespace"
|
|
15
|
-
|
|
16
|
-
[ ] Homepage support similar to what docsify does
|