@cparra/apexdocs 2.2.2 → 2.2.3

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 CHANGED
@@ -207,23 +207,8 @@ the `Properties` title will be `<h2>`, each property name will be an `<h3>`, etc
207
207
 
208
208
  ### Importing to your project
209
209
 
210
- If you are just interested in the documentation parsing capabilities, you can import ApexDocs into your own project.
211
-
212
- Use the `docGenerator` function to create a list of `ClassModel` that includes all the parsed information from your .cls
213
- files.
214
-
215
- `docGenerator(sourceDirectory[,recursive][,scope][,outputDir])`
216
-
217
- - `sourceDirectory` \<string>
218
- - `recursive` \<boolean>
219
- - `scope` \<string[]>
220
- - `outpurDir` \<string>
221
-
222
- ```javascript
223
- var { docGenerator } = require('@cparra/apexdocs');
224
-
225
- let documentedClasses = docGenerator('src', true, ['global'], 'docs');
226
- ```
210
+ If you are just interested in the Apex parsing capabilities, you can use the standalone [Apex Reflection Library](https://www.npmjs.com/package/@cparra/apex-reflection)
211
+ which is what gets used by this library behind the scenes to generate the documentation files.
227
212
 
228
213
  ## Documentation Format
229
214
 
@@ -235,7 +220,7 @@ multiple lines, ending with `*/`.
235
220
  The following tags are supported on the class level:
236
221
 
237
222
  | Tag | Description |
238
- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
223
+ |----------------|--------------------------------------------------------------------------------------------------------------------------------------------|
239
224
  | `@description` | One or more lines describing the class. |
240
225
  | `@see` | The name of a related class. |
241
226
  | `@group` | The group to which the class belongs to. |
@@ -257,7 +242,7 @@ public with sharing class TestClass {
257
242
  The following tags are supported on the enum level:
258
243
 
259
244
  | Tag | Description |
260
- | -------------- | -------------------------------------- |
245
+ |----------------|----------------------------------------|
261
246
  | `@description` | One or more lines describing the enum. |
262
247
 
263
248
  **Example**
@@ -276,7 +261,7 @@ public Enum ExampleEnum {
276
261
  The following tags are supported on the property level:
277
262
 
278
263
  | Tag | Description |
279
- | -------------- | ------------------------------------------ |
264
+ |----------------|--------------------------------------------|
280
265
  | `@description` | One or more lines describing the property. |
281
266
 
282
267
  **Example**
@@ -295,7 +280,7 @@ Methods and constructors support the same tags.
295
280
  The following tags are supported on the method level:
296
281
 
297
282
  | Tag | Description |
298
- | ------------------------- | ------------------------------------------------- |
283
+ |---------------------------|---------------------------------------------------|
299
284
  | `@description` | One or more lines describing the method. |
300
285
  | `@param` _paramName_ | Description of a single parameter. |
301
286
  | `@return` | Description of the return value of the method. |
package/docs/README.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Classes
2
+ ## Utils
3
+
4
+ ### [GroupedClass](/Utils/GroupedClass.md)
5
+
6
+ Uses a block style apex doc
2
7
  ## Sample Classes
3
8
 
4
9
  ### [SampleClass](/Sample-Classes/SampleClass.md)
@@ -0,0 +1,7 @@
1
+ # GroupedClass
2
+
3
+ Some desc
4
+
5
+
6
+ **Group** Some group
7
+
@@ -0,0 +1,10 @@
1
+ # GroupedClass
2
+
3
+ Uses a block style apex doc
4
+
5
+
6
+ **Group** Utils
7
+
8
+
9
+ **Test Class** [SampleClass](/Sample-Classes/SampleClass.md)
10
+
@@ -0,0 +1,8 @@
1
+ /**********************************************************
2
+ Uses a block style apex doc
3
+ @group Utils
4
+ @test-class {@link SampleClass}
5
+ ***********************************************************/
6
+ public class GroupedClass {
7
+
8
+ }
@@ -9,15 +9,21 @@ function addCustomDocCommentAnnotations(markdownFile, docCommentAware) {
9
9
  markdownFile.addText(buildDocAnnotationText(currentAnnotation));
10
10
  markdownFile.addBlankLine();
11
11
  });
12
- function capitalizeFirstLetter(text) {
13
- return text.charAt(0).toUpperCase() + text.slice(1);
12
+ function splitAndCapitalize(text) {
13
+ const words = text.split(/[-_]+/);
14
+ const capitalizedWords = [];
15
+ for (const word of words) {
16
+ console.log(`current word ${word}`);
17
+ capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
18
+ }
19
+ return capitalizedWords.join(' ');
14
20
  }
15
21
  function buildDocAnnotationText(annotation) {
16
22
  let annotationBodyText = annotation.body;
17
23
  if (annotation.name.toLowerCase() === 'see') {
18
24
  annotationBodyText = class_file_generatorHelper_1.default.getFileLinkByTypeName(annotation.body);
19
25
  }
20
- return `**${capitalizeFirstLetter(annotation.name)}** ${annotationBodyText}`;
26
+ return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
21
27
  }
22
28
  }
23
29
  exports.addCustomDocCommentAnnotations = addCustomDocCommentAnnotations;
@@ -1 +1 @@
1
- {"version":3,"file":"doc-comment-annotation-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/doc-comment-annotation-util.ts"],"names":[],"mappings":";;;AACA,qGAA4F;AAO5F,SAAgB,8BAA8B,CAAC,YAA0B,EAAE,eAAgC;;IACzG,MAAA,eAAe,CAAC,UAAU,0CAAE,WAAW,CACpC,MAAM,CAAC,CAAC,iBAAuC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,aAAa,EAC5F,OAAO,CAAC,CAAC,iBAAuC,EAAE,EAAE;QACnD,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAChE,YAAY,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE;IAEL,SAAS,qBAAqB,CAAC,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,SAAS,sBAAsB,CAAC,UAAgC;QAC9D,IAAI,kBAAkB,GAAG,UAAU,CAAC,IAAI,CAAC;QACzC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YAC3C,kBAAkB,GAAG,oCAAwB,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SACtF;QACD,OAAO,KAAK,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,kBAAkB,EAAE,CAAC;IAC/E,CAAC;AACH,CAAC;AApBD,wEAoBC"}
1
+ {"version":3,"file":"doc-comment-annotation-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/doc-comment-annotation-util.ts"],"names":[],"mappings":";;;AACA,qGAA4F;AAO5F,SAAgB,8BAA8B,CAAC,YAA0B,EAAE,eAAgC;;IACzG,MAAA,eAAe,CAAC,UAAU,0CAAE,WAAW,CACpC,MAAM,CAAC,CAAC,iBAAuC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,aAAa,EAC5F,OAAO,CAAC,CAAC,iBAAuC,EAAE,EAAE;QACnD,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAChE,YAAY,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE;IAEL,SAAS,kBAAkB,CAAC,IAAY;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,gBAAgB,GAAG,EAAE,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;YACpC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACrE;QACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,sBAAsB,CAAC,UAAgC;QAC9D,IAAI,kBAAkB,GAAG,UAAU,CAAC,IAAI,CAAC;QACzC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YAC3C,kBAAkB,GAAG,oCAAwB,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SACtF;QACD,OAAO,KAAK,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,kBAAkB,EAAE,CAAC;IAC5E,CAAC;AACH,CAAC;AA1BD,wEA0BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -64,7 +64,7 @@
64
64
  ]
