@cparra/apexdocs 2.4.0 → 2.5.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 +10 -10
- package/docs/.nojekyll +0 -0
- package/docs/Main/GroupedClass.md +10 -0
- package/docs/{Sample-Classes → Main}/SampleClass.md +5 -1
- package/docs/README.md +3 -4
- package/docs/index.html +22 -0
- package/examples/force-app/main/default/classes/GroupedClass.cls +1 -1
- package/examples/force-app/main/default/classes/SampleClass.cls +1 -1
- package/lib/application/Apexdocs.js +2 -1
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +3 -3
- package/lib/cli/generate.js.map +1 -1
- package/lib/model/markdown-file.js +1 -0
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +7 -3
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/service/state.d.ts +9 -0
- package/lib/service/state.js +20 -0
- package/lib/service/state.js.map +1 -0
- package/lib/settings.d.ts +2 -1
- package/lib/settings.js +11 -2
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +26 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +2 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +3 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +2 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +3 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +14 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +2 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -1
- package/lib/transpiler/transpiler.js +2 -0
- package/lib/transpiler/transpiler.js.map +1 -1
- package/package.json +1 -1
- package/src/application/Apexdocs.ts +9 -1
- package/src/cli/generate.ts +3 -3
- package/src/model/markdown-file.ts +1 -0
- package/src/model/markdown-generation-util/method-declaration-util.ts +6 -1
- package/src/service/state.ts +24 -0
- package/src/settings.ts +13 -3
- package/src/transpiler/markdown/class-file-generatorHelper.ts +28 -2
- package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +5 -0
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +5 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +12 -0
- package/src/transpiler/processor-type-transpiler.ts +4 -0
- package/src/transpiler/transpiler.ts +2 -0
- package/docs/Utils/GroupedClass.md +0 -10
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ public class MyClass {
|
|
|
75
75
|
|
|
76
76
|
### Demo
|
|
77
77
|
|
|
78
|
-
ApexDocs currently supports generating markdown files for Jekyll and Docsify sites.
|
|
78
|
+
ApexDocs currently supports generating markdown files for Jekyll and Docsify sites, as well as generating plain markdown files.
|
|
79
79
|
|
|
80
80
|
### In the wild
|
|
81
81
|
|
|
@@ -114,15 +114,15 @@ apexdocs-generate
|
|
|
114
114
|
|
|
115
115
|
The CLI supports the following parameters:
|
|
116
116
|
|
|
117
|
-
| Parameter | Alias | Description
|
|
118
|
-
|
|
119
|
-
| --sourceDir | -s | The directory location which contains your apex .cls classes.
|
|
120
|
-
| --targetDir | -t | The directory location where documentation will be generated to.
|
|
121
|
-
| --recursive | -r | Whether .cls classes will be searched for recursively in the directory provided.
|
|
122
|
-
| --scope | -p | A list of scopes to document. Values should be separated by a space, e.g --scope public private
|
|
123
|
-
| --targetGenerator | -g | Define the static file generator for which the documents will be created. Currently supports jekyll and docsify.
|
|
124
|
-
| --indexOnly | N/A | Defines whether only the index file should be
|
|
125
|
-
| --defaultGroupName | N/A | Defines the `@group` name to be used when a file does not specify it.
|
|
117
|
+
| Parameter | Alias | Description | Default | Required |
|
|
118
|
+
|--------------------|-------|------------------------------------------------------------------------------------------------------------------|-----------------|----------|
|
|
119
|
+
| --sourceDir | -s | The directory location which contains your apex .cls classes. | N/A | Yes |
|
|
120
|
+
| --targetDir | -t | The directory location where documentation will be generated to. | `docs` | No |
|
|
121
|
+
| --recursive | -r | Whether .cls classes will be searched for recursively in the directory provided. | `true` | No |
|
|
122
|
+
| --scope | -p | A list of scopes to document. Values should be separated by a space, e.g --scope public private | `global` | No |
|
|
123
|
+
| --targetGenerator | -g | Define the static file generator for which the documents will be created. Currently supports jekyll and docsify. | `jekyll` | No |
|
|
124
|
+
| --indexOnly | N/A | Defines whether only the index file should be generated. | `false` | No |
|
|
125
|
+
| --defaultGroupName | N/A | Defines the `@group` name to be used when a file does not specify it. | `Miscellaneous` | No |
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
### Importing to your project
|
package/docs/.nojekyll
ADDED
|
File without changes
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
**Group**
|
|
12
|
+
**Group** Main
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
**CustomAnnotation** A Custom annotation
|
|
@@ -29,6 +29,7 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
|
|
|
29
29
|
Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
30
30
|
|
|
31
31
|
###### Throws
|
|
32
|
+
|
|
32
33
|
|Exception|Description|
|
|
33
34
|
|---|---|
|
|
34
35
|
|`ExcName`|some exception|
|
|
@@ -52,6 +53,7 @@ SampleClass sampleInstance = new SampleClass();
|
|
|
52
53
|
Constructs a SampleClass with an argument.
|
|
53
54
|
|
|
54
55
|
###### Parameters
|
|
56
|
+
|
|
55
57
|
|Param|Description|
|
|
56
58
|
|---|---|
|
|
57
59
|
|`argument1`|Argument1 definition|
|
|
@@ -92,6 +94,7 @@ This is a String property.
|
|
|
92
94
|
Executes commands based on the passed in argument.
|
|
93
95
|
|
|
94
96
|
#### Parameters
|
|
97
|
+
|
|
95
98
|
|Param|Description|
|
|
96
99
|
|---|---|
|
|
97
100
|
|`argument1`|Argument1 to debug|
|
|
@@ -118,6 +121,7 @@ System.debug(result);
|
|
|
118
121
|
Something here
|
|
119
122
|
|
|
120
123
|
#### Parameters
|
|
124
|
+
|
|
121
125
|
|Param|Description|
|
|
122
126
|
|---|---|
|
|
123
127
|
|
package/docs/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# Classes
|
|
2
|
-
##
|
|
2
|
+
## Main
|
|
3
3
|
|
|
4
|
-
### [GroupedClass](/
|
|
4
|
+
### [GroupedClass](/Main/GroupedClass.md)
|
|
5
5
|
|
|
6
6
|
Uses a block style apex doc
|
|
7
|
-
## Sample Classes
|
|
8
7
|
|
|
9
|
-
### [SampleClass](/
|
|
8
|
+
### [SampleClass](/Main/SampleClass.md)
|
|
10
9
|
|
|
11
10
|
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
12
11
|
## Miscellaneous
|
package/docs/index.html
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Document</title>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
+
<meta name="description" content="Description">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
9
|
+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
<script>
|
|
14
|
+
window.$docsify = {
|
|
15
|
+
name: '',
|
|
16
|
+
repo: ''
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<!-- Docsify v4 -->
|
|
20
|
+
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description This is a class description. This class relates to {@link SampleInterface}
|
|
3
3
|
* But this {@link ClassThatDoesNotExist} does not exist.
|
|
4
4
|
* You can also link using this syntax <<SampleInterface>>
|
|
5
|
-
* @group
|
|
5
|
+
* @group Main
|
|
6
6
|
* @CustomAnnotation A Custom annotation
|
|
7
7
|
* @author Cesar Parra
|
|
8
8
|
* @see SampleInterface
|
|
@@ -26,7 +26,8 @@ class Apexdocs {
|
|
|
26
26
|
const filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
|
|
27
27
|
types_repository_1.TypesRepository.getInstance().populate(filteredTypes);
|
|
28
28
|
logger_1.Logger.clear();
|
|
29
|
-
logger_1.Logger.logSingle(`
|
|
29
|
+
logger_1.Logger.logSingle(`Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${settings_1.Settings.getInstance().scope}`, false, 'green', false);
|
|
30
|
+
logger_1.Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
|
|
30
31
|
const processor = settings_1.Settings.getInstance().typeTranspiler;
|
|
31
32
|
transpiler_1.default.generate(filteredTypes, processor);
|
|
32
33
|
const generatedFiles = processor.fileBuilder().files();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAAuF;AACvF,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAC5D,uDAA+C;AAG/C;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,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;QACtD,eAAM,CAAC,KAAK,EAAE,CAAC;QAEf,eAAM,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAAuF;AACvF,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAC5D,uDAA+C;AAG/C;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,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ClD,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,eAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,QAAQ,oBAAoB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.js
CHANGED
|
@@ -34,13 +34,13 @@ const argv = yargs.options({
|
|
|
34
34
|
type: 'string',
|
|
35
35
|
alias: 'g',
|
|
36
36
|
default: 'jekyll',
|
|
37
|
-
choices: ['jekyll', 'docsify'],
|
|
38
|
-
describe: 'Define the static file generator for which the documents will be created. Currently supports jekyll, and
|
|
37
|
+
choices: ['jekyll', 'docsify', 'plain-markdown'],
|
|
38
|
+
describe: 'Define the static file generator for which the documents will be created. Currently supports jekyll, docsify, and plain markdown.',
|
|
39
39
|
},
|
|
40
40
|
indexOnly: {
|
|
41
41
|
type: 'boolean',
|
|
42
42
|
default: false,
|
|
43
|
-
describe: 'Defines whether only the index file should be
|
|
43
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
44
44
|
},
|
|
45
45
|
defaultGroupName: {
|
|
46
46
|
type: 'string',
|
package/lib/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS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ACzC,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACrD,IAAI,KAAK,CAAC;QACV,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,GAAG;YACD,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACrB;SACF,QAAQ,KAAK,EAAE;QAEhB,KAAK,MAAM,YAAY,IAAI,OAAO,EAAE;YAClC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACzF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAhHD,oCAgHC"}
|
|
@@ -38,13 +38,17 @@ function buildSignature(name, parameterAware) {
|
|
|
38
38
|
}
|
|
39
39
|
const signatureParameters = parameterAware.parameters.map((param) => `${param.type} ${param.name}`);
|
|
40
40
|
signature += signatureParameters.join(', ');
|
|
41
|
-
return
|
|
41
|
+
return `${signature})`;
|
|
42
42
|
}
|
|
43
43
|
function addParameters(markdownFile, methodModel, startingHeadingLevel) {
|
|
44
|
-
var _a;
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.length)) {
|
|
46
|
+
// If there are no parameters defined in the docs then we don't want to display this section
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
45
49
|
markdownFile.addTitle('Parameters', startingHeadingLevel + 3);
|
|
46
50
|
markdownFile.initializeTable('Param', 'Description');
|
|
47
|
-
(
|
|
51
|
+
(_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.paramAnnotations.forEach((paramAnnotation) => {
|
|
48
52
|
const paramName = paramAnnotation.paramName;
|
|
49
53
|
const paramDescription = paramAnnotation.bodyLines.join(' ');
|
|
50
54
|
markdownFile.addTableRow(`\`${paramName}\``, paramDescription);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/method-declaration-util.ts"],"names":[],"mappings":";;;AAGA,+EAA+E;AAE/E,SAAgB,aAAa,CAC3B,YAA0B,EAC1B,OAA6C,EAC7C,oBAA4B,EAC5B,SAAS,GAAG,EAAE;IAEd,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;;QAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAE,aAA8B,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACjG,YAAY,CAAC,QAAQ,CAAC,KAAK,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;QACvG,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAC/C,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,UAAI,aAAa,CAAC,UAAU,0CAAE,WAAW,EAAE;YACzC,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAC3D,YAAY,CAAC,YAAY,EAAE,CAAC;SAC7B;QAED,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE;YACnC,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;SAClE;QAED,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE;YAC3B,UAAU,CAAC,YAAY,EAAE,aAA6B,EAAE,oBAAoB,CAAC,CAAC;SAC/E;QAED,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;QAElE,4DAA8B,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QAE5D,UAAI,aAAa,CAAC,UAAU,0CAAE,iBAAiB,EAAE;YAC/C,UAAU,CAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;SAC/D;IACH,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,iBAAiB,EAAE,CAAC;AACnC,CAAC;AAtCD,sCAsCC;AAUD,SAAS,cAAc,CAAC,IAAY,EAAE,cAA8B;IAClE,IAAI,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC;IAC3B,IAAI,QAAQ,CAAC,cAAc,CAAC,IAAK,cAA+B,CAAC,eAAe,CAAC,MAAM,EAAE;QACvF,SAAS,GAAI,cAA+B,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC;KAC1F;IACD,MAAM,mBAAmB,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACpG,SAAS,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"method-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/method-declaration-util.ts"],"names":[],"mappings":";;;AAGA,+EAA+E;AAE/E,SAAgB,aAAa,CAC3B,YAA0B,EAC1B,OAA6C,EAC7C,oBAA4B,EAC5B,SAAS,GAAG,EAAE;IAEd,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;;QAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAE,aAA8B,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACjG,YAAY,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IAC5G,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAC3D,YAAY,CAAC,cAAc,EAAE,CAAC;IAC9B,MAAA,eAAe,CAAC,UAAU,0CAAE,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvE,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE;IACH,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,YAAY,CAAC,YAAY,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,QAAQ,CAAC,MAAyD;IACzE,OAAQ,MAAuB,CAAC,IAAI,KAAK,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
export default class State {
|
|
3
|
+
private static instance;
|
|
4
|
+
private typeBeingProcessed?;
|
|
5
|
+
private constructor();
|
|
6
|
+
static getInstance(): State;
|
|
7
|
+
setTypeBeingProcessed(typeToSet: Type): void;
|
|
8
|
+
getTypeBeingProcessed(): Type | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class State {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
+
constructor() { }
|
|
6
|
+
static getInstance() {
|
|
7
|
+
if (!State.instance) {
|
|
8
|
+
State.instance = new State();
|
|
9
|
+
}
|
|
10
|
+
return State.instance;
|
|
11
|
+
}
|
|
12
|
+
setTypeBeingProcessed(typeToSet) {
|
|
13
|
+
this.typeBeingProcessed = typeToSet;
|
|
14
|
+
}
|
|
15
|
+
getTypeBeingProcessed() {
|
|
16
|
+
return this.typeBeingProcessed;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = State;
|
|
20
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/service/state.ts"],"names":[],"mappings":";;AAEA,MAAqB,KAAK;IAIxB,gEAAgE;IAChE,gBAAuB,CAAC;IAEjB,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;SAC9B;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IAEM,qBAAqB,CAAC,SAAe;QAC1C,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtC,CAAC;IAEM,qBAAqB;QAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;CACF;AArBD,wBAqBC"}
|
package/lib/settings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ProcessorTypeTranspiler from './transpiler/processor-type-transpiler';
|
|
2
|
-
export declare type GeneratorChoices = 'jekyll' | 'docsify';
|
|
2
|
+
export declare type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown';
|
|
3
3
|
export interface SettingsConfig {
|
|
4
4
|
sourceDirectory: string;
|
|
5
5
|
recursive: boolean;
|
|
@@ -19,6 +19,7 @@ export declare class Settings {
|
|
|
19
19
|
get recursive(): boolean;
|
|
20
20
|
get scope(): string[];
|
|
21
21
|
get outputDir(): string;
|
|
22
|
+
private static typeTranspilerCache?;
|
|
22
23
|
get typeTranspiler(): ProcessorTypeTranspiler;
|
|
23
24
|
get indexOnly(): boolean;
|
|
24
25
|
getDefaultGroupName(): string;
|
package/lib/settings.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Settings = void 0;
|
|
4
4
|
const jekyll_docsProcessor_1 = require("./transpiler/markdown/jekyll/jekyll-docsProcessor");
|
|
5
5
|
const docsify_docs_processor_1 = require("./transpiler/markdown/docsify/docsify-docs-processor");
|
|
6
|
+
const plain_docsProcessor_1 = require("./transpiler/markdown/plain-markdown/plain-docsProcessor");
|
|
6
7
|
class Settings {
|
|
7
8
|
constructor(config) {
|
|
8
9
|
this.config = config;
|
|
@@ -29,11 +30,19 @@ class Settings {
|
|
|
29
30
|
return this.config.outputDir;
|
|
30
31
|
}
|
|
31
32
|
get typeTranspiler() {
|
|
33
|
+
if (Settings.typeTranspilerCache) {
|
|
34
|
+
return Settings.typeTranspilerCache;
|
|
35
|
+
}
|
|
32
36
|
switch (this.config.targetGenerator) {
|
|
33
37
|
case 'jekyll':
|
|
34
|
-
|
|
38
|
+
Settings.typeTranspilerCache = new jekyll_docsProcessor_1.JekyllDocsProcessor();
|
|
39
|
+
return Settings.typeTranspilerCache;
|
|
35
40
|
case 'docsify':
|
|
36
|
-
|
|
41
|
+
Settings.typeTranspilerCache = new docsify_docs_processor_1.default();
|
|
42
|
+
return Settings.typeTranspilerCache;
|
|
43
|
+
case 'plain-markdown':
|
|
44
|
+
Settings.typeTranspilerCache = new plain_docsProcessor_1.PlainMarkdownDocsProcessor();
|
|
45
|
+
return Settings.typeTranspilerCache;
|
|
37
46
|
default:
|
|
38
47
|
throw Error('Invalid target generator');
|
|
39
48
|
}
|
package/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AACA,4FAAwF;AACxF,iGAAwF;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AACA,4FAAwF;AACxF,iGAAwF;AACxF,kGAAsG;AActG,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,M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B,CAAC;IACtC,CAAC;CACF;AA3DD,4BA2DC"}
|
|
@@ -3,5 +3,6 @@ export default class ClassFileGeneratorHelper {
|
|
|
3
3
|
static getSanitizedGroup(classModel: Type): string;
|
|
4
4
|
static getFileLink(classModel: Type): string;
|
|
5
5
|
static getFileLinkByTypeName(typeName: string): string;
|
|
6
|
+
private static getDirectoryRoot;
|
|
6
7
|
private static getClassGroup;
|
|
7
8
|
}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const types_repository_1 = require("../../model/types-repository");
|
|
4
4
|
const settings_1 = require("../../settings");
|
|
5
|
+
const state_1 = require("../../service/state");
|
|
5
6
|
class ClassFileGeneratorHelper {
|
|
6
7
|
static getSanitizedGroup(classModel) {
|
|
7
8
|
return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
|
|
8
9
|
}
|
|
9
10
|
static getFileLink(classModel) {
|
|
10
|
-
|
|
11
|
+
const directoryRoot = this.getDirectoryRoot(classModel);
|
|
12
|
+
return `[${classModel.name}](${directoryRoot}${classModel.name}.md)`;
|
|
11
13
|
}
|
|
12
14
|
static getFileLinkByTypeName(typeName) {
|
|
13
15
|
const type = types_repository_1.TypesRepository.getInstance().getByName(typeName);
|
|
@@ -17,9 +19,31 @@ class ClassFileGeneratorHelper {
|
|
|
17
19
|
}
|
|
18
20
|
return this.getFileLink(type);
|
|
19
21
|
}
|
|
22
|
+
static getDirectoryRoot(classModel) {
|
|
23
|
+
// root-relative links start from the root by using a leading '/'
|
|
24
|
+
if (settings_1.Settings.getInstance().typeTranspiler.getLinkingStrategy() === 'root-relative') {
|
|
25
|
+
return `/${this.getSanitizedGroup(classModel)}/`;
|
|
26
|
+
}
|
|
27
|
+
// path-relative links traverse the directory structure
|
|
28
|
+
const typeBeingProcessed = state_1.default.getInstance().getTypeBeingProcessed();
|
|
29
|
+
if (typeBeingProcessed) {
|
|
30
|
+
if (this.getClassGroup(typeBeingProcessed) === this.getClassGroup(classModel)) {
|
|
31
|
+
// If the types the same groups then we simply link directly to that file
|
|
32
|
+
return './';
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// If the types have different groups then we have to go up a directory
|
|
36
|
+
return `../${this.getSanitizedGroup(classModel)}/`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// If nothing is being processed then we assume we are at the root and links should include the groups
|
|
41
|
+
return `./${this.getSanitizedGroup(classModel)}/`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
20
44
|
static getClassGroup(classModel) {
|
|
21
45
|
var _a, _b;
|
|
22
|
-
const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group');
|
|
46
|
+
const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'group');
|
|
23
47
|
return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : settings_1.Settings.getInstance().getDefaultGroupName();
|
|
24
48
|
}
|
|
25
49
|
}
|
|
@@ -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;
|
|
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;AAExC,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,C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,MAAM,eAAe,SAAG,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAC7D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAC1D,CAAC;QACF,aAAO,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAhDD,2CAgDC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
2
3
|
export default class DocsifyDocsProcessor extends MarkdownTranspilerBase {
|
|
3
4
|
homeFileName(): string;
|
|
5
|
+
getLinkingStrategy(): LinkingStrategy;
|
|
4
6
|
}
|
|
@@ -5,6 +5,9 @@ class DocsifyDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspiler
|
|
|
5
5
|
homeFileName() {
|
|
6
6
|
return 'README';
|
|
7
7
|
}
|
|
8
|
+
getLinkingStrategy() {
|
|
9
|
+
return 'root-relative';
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
exports.default = DocsifyDocsProcessor;
|
|
10
13
|
//# sourceMappingURL=docsify-docs-processor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docsify-docs-processor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/docsify/docsify-docs-processor.ts"],"names":[],"mappings":";;AAAA,0EAAqE;
|
|
1
|
+
{"version":3,"file":"docsify-docs-processor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/docsify/docsify-docs-processor.ts"],"names":[],"mappings":";;AAAA,0EAAqE;AAGrE,MAAqB,oBAAqB,SAAQ,iDAAsB;IACtE,YAAY;QACV,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,kBAAkB;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AARD,uCAQC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
2
|
import { Type } from '@cparra/apex-reflection';
|
|
3
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
3
4
|
export declare class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
4
5
|
homeFileName(): string;
|
|
5
6
|
onBeforeProcess: (types: Type[]) => void;
|
|
6
7
|
onProcess(type: Type): void;
|
|
7
8
|
get frontMatterHeader(): string;
|
|
9
|
+
getLinkingStrategy(): LinkingStrategy;
|
|
8
10
|
}
|
|
@@ -20,6 +20,9 @@ class JekyllDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspilerB
|
|
|
20
20
|
get frontMatterHeader() {
|
|
21
21
|
return '---\nlayout: default\n---';
|
|
22
22
|
}
|
|
23
|
+
getLinkingStrategy() {
|
|
24
|
+
return 'path-relative';
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
exports.JekyllDocsProcessor = JekyllDocsProcessor;
|
|
25
28
|
//# sourceMappingURL=jekyll-docsProcessor.js.map
|
|
@@ -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;AAGrE,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;IAaJ,CAAC;IAnBC,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;IAED,kBAAkB;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
3
|
+
export declare class PlainMarkdownDocsProcessor extends MarkdownTranspilerBase {
|
|
4
|
+
homeFileName(): string;
|
|
5
|
+
getLinkingStrategy(): LinkingStrategy;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlainMarkdownDocsProcessor = void 0;
|
|
4
|
+
const markdown_transpiler_base_1 = require("../markdown-transpiler-base");
|
|
5
|
+
class PlainMarkdownDocsProcessor extends markdown_transpiler_base_1.MarkdownTranspilerBase {
|
|
6
|
+
homeFileName() {
|
|
7
|
+
return 'index';
|
|
8
|
+
}
|
|
9
|
+
getLinkingStrategy() {
|
|
10
|
+
return 'path-relative';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.PlainMarkdownDocsProcessor = PlainMarkdownDocsProcessor;
|
|
14
|
+
//# sourceMappingURL=plain-docsProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain-docsProcessor.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts"],"names":[],"mappings":";;;AAAA,0EAAqE;AAGrE,MAAa,0BAA2B,SAAQ,iDAAsB;IACpE,YAAY;QACV,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,kBAAkB;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AARD,gEAQC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
import { FileContainer } from './file-container';
|
|
3
|
+
export declare type LinkingStrategy = 'root-relative' | 'path-relative';
|
|
3
4
|
export default abstract class ProcessorTypeTranspiler {
|
|
4
5
|
onBeforeProcess: ((types: Type[]) => void) | undefined;
|
|
5
6
|
abstract onProcess(type: Type): void;
|
|
6
7
|
onAfterProcess: ((types: Type[]) => void) | undefined;
|
|
7
8
|
abstract fileBuilder(): FileContainer;
|
|
9
|
+
abstract getLinkingStrategy(): LinkingStrategy;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor-type-transpiler.js","sourceRoot":"","sources":["../../src/transpiler/processor-type-transpiler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"processor-type-transpiler.js","sourceRoot":"","sources":["../../src/transpiler/processor-type-transpiler.ts"],"names":[],"mappings":";;AAKA,MAA8B,uBAAuB;CAUpD;AAVD,0CAUC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const settings_1 = require("../settings");
|
|
4
|
+
const state_1 = require("../service/state");
|
|
4
5
|
class Transpiler {
|
|
5
6
|
static generate(types, processor) {
|
|
6
7
|
var _a, _b;
|
|
@@ -16,6 +17,7 @@ class Transpiler {
|
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
19
|
sortedTypes.forEach((currentType) => {
|
|
20
|
+
state_1.default.getInstance().setTypeBeingProcessed(currentType);
|
|
19
21
|
processor.onProcess(currentType);
|
|
20
22
|
});
|
|
21
23
|
(_b = processor.onAfterProcess) === null || _b === void 0 ? void 0 : _b.call(processor, sortedTypes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpiler.js","sourceRoot":"","sources":["../../src/transpiler/transpiler.ts"],"names":[],"mappings":";;AAEA,0CAAuC;
|
|
1
|
+
{"version":3,"file":"transpiler.js","sourceRoot":"","sources":["../../src/transpiler/transpiler.ts"],"names":[],"mappings":";;AAEA,0CAAuC;AACvC,4CAAqC;AAErC,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;QAEzC,IAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,KAAK,IAAI,EAAE;YAC7C,OAAO;SACR;QAED,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YAClC,eAAK,CAAC,WAAW,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;YACvD,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,MAAA,SAAS,CAAC,cAAc,+CAAxB,SAAS,EAAkB,WAAW,EAAE;IAC1C,CAAC;CACF;AApBD,6BAoBC"}
|
package/package.json
CHANGED
|
@@ -27,7 +27,15 @@ export class Apexdocs {
|
|
|
27
27
|
TypesRepository.getInstance().populate(filteredTypes);
|
|
28
28
|
Logger.clear();
|
|
29
29
|
|
|
30
|
-
Logger.logSingle(
|
|
30
|
+
Logger.logSingle(
|
|
31
|
+
`Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${
|
|
32
|
+
Settings.getInstance().scope
|
|
33
|
+
}`,
|
|
34
|
+
false,
|
|
35
|
+
'green',
|
|
36
|
+
false,
|
|
37
|
+
);
|
|
38
|
+
Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
|
|
31
39
|
const processor = Settings.getInstance().typeTranspiler;
|
|
32
40
|
Transpiler.generate(filteredTypes, processor);
|
|
33
41
|
const generatedFiles = processor.fileBuilder().files();
|
package/src/cli/generate.ts
CHANGED
|
@@ -35,14 +35,14 @@ const argv = yargs.options({
|
|
|
35
35
|
type: 'string',
|
|
36
36
|
alias: 'g',
|
|
37
37
|
default: 'jekyll',
|
|
38
|
-
choices: ['jekyll', 'docsify'],
|
|
38
|
+
choices: ['jekyll', 'docsify', 'plain-markdown'],
|
|
39
39
|
describe:
|
|
40
|
-
'Define the static file generator for which the documents will be created. Currently supports jekyll, and
|
|
40
|
+
'Define the static file generator for which the documents will be created. Currently supports jekyll, docsify, and plain markdown.',
|
|
41
41
|
},
|
|
42
42
|
indexOnly: {
|
|
43
43
|
type: 'boolean',
|
|
44
44
|
default: false,
|
|
45
|
-
describe: 'Defines whether only the index file should be
|
|
45
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
46
46
|
},
|
|
47
47
|
defaultGroupName: {
|
|
48
48
|
type: 'string',
|
|
@@ -58,7 +58,7 @@ function buildSignature(name: string, parameterAware: ParameterAware): string {
|
|
|
58
58
|
}
|
|
59
59
|
const signatureParameters = parameterAware.parameters.map((param) => `${param.type} ${param.name}`);
|
|
60
60
|
signature += signatureParameters.join(', ');
|
|
61
|
-
return
|
|
61
|
+
return `${signature})`;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
function addParameters(
|
|
@@ -66,6 +66,11 @@ function addParameters(
|
|
|
66
66
|
methodModel: MethodMirror | ConstructorMirror,
|
|
67
67
|
startingHeadingLevel: number,
|
|
68
68
|
) {
|
|
69
|
+
if (!methodModel.docComment?.paramAnnotations.length) {
|
|
70
|
+
// If there are no parameters defined in the docs then we don't want to display this section
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
markdownFile.addTitle('Parameters', startingHeadingLevel + 3);
|
|
70
75
|
markdownFile.initializeTable('Param', 'Description');
|
|
71
76
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
|
|
3
|
+
export default class State {
|
|
4
|
+
private static instance: State;
|
|
5
|
+
private typeBeingProcessed?: Type;
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
8
|
+
private constructor() {}
|
|
9
|
+
|
|
10
|
+
public static getInstance(): State {
|
|
11
|
+
if (!State.instance) {
|
|
12
|
+
State.instance = new State();
|
|
13
|
+
}
|
|
14
|
+
return State.instance;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public setTypeBeingProcessed(typeToSet: Type): void {
|
|
18
|
+
this.typeBeingProcessed = typeToSet;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public getTypeBeingProcessed(): Type | undefined {
|
|
22
|
+
return this.typeBeingProcessed;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/settings.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import ProcessorTypeTranspiler from './transpiler/processor-type-transpiler';
|
|
2
2
|
import { JekyllDocsProcessor } from './transpiler/markdown/jekyll/jekyll-docsProcessor';
|
|
3
3
|
import DocsifyDocsProcessor from './transpiler/markdown/docsify/docsify-docs-processor';
|
|
4
|
+
import { PlainMarkdownDocsProcessor } from './transpiler/markdown/plain-markdown/plain-docsProcessor';
|
|
4
5
|
|
|
5
|
-
export type GeneratorChoices = 'jekyll' | 'docsify';
|
|
6
|
+
export type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown';
|
|
6
7
|
|
|
7
8
|
export interface SettingsConfig {
|
|
8
9
|
sourceDirectory: string;
|
|
@@ -46,12 +47,21 @@ export class Settings {
|
|
|
46
47
|
return this.config.outputDir;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
private static typeTranspilerCache?: ProcessorTypeTranspiler;
|
|
49
51
|
get typeTranspiler(): ProcessorTypeTranspiler {
|
|
52
|
+
if (Settings.typeTranspilerCache) {
|
|
53
|
+
return Settings.typeTranspilerCache;
|
|
54
|
+
}
|
|
50
55
|
switch (this.config.targetGenerator) {
|
|
51
56
|
case 'jekyll':
|
|
52
|
-
|
|
57
|
+
Settings.typeTranspilerCache = new JekyllDocsProcessor();
|
|
58
|
+
return Settings.typeTranspilerCache;
|
|
53
59
|
case 'docsify':
|
|
54
|
-
|
|
60
|
+
Settings.typeTranspilerCache = new DocsifyDocsProcessor();
|
|
61
|
+
return Settings.typeTranspilerCache;
|
|
62
|
+
case 'plain-markdown':
|
|
63
|
+
Settings.typeTranspilerCache = new PlainMarkdownDocsProcessor();
|
|
64
|
+
return Settings.typeTranspilerCache;
|
|
55
65
|
default:
|
|
56
66
|
throw Error('Invalid target generator');
|
|
57
67
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
import { TypesRepository } from '../../model/types-repository';
|
|
3
3
|
import { Settings } from '../../settings';
|
|
4
|
+
import State from '../../service/state';
|
|
4
5
|
|
|
5
6
|
export default class ClassFileGeneratorHelper {
|
|
6
7
|
public static getSanitizedGroup(classModel: Type) {
|
|
@@ -8,7 +9,8 @@ export default class ClassFileGeneratorHelper {
|
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
public static getFileLink(classModel: Type) {
|
|
11
|
-
|
|
12
|
+
const directoryRoot = this.getDirectoryRoot(classModel);
|
|
13
|
+
return `[${classModel.name}](${directoryRoot}${classModel.name}.md)`;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
public static getFileLinkByTypeName(typeName: string) {
|
|
@@ -21,8 +23,32 @@ export default class ClassFileGeneratorHelper {
|
|
|
21
23
|
return this.getFileLink(type);
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
private static getDirectoryRoot(classModel: Type) {
|
|
27
|
+
// root-relative links start from the root by using a leading '/'
|
|
28
|
+
if (Settings.getInstance().typeTranspiler.getLinkingStrategy() === 'root-relative') {
|
|
29
|
+
return `/${this.getSanitizedGroup(classModel)}/`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// path-relative links traverse the directory structure
|
|
33
|
+
const typeBeingProcessed = State.getInstance().getTypeBeingProcessed();
|
|
34
|
+
if (typeBeingProcessed) {
|
|
35
|
+
if (this.getClassGroup(typeBeingProcessed) === this.getClassGroup(classModel)) {
|
|
36
|
+
// If the types the same groups then we simply link directly to that file
|
|
37
|
+
return './';
|
|
38
|
+
} else {
|
|
39
|
+
// If the types have different groups then we have to go up a directory
|
|
40
|
+
return `../${this.getSanitizedGroup(classModel)}/`;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
// If nothing is being processed then we assume we are at the root and links should include the groups
|
|
44
|
+
return `./${this.getSanitizedGroup(classModel)}/`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
private static getClassGroup(classModel: Type): string {
|
|
25
|
-
const groupAnnotation = classModel.docComment?.annotations.find(
|
|
49
|
+
const groupAnnotation = classModel.docComment?.annotations.find(
|
|
50
|
+
(annotation) => annotation.name.toLowerCase() === 'group',
|
|
51
|
+
);
|
|
26
52
|
return groupAnnotation?.body ?? Settings.getInstance().getDefaultGroupName();
|
|
27
53
|
}
|
|
28
54
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
2
3
|
|
|
3
4
|
export default class DocsifyDocsProcessor extends MarkdownTranspilerBase {
|
|
4
5
|
homeFileName(): string {
|
|
5
6
|
return 'README';
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
getLinkingStrategy(): LinkingStrategy {
|
|
10
|
+
return 'root-relative';
|
|
11
|
+
}
|
|
7
12
|
}
|
|
@@ -2,6 +2,7 @@ import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
|
2
2
|
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
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
5
6
|
|
|
6
7
|
export class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
7
8
|
homeFileName(): string {
|
|
@@ -19,4 +20,8 @@ export class JekyllDocsProcessor extends MarkdownTranspilerBase {
|
|
|
19
20
|
get frontMatterHeader(): string {
|
|
20
21
|
return '---\nlayout: default\n---';
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
getLinkingStrategy(): LinkingStrategy {
|
|
25
|
+
return 'path-relative';
|
|
26
|
+
}
|
|
22
27
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
|
|
2
|
+
import { LinkingStrategy } from '../../processor-type-transpiler';
|
|
3
|
+
|
|
4
|
+
export class PlainMarkdownDocsProcessor extends MarkdownTranspilerBase {
|
|
5
|
+
homeFileName(): string {
|
|
6
|
+
return 'index';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
getLinkingStrategy(): LinkingStrategy {
|
|
10
|
+
return 'path-relative';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
import { FileContainer } from './file-container';
|
|
3
3
|
|
|
4
|
+
export type LinkingStrategy = 'root-relative' | 'path-relative';
|
|
5
|
+
|
|
4
6
|
export default abstract class ProcessorTypeTranspiler {
|
|
5
7
|
onBeforeProcess: ((types: Type[]) => void) | undefined;
|
|
6
8
|
|
|
@@ -9,4 +11,6 @@ export default abstract class ProcessorTypeTranspiler {
|
|
|
9
11
|
onAfterProcess: ((types: Type[]) => void) | undefined;
|
|
10
12
|
|
|
11
13
|
abstract fileBuilder(): FileContainer;
|
|
14
|
+
|
|
15
|
+
abstract getLinkingStrategy(): LinkingStrategy;
|
|
12
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
import ProcessorTypeTranspiler from './processor-type-transpiler';
|
|
3
3
|
import { Settings } from '../settings';
|
|
4
|
+
import State from '../service/state';
|
|
4
5
|
|
|
5
6
|
export default class Transpiler {
|
|
6
7
|
static generate(types: Type[], processor: ProcessorTypeTranspiler): void {
|
|
@@ -17,6 +18,7 @@ export default class Transpiler {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
sortedTypes.forEach((currentType) => {
|
|
21
|
+
State.getInstance().setTypeBeingProcessed(currentType);
|
|
20
22
|
processor.onProcess(currentType);
|
|
21
23
|
});
|
|
22
24
|
processor.onAfterProcess?.(sortedTypes);
|