@cparra/apexdocs 1.13.4 → 1.13.8
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 +277 -277
- package/docs/Gemfile.lock +1 -1
- package/docs/Sample-Classes/SampleClass.md +115 -30
- package/docs/Sample-Classes/SampleClass2.md +115 -0
- package/docs/Sample-Interfaces/SampleInterface.md +32 -13
- package/docs/index.md +27 -20
- package/docs/single-file/Sample-Classes/SampleClass.md +115 -0
- package/examples/apex/SampleClass.cls +13 -5
- package/examples/apex/SampleClass2.cls +96 -0
- package/examples/apex/SampleInterface.cls +3 -1
- package/lib/AsJsDocsProcessor.d.ts +1 -1
- package/lib/ClassFileGeneratorHelper.d.ts +2 -2
- package/lib/ClassFileGeneratorHelper.js +8 -3
- package/lib/ClassFileGeneratorHelper.test.js +1 -1
- package/lib/{command → Command}/Generate.d.ts +1 -1
- package/lib/{command → Command}/Generate.js +1 -1
- package/lib/{command → Command}/__test__/Generte.test.d.ts +0 -0
- package/lib/{command → Command}/__test__/Generte.test.js +2 -2
- package/lib/DocsProcessor.d.ts +2 -1
- package/lib/DocsProcessor.js +3 -0
- package/lib/FileManager.d.ts +1 -1
- package/lib/JekyllDocsProcessor.d.ts +1 -0
- package/lib/JekyllDocsProcessor.js +3 -0
- package/lib/MarkdownDocsProcessor.d.ts +1 -1
- package/lib/MarkdownDocsProcessor.js +7 -5
- package/lib/MarkdownHelper.d.ts +1 -1
- package/lib/MarkdownHelper.js +2 -2
- package/lib/{parser → Parser}/ClassParser.d.ts +1 -1
- package/lib/{parser → Parser}/ClassParser.js +6 -2
- package/lib/{parser → Parser}/EnumParser.d.ts +1 -1
- package/lib/{parser → Parser}/EnumParser.js +1 -1
- package/lib/{parser → Parser}/FileParser.d.ts +1 -1
- package/lib/{parser → Parser}/FileParser.js +1 -0
- package/lib/{parser → Parser}/MethodParser.d.ts +1 -1
- package/lib/{parser → Parser}/MethodParser.js +1 -1
- package/lib/{parser → Parser}/PropertyParser.d.ts +1 -1
- package/lib/{parser → Parser}/PropertyParser.js +1 -1
- package/lib/{parser → Parser}/__test__/ClassParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/ClassParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/FileParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/FileParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/MethodParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/MethodParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/PropertyParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/PropertyParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/testFileContents.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/testFileContents.js +0 -0
- package/lib/application/Apexdocs.d.ts +11 -0
- package/lib/application/Apexdocs.js +41 -0
- package/lib/application/Apexdocs.js.map +1 -0
- package/lib/cli/generate.js +1 -1
- package/lib/cli/generate.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -0
- package/lib/model/file.d.ts +10 -0
- package/lib/model/file.js +23 -0
- package/lib/model/file.js.map +1 -0
- package/lib/model/manifest-diff.d.ts +5 -0
- package/lib/model/manifest-diff.js +10 -0
- package/lib/model/manifest-diff.js.map +1 -0
- package/lib/model/manifest.d.ts +22 -0
- package/lib/model/manifest.js +42 -0
- package/lib/model/manifest.js.map +1 -0
- package/lib/model/markdown-file.d.ts +10 -0
- package/lib/model/markdown-file.js +52 -0
- package/lib/model/markdown-file.js.map +1 -0
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js +33 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/index.d.ts +3 -0
- package/lib/model/markdown-generation-util/index.js +9 -0
- package/lib/model/markdown-generation-util/index.js.map +1 -0
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js +97 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js +25 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/lib/model/markdown-home-file.d.ts +11 -0
- package/lib/model/markdown-home-file.js +50 -0
- package/lib/model/markdown-home-file.js.map +1 -0
- package/lib/model/markdown-type-file.d.ts +17 -0
- package/lib/model/markdown-type-file.js +62 -0
- package/lib/model/markdown-type-file.js.map +1 -0
- package/lib/service/apex-file-reader.d.ts +13 -0
- package/lib/service/apex-file-reader.js +39 -0
- package/lib/service/apex-file-reader.js.map +1 -0
- package/lib/service/file-system.d.ts +12 -0
- package/lib/service/file-system.js +21 -0
- package/lib/service/file-system.js.map +1 -0
- package/lib/service/file-writer.d.ts +4 -0
- package/lib/service/file-writer.js +25 -0
- package/lib/service/file-writer.js.map +1 -0
- package/lib/service/manifest-factory.d.ts +9 -0
- package/lib/service/manifest-factory.js +13 -0
- package/lib/service/manifest-factory.js.map +1 -0
- package/lib/service/parser.d.ts +9 -0
- package/lib/service/parser.js +17 -0
- package/lib/service/parser.js.map +1 -0
- package/lib/service/walkers/class-walker.d.ts +4 -0
- package/lib/service/walkers/class-walker.js +32 -0
- package/lib/service/walkers/class-walker.js.map +1 -0
- package/lib/service/walkers/enum-walker.d.ts +4 -0
- package/lib/service/walkers/enum-walker.js +10 -0
- package/lib/service/walkers/enum-walker.js.map +1 -0
- package/lib/service/walkers/interface-walker.d.ts +4 -0
- package/lib/service/walkers/interface-walker.js +14 -0
- package/lib/service/walkers/interface-walker.js.map +1 -0
- package/lib/service/walkers/walker-factory.d.ts +5 -0
- package/lib/service/walkers/walker-factory.js +20 -0
- package/lib/service/walkers/walker-factory.js.map +1 -0
- package/lib/service/walkers/walker.d.ts +16 -0
- package/lib/service/walkers/walker.js +9 -0
- package/lib/service/walkers/walker.js.map +1 -0
- package/lib/{Settings.d.ts → settings.d.ts} +0 -0
- package/lib/{Settings.js → settings.js} +0 -0
- package/lib/settings.js.map +1 -0
- package/lib/transpiler/file-container.d.ts +6 -0
- package/lib/transpiler/file-container.js +15 -0
- package/lib/transpiler/file-container.js.map +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +6 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +17 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +4 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +10 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +8 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +24 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +8 -0
- package/lib/transpiler/processor-type-transpiler.js +6 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -0
- package/lib/transpiler/transpiler.d.ts +5 -0
- package/lib/transpiler/transpiler.js +21 -0
- package/lib/transpiler/transpiler.js.map +1 -0
- package/lib/util/logger.d.ts +18 -0
- package/lib/util/logger.js +32 -0
- package/lib/util/logger.js.map +1 -0
- package/package.json +70 -68
- package/src/AsJsDocsProcessor.ts +1 -1
- package/src/ClassFileGeneratorHelper.test.ts +1 -1
- package/src/ClassFileGeneratorHelper.ts +12 -3
- package/src/{command → Command}/Generate.ts +2 -2
- package/src/{command → Command}/__test__/Generte.test.ts +2 -2
- package/src/DocsProcessor.ts +7 -1
- package/src/DocsifyDocsProcessor.ts +7 -7
- package/src/FileManager.ts +1 -1
- package/src/JekyllDocsProcessor.ts +4 -0
- package/src/MarkdownDocsProcessor.ts +9 -7
- package/src/MarkdownHelper.ts +3 -3
- package/src/{model → Model}/ApexModel.ts +0 -0
- package/src/{model → Model}/ClassModel.ts +0 -0
- package/src/{model → Model}/EnumModel.ts +0 -0
- package/src/{model → Model}/MethodModel.ts +0 -0
- package/src/{model → Model}/PropertyModel.ts +0 -0
- package/src/{model → Model}/__test__/ClassModel.test.ts +0 -0
- package/src/{model → Model}/__test__/MethodModel.test.ts +0 -0
- package/src/{model → Model}/__test__/PropertyModel.test.ts +0 -0
- package/src/{parser → Parser}/ClassParser.ts +7 -2
- package/src/{parser → Parser}/EnumParser.ts +1 -1
- package/src/{parser → Parser}/FileParser.ts +2 -1
- package/src/{parser → Parser}/MethodParser.ts +1 -1
- package/src/{parser → Parser}/PropertyParser.ts +1 -1
- package/src/{parser → Parser}/__test__/ClassParser.test.ts +0 -0
- package/src/{parser → Parser}/__test__/FileParser.test.ts +0 -0
- package/src/{parser → Parser}/__test__/MethodParser.test.ts +1 -1
- package/src/{parser → Parser}/__test__/PropertyParser.test.ts +1 -1
- package/src/{parser → Parser}/__test__/testFileContents.ts +0 -0
- package/src/cli/generate.ts +1 -1
- package/src/index.ts +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClassMirror, ConstructorMirror, EnumMirror, FieldMirror, InterfaceMirror, MethodMirror, PropertyMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
+
export interface WalkerListener {
|
|
3
|
+
onTypeDeclaration(typeMirror: Type): void;
|
|
4
|
+
onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void;
|
|
5
|
+
onFieldsDeclaration(fields: FieldMirror[]): void;
|
|
6
|
+
onPropertiesDeclaration(properties: PropertyMirror[]): void;
|
|
7
|
+
onMethodsDeclaration(methods: MethodMirror[]): void;
|
|
8
|
+
onInnerEnumsDeclaration(enums: EnumMirror[]): void;
|
|
9
|
+
onInnerClassesDeclaration(classes: ClassMirror[]): void;
|
|
10
|
+
onInnerInterfacesDeclaration(interfaces: InterfaceMirror[]): void;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class Walker {
|
|
13
|
+
type: Type;
|
|
14
|
+
constructor(type: Type);
|
|
15
|
+
abstract walk(listener: WalkerListener): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../../src/service/walkers/walker.ts"],"names":[],"mappings":";;AA8BA,MAAsB,MAAM;IAC1B,YAAmB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;CAGlC;AAJD,wBAIC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;AACA,4FAAwF;AACxF,iGAAwF;AAYxF,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,cAAc;QAChB,QAAQ,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YACnC,KAAK,QAAQ;gBACX,OAAO,IAAI,0CAAmB,EAAE,CAAC;YACnC,KAAK,SAAS;gBACZ,OAAO,IAAI,gCAAoB,EAAE,CAAC;YACpC;gBACE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC;CACF;AA1CD,4BA0CC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class FileContainer {
|
|
4
|
+
constructor() {
|
|
5
|
+
this._files = [];
|
|
6
|
+
}
|
|
7
|
+
files() {
|
|
8
|
+
return this._files;
|
|
9
|
+
}
|
|
10
|
+
pushFile(file) {
|
|
11
|
+
this._files.push(file);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.FileContainer = FileContainer;
|
|
15
|
+
//# sourceMappingURL=file-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-container.js","sourceRoot":"","sources":["../../src/transpiler/file-container.ts"],"names":[],"mappings":";;AAEA,MAAa,aAAa;IAA1B;QACE,WAAM,GAAW,EAAE,CAAC;IAStB,CAAC;IAPC,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,QAAQ,CAAC,IAAU;QACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AAVD,sCAUC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class ClassFileGeneratorHelper {
|
|
4
|
+
static getSanitizedGroup(classModel) {
|
|
5
|
+
return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
|
|
6
|
+
}
|
|
7
|
+
static getFileLink(classModel) {
|
|
8
|
+
return `[${classModel.name}](/${this.getSanitizedGroup(classModel)}/${classModel.name}.md)`;
|
|
9
|
+
}
|
|
10
|
+
static getClassGroup(classModel) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group');
|
|
13
|
+
return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : 'Misc';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = ClassFileGeneratorHelper;
|
|
17
|
+
//# sourceMappingURL=class-file-generatorHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AAEA,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,OAAO,IAAI,UAAU,CAAC,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,MAAM,CAAC;IAC9F,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,SAAG,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAC7G,aAAO,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,MAAM,CAAC;IACzC,CAAC;CACF;AAbD,2CAaC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const markdown_transpiler_base_1 = require("../markdown-transpiler-base");
|
|
4
|
+
class DocsifyDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspilerBase {
|
|
5
|
+
homeFileName() {
|
|
6
|
+
return 'README';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.default = DocsifyDocsProcessor;
|
|
10
|
+
//# sourceMappingURL=docsify-docs-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docsify-docs-processor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/docsify/docsify-docs-processor.ts"],"names":[],"mappings":";;AAAA,0EAAqE;AAErE,MAAqB,oBAAqB,SAAQ,iDAAsB;IACtE,YAAY;QACV,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAJD,uCAIC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
|
+
import { Type } from '@cparra/apex-reflection';
|
|
3
|
+
export declare class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
4
|
+
homeFileName(): string;
|
|
5
|
+
onBeforeProcess: (types: Type[]) => void;
|
|
6
|
+
onProcess(type: Type): void;
|
|
7
|
+
get frontMatterHeader(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const markdown_transpiler_base_1 = require("../markdown-transpiler-base");
|
|
4
|
+
const markdown_home_file_1 = require("../../../model/markdown-home-file");
|
|
5
|
+
const markdown_type_file_1 = require("../../../model/markdown-type-file");
|
|
6
|
+
class JekyllDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspilerBase {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.onBeforeProcess = (types) => {
|
|
10
|
+
this._fileContainer.pushFile(new markdown_home_file_1.MarkdownHomeFile(this.homeFileName(), types, this.frontMatterHeader));
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
homeFileName() {
|
|
14
|
+
return 'index';
|
|
15
|
+
}
|
|
16
|
+
onProcess(type) {
|
|
17
|
+
this._fileContainer.pushFile(new markdown_type_file_1.MarkdownTypeFile(type, 1, this.frontMatterHeader));
|
|
18
|
+
}
|
|
19
|
+
get frontMatterHeader() {
|
|
20
|
+
return '---\nlayout: default\n---';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.JekyllDocsProcessor = JekyllDocsProcessor;
|
|
24
|
+
//# sourceMappingURL=jekyll-docsProcessor.js.map
|
|
@@ -0,0 +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;AAErE,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,iBAAiB,CAAC,CAAC,CAAC;QACzG,CAAC,CAAC;IASJ,CAAC;IAfC,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,iBAAiB,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,2BAA2B,CAAC;IACrC,CAAC;CACF;AAhBD,kDAgBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ProcessorTypeTranspiler from '../processor-type-transpiler';
|
|
2
|
+
import { Type } from '@cparra/apex-reflection';
|
|
3
|
+
import { FileContainer } from '../file-container';
|
|
4
|
+
export declare abstract class MarkdownTranspilerBase extends ProcessorTypeTranspiler {
|
|
5
|
+
protected readonly _fileContainer: FileContainer;
|
|
6
|
+
constructor();
|
|
7
|
+
abstract homeFileName(): string;
|
|
8
|
+
fileBuilder(): FileContainer;
|
|
9
|
+
onBeforeProcess: (types: Type[]) => void;
|
|
10
|
+
onProcess(type: Type): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const processor_type_transpiler_1 = require("../processor-type-transpiler");
|
|
4
|
+
const file_container_1 = require("../file-container");
|
|
5
|
+
const markdown_home_file_1 = require("../../model/markdown-home-file");
|
|
6
|
+
const markdown_type_file_1 = require("../../model/markdown-type-file");
|
|
7
|
+
class MarkdownTranspilerBase extends processor_type_transpiler_1.default {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.onBeforeProcess = (types) => {
|
|
11
|
+
this._fileContainer.pushFile(new markdown_home_file_1.MarkdownHomeFile(this.homeFileName(), types));
|
|
12
|
+
};
|
|
13
|
+
this._fileContainer = new file_container_1.FileContainer();
|
|
14
|
+
}
|
|
15
|
+
fileBuilder() {
|
|
16
|
+
return this._fileContainer;
|
|
17
|
+
}
|
|
18
|
+
onProcess(type) {
|
|
19
|
+
this._fileContainer.pushFile(new markdown_type_file_1.MarkdownTypeFile(type));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.MarkdownTranspilerBase = MarkdownTranspilerBase;
|
|
23
|
+
//# sourceMappingURL=markdown-transpiler-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-transpiler-base.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/markdown-transpiler-base.ts"],"names":[],"mappings":";;AAAA,4EAAmE;AAEnE,sDAAkD;AAClD,uEAAkE;AAClE,uEAAkE;AAElE,MAAsB,sBAAuB,SAAQ,mCAAuB;IAG1E;QACE,KAAK,EAAE,CAAC;QAUV,oBAAe,GAAG,CAAC,KAAa,EAAE,EAAE;YAClC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,qCAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACjF,CAAC,CAAC;QAXA,IAAI,CAAC,cAAc,GAAG,IAAI,8BAAa,EAAE,CAAC;IAC5C,CAAC;IAID,WAAW;QACT,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAMD,SAAS,CAAC,IAAU;QAClB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,qCAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF;AArBD,wDAqBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
import { FileContainer } from './file-container';
|
|
3
|
+
export default abstract class ProcessorTypeTranspiler {
|
|
4
|
+
onBeforeProcess: ((types: Type[]) => void) | undefined;
|
|
5
|
+
abstract onProcess(type: Type): void;
|
|
6
|
+
onAfterProcess: ((types: Type[]) => void) | undefined;
|
|
7
|
+
abstract fileBuilder(): FileContainer;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor-type-transpiler.js","sourceRoot":"","sources":["../../src/transpiler/processor-type-transpiler.ts"],"names":[],"mappings":";;AAGA,MAA8B,uBAAuB;CAQpD;AARD,0CAQC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Transpiler {
|
|
4
|
+
static generate(types, processor) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const sortedTypes = types.sort((apexTypeA, apexTypeB) => {
|
|
7
|
+
if (apexTypeA.name < apexTypeB.name)
|
|
8
|
+
return -1;
|
|
9
|
+
if (apexTypeA.name > apexTypeB.name)
|
|
10
|
+
return 1;
|
|
11
|
+
return 0;
|
|
12
|
+
});
|
|
13
|
+
(_a = processor.onBeforeProcess) === null || _a === void 0 ? void 0 : _a.call(processor, sortedTypes);
|
|
14
|
+
sortedTypes.forEach((currentType) => {
|
|
15
|
+
processor.onProcess(currentType);
|
|
16
|
+
});
|
|
17
|
+
(_b = processor.onAfterProcess) === null || _b === void 0 ? void 0 : _b.call(processor, sortedTypes);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Transpiler;
|
|
21
|
+
//# sourceMappingURL=transpiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpiler.js","sourceRoot":"","sources":["../../src/transpiler/transpiler.ts"],"names":[],"mappings":";;AAGA,MAAqB,UAAU;IAC7B,MAAM,CAAC,QAAQ,CAAC,KAAa,EAAE,SAAkC;;QAC/D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;YACtD,IAAI,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,CAAC;YAC/C,IAAI,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,MAAA,SAAS,CAAC,eAAe,+CAAzB,SAAS,EAAmB,WAAW,EAAE;QACzC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YAClC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,MAAA,SAAS,CAAC,cAAc,+CAAxB,SAAS,EAAkB,WAAW,EAAE;IAC1C,CAAC;CACF;AAdD,6BAcC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs messages to the console.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Logger {
|
|
5
|
+
/**
|
|
6
|
+
* Logs a message with optional arguments.
|
|
7
|
+
* @param message The message to log.
|
|
8
|
+
* @param args Optional arguments.
|
|
9
|
+
*/
|
|
10
|
+
static log(message: string, ...args: string[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Logs an error message with optional arguments.
|
|
13
|
+
* @param message The error message to log.
|
|
14
|
+
* @param args Optional arguments.
|
|
15
|
+
*/
|
|
16
|
+
static error(message: string, ...args: string[]): void;
|
|
17
|
+
private static logSingle;
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chalk = require("chalk");
|
|
4
|
+
/**
|
|
5
|
+
* Logs messages to the console.
|
|
6
|
+
*/
|
|
7
|
+
class Logger {
|
|
8
|
+
/**
|
|
9
|
+
* Logs a message with optional arguments.
|
|
10
|
+
* @param message The message to log.
|
|
11
|
+
* @param args Optional arguments.
|
|
12
|
+
*/
|
|
13
|
+
static log(message, ...args) {
|
|
14
|
+
this.logSingle(message);
|
|
15
|
+
args.forEach((arg) => {
|
|
16
|
+
this.logSingle(arg);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Logs an error message with optional arguments.
|
|
21
|
+
* @param message The error message to log.
|
|
22
|
+
* @param args Optional arguments.
|
|
23
|
+
*/
|
|
24
|
+
static error(message, ...args) {
|
|
25
|
+
this.log(`${chalk.red(message)}`, ...args);
|
|
26
|
+
}
|
|
27
|
+
static logSingle(message) {
|
|
28
|
+
process.stdout.write(`${chalk.green(new Date().toLocaleString() + ': ')}${message}\n`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Logger = Logger;
|
|
32
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/util/logger.ts"],"names":[],"mappings":";;AAAA,+BAA+B;AAE/B;;GAEG;AACH,MAAa,MAAM;IACjB;;;;OAIG;IACI,MAAM,CAAC,GAAG,CAAC,OAAe,EAAE,GAAG,IAAc;QAClD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,GAAG,IAAc;QACpD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,OAAe;QACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACzF,CAAC;CACF;AAzBD,wBAyBC"}
|
package/package.json
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cparra/apexdocs",
|
|
3
|
-
"version": "1.13.
|
|
4
|
-
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"apex",
|
|
7
|
-
"salesforce",
|
|
8
|
-
"documentation",
|
|
9
|
-
"cli",
|
|
10
|
-
"apex-docs",
|
|
11
|
-
"docs"
|
|
12
|
-
],
|
|
13
|
-
"main": "lib/index.js",
|
|
14
|
-
"bin": {
|
|
15
|
-
"apexdocs-generate": "lib/cli/generate.js"
|
|
16
|
-
},
|
|
17
|
-
"types": "lib/index.d.ts",
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "jest --coverage",
|
|
20
|
-
"build": "tsc --declaration",
|
|
21
|
-
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
22
|
-
"lint": "tslint -p tsconfig.json",
|
|
23
|
-
"prepare": "npm run build",
|
|
24
|
-
"version": "npm run format && git add -A src",
|
|
25
|
-
"postversion": "git push && git push --tags"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@types/
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/
|
|
38
|
-
"@types/
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"tslint
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"html-entities": "^2.3.2"
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@cparra/apexdocs",
|
|
3
|
+
"version": "1.13.8",
|
|
4
|
+
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"apex",
|
|
7
|
+
"salesforce",
|
|
8
|
+
"documentation",
|
|
9
|
+
"cli",
|
|
10
|
+
"apex-docs",
|
|
11
|
+
"docs"
|
|
12
|
+
],
|
|
13
|
+
"main": "lib/index.js",
|
|
14
|
+
"bin": {
|
|
15
|
+
"apexdocs-generate": "lib/cli/generate.js"
|
|
16
|
+
},
|
|
17
|
+
"types": "lib/index.d.ts",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "jest --coverage",
|
|
20
|
+
"build": "tsc --declaration",
|
|
21
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
22
|
+
"lint": "tslint -p tsconfig.json",
|
|
23
|
+
"prepare": "npm run build",
|
|
24
|
+
"version": "npm run format && git add -A src",
|
|
25
|
+
"postversion": "git push && git push --tags",
|
|
26
|
+
"generage:sample": "node lib/cli/generate.js -s examples -t docs"
|
|
27
|
+
},
|
|
28
|
+
"author": "Cesar Parra",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/cesarParra/apexdocs"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/html-entities": "^1.3.4",
|
|
36
|
+
"@types/jest": "^25.1.3",
|
|
37
|
+
"@types/node": "^13.7.4",
|
|
38
|
+
"@types/shelljs": "^0.8.6",
|
|
39
|
+
"@types/yargs": "^15.0.3",
|
|
40
|
+
"husky": "^4.2.3",
|
|
41
|
+
"jest": "^27.0.4",
|
|
42
|
+
"prettier": "^1.19.1",
|
|
43
|
+
"ts-jest": "^27.0.3",
|
|
44
|
+
"tslint": "^6.0.0",
|
|
45
|
+
"tslint-config-prettier": "^1.18.0",
|
|
46
|
+
"typescript": "^3.8.2"
|
|
47
|
+
},
|
|
48
|
+
"husky": {
|
|
49
|
+
"hooks": {
|
|
50
|
+
"pre-commit": "npm run format"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"jest": {
|
|
54
|
+
"transform": {
|
|
55
|
+
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
|
|
56
|
+
},
|
|
57
|
+
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
|
|
58
|
+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
|
59
|
+
"moduleFileExtensions": [
|
|
60
|
+
"ts",
|
|
61
|
+
"tsx",
|
|
62
|
+
"js"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"html-entities": "^2.3.2",
|
|
67
|
+
"sanitize-filename-ts": "1.0.2",
|
|
68
|
+
"yargs": "^16.0.3"
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/AsJsDocsProcessor.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from 'path';
|
|
|
3
3
|
|
|
4
4
|
import DocsProcessor from './DocsProcessor';
|
|
5
5
|
import JsHelper from './JsHelper';
|
|
6
|
-
import ClassModel from './
|
|
6
|
+
import ClassModel from './Model/ClassModel';
|
|
7
7
|
|
|
8
8
|
export default class AsJsDocsProcessor extends DocsProcessor {
|
|
9
9
|
process(classModel: ClassModel, outputDir: string) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ClassFileGeneratorHelper from './ClassFileGeneratorHelper';
|
|
2
|
-
import ClassModel from './
|
|
2
|
+
import ClassModel from './Model/ClassModel';
|
|
3
3
|
import Settings from './Settings';
|
|
4
4
|
|
|
5
5
|
test('that getSanitizedGroup returns the same string when there is nothing to sanitize', () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import ClassModel from './
|
|
1
|
+
import ClassModel from './Model/ClassModel';
|
|
2
2
|
import Settings from './Settings';
|
|
3
3
|
import Configuration from './Configuration';
|
|
4
|
+
import DocsProcessor from './DocsProcessor';
|
|
4
5
|
|
|
5
6
|
export default class ClassFileGeneratorHelper {
|
|
6
7
|
public static getSanitizedGroup(classModel: ClassModel) {
|
|
@@ -10,8 +11,16 @@ export default class ClassFileGeneratorHelper {
|
|
|
10
11
|
.replace('.', '');
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
public static getFileLink(classModel: ClassModel) {
|
|
14
|
-
|
|
14
|
+
public static getFileLink(classModel: ClassModel, forRelatedReference: boolean = false) {
|
|
15
|
+
let defaultRoot = '';
|
|
16
|
+
if (forRelatedReference && Settings.getInstance().getShouldGroup()) {
|
|
17
|
+
defaultRoot =
|
|
18
|
+
Settings.getInstance()
|
|
19
|
+
.getDocsProcessor()
|
|
20
|
+
?.defaultRoot() ?? '';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const root = Configuration.getConfig()?.root ? Configuration.getConfig()?.root : defaultRoot;
|
|
15
24
|
let fileLink;
|
|
16
25
|
if (Settings.getInstance().getShouldGroup()) {
|
|
17
26
|
fileLink = `[${classModel.getClassName()}](${root}/${this.getSanitizedGroup(
|
|
@@ -2,8 +2,8 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
|
|
4
4
|
import Settings from '../Settings';
|
|
5
|
-
import ClassModel from '../
|
|
6
|
-
import FileParser from '../
|
|
5
|
+
import ClassModel from '../Model/ClassModel';
|
|
6
|
+
import FileParser from '../Parser/FileParser';
|
|
7
7
|
|
|
8
8
|
import DocsifyDocsProcessor from '../DocsifyDocsProcessor';
|
|
9
9
|
import JekyllDocsProcessor from '../JekyllDocsProcessor';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import { generate } from '../Generate';
|
|
3
|
-
import FileParser from '../../
|
|
3
|
+
import FileParser from '../../Parser/FileParser';
|
|
4
4
|
|
|
5
5
|
jest.mock('fs');
|
|
6
|
-
jest.mock('../../
|
|
6
|
+
jest.mock('../../Parser/FileParser');
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
(FileParser as jest.Mock).mockClear();
|
package/src/DocsProcessor.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import ClassModel from './
|
|
1
|
+
import ClassModel from './Model/ClassModel';
|
|
2
2
|
|
|
3
3
|
export default abstract class DocsProcessor {
|
|
4
4
|
// tslint:disable-next-line:no-empty
|
|
5
5
|
public onBeforeProcess(classes: ClassModel[], outputDir: string) {}
|
|
6
|
+
|
|
6
7
|
abstract process(cModel: ClassModel, outputDir: string): void;
|
|
8
|
+
|
|
7
9
|
// tslint:disable-next-line:no-empty
|
|
8
10
|
public onAfterProcess(classes: ClassModel[], outputDir: string) {}
|
|
11
|
+
|
|
12
|
+
public defaultRoot(): string {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
9
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import MarkdownDocsProcessor from './MarkdownDocsProcessor';
|
|
2
|
-
|
|
3
|
-
export default class DocsifyDocsProcessor extends MarkdownDocsProcessor {
|
|
4
|
-
getHomeFileName(): string {
|
|
5
|
-
return 'README.md';
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
import MarkdownDocsProcessor from './MarkdownDocsProcessor';
|
|
2
|
+
|
|
3
|
+
export default class DocsifyDocsProcessor extends MarkdownDocsProcessor {
|
|
4
|
+
getHomeFileName(): string {
|
|
5
|
+
return 'README.md';
|
|
6
|
+
}
|
|
7
|
+
}
|
package/src/FileManager.ts
CHANGED
|
@@ -14,6 +14,10 @@ export default class JekyllDocsProcessor extends MarkdownDocsProcessor {
|
|
|
14
14
|
this.addFrontMatterHeader(generator);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
defaultRoot(): string {
|
|
18
|
+
return '..';
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
private addFrontMatterHeader(generator: MarkdownHelper) {
|
|
18
22
|
generator.addText('---');
|
|
19
23
|
generator.addText('layout: default');
|
|
@@ -3,10 +3,10 @@ import * as path from 'path';
|
|
|
3
3
|
|
|
4
4
|
import DocsProcessor from './DocsProcessor';
|
|
5
5
|
import MarkdownHelper from './MarkdownHelper';
|
|
6
|
-
import ClassModel from './
|
|
6
|
+
import ClassModel from './Model/ClassModel';
|
|
7
7
|
import Settings from './Settings';
|
|
8
8
|
import Configuration from './Configuration';
|
|
9
|
-
import MethodModel from './
|
|
9
|
+
import MethodModel from './Model/MethodModel';
|
|
10
10
|
import ClassFileGeneratorHelper from './ClassFileGeneratorHelper';
|
|
11
11
|
|
|
12
12
|
export default abstract class MarkdownDocsProcessor extends DocsProcessor {
|
|
@@ -142,7 +142,7 @@ export default abstract class MarkdownDocsProcessor extends DocsProcessor {
|
|
|
142
142
|
|
|
143
143
|
generator.addBlankLine();
|
|
144
144
|
if (relatedClass) {
|
|
145
|
-
generator.addText(ClassFileGeneratorHelper.getFileLink(relatedClass));
|
|
145
|
+
generator.addText(ClassFileGeneratorHelper.getFileLink(relatedClass, true));
|
|
146
146
|
} else {
|
|
147
147
|
generator.addText(relatedClassName);
|
|
148
148
|
}
|
|
@@ -367,9 +367,10 @@ export default abstract class MarkdownDocsProcessor extends DocsProcessor {
|
|
|
367
367
|
|
|
368
368
|
private addParameters(generator: MarkdownHelper, level: number, methodModel: MethodModel) {
|
|
369
369
|
generator.addTitle('Parameters', level + 3);
|
|
370
|
+
generator.addBlankLine();
|
|
370
371
|
// Building a table to display the parameters
|
|
371
|
-
generator.addText('|Param|Description|');
|
|
372
|
-
generator.addText('
|
|
372
|
+
generator.addText('| Param | Description |');
|
|
373
|
+
generator.addText('| ----- | ----------- |');
|
|
373
374
|
|
|
374
375
|
methodModel.getParams().forEach(param => {
|
|
375
376
|
const paramName = param.substr(0, param.indexOf(' '));
|
|
@@ -396,9 +397,10 @@ export default abstract class MarkdownDocsProcessor extends DocsProcessor {
|
|
|
396
397
|
|
|
397
398
|
private addThrowsBlock(generator: MarkdownHelper, level: number, methodModel: MethodModel) {
|
|
398
399
|
generator.addTitle('Throws', level + 3);
|
|
400
|
+
generator.addBlankLine();
|
|
399
401
|
// Building a table to display the exceptions
|
|
400
|
-
generator.addText('|Exception|Description|');
|
|
401
|
-
generator.addText('
|
|
402
|
+
generator.addText('| Exception | Description |');
|
|
403
|
+
generator.addText('| --------- | ----------- |');
|
|
402
404
|
|
|
403
405
|
methodModel.getThrownExceptions().forEach(param => {
|
|
404
406
|
const exceptionName = param.substr(0, param.indexOf(' '));
|