65
65
  },
66
66
  "dependencies": {
67
- "@cparra/apex-reflection": "^1.4.0",
67
+ "@cparra/apex-reflection": "^1.5.0",
68
68
  "fast-xml-parser": "^4.0.1",
69
69
  "chalk": "^4.1.2",
70
70
  "html-entities": "^2.3.2",
@@ -15,8 +15,14 @@ export function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCo
15
15
  markdownFile.addBlankLine();
16
16
  });
17
17
 
18
- function capitalizeFirstLetter(text: string) {
19
- return text.charAt(0).toUpperCase() + text.slice(1);
18
+ function splitAndCapitalize(text: string) {
19
+ const words = text.split(/[-_]+/);
20
+ const capitalizedWords = [];
21
+ for (const word of words) {
22
+ console.log(`current word ${word}`);
23
+ capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
24
+ }
25
+ return capitalizedWords.join(' ');
20
26
  }
21
27
 
22
28
  function buildDocAnnotationText(annotation: DocCommentAnnotation) {
@@ -24,6 +30,6 @@ export function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCo
24
30
  if (annotation.name.toLowerCase() === 'see') {
25
31
  annotationBodyText = ClassFileGeneratorHelper.getFileLinkByTypeName(annotation.body);
26
32
  }
27
- return `**${capitalizeFirstLetter(annotation.name)}** ${annotationBodyText}`;
33
+ return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
28
34
  }
29
35
  }