@cparra/apexdocs 2.21.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.
Files changed (55) hide show
  1. package/README.md +52 -16
  2. package/apexdocs.config.ts +3 -1
  3. package/docs/types/Classes/nspc.AnotherInterface.md +15 -0
  4. package/docs/types/Classes/nspc.ChildClass.md +97 -79
  5. package/docs/types/Main/nspc.SampleClass.md +189 -189
  6. package/examples/force-app/main/default/classes/AnotherInterface.cls +11 -0
  7. package/examples/force-app/main/default/classes/ChildClass.cls +12 -0
  8. package/lib/cli/generate.js +7 -1
  9. package/lib/cli/generate.js.map +1 -1
  10. package/lib/model/markdown-file.d.ts +1 -1
  11. package/lib/model/markdown-file.js +2 -2
  12. package/lib/model/markdown-file.js.map +1 -1
  13. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +1 -0
  14. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +17 -2
  15. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  16. package/lib/model/markdown-generation-util/field-declaration-util.js +1 -9
  17. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
  18. package/lib/model/markdown-generation-util/method-declaration-util.js +1 -0
  19. package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
  20. package/lib/model/markdown-generation-util/type-declaration-util.js +1 -0
  21. package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
  22. package/lib/model/markdown-type-file.js +1 -9
  23. package/lib/model/markdown-type-file.js.map +1 -1
  24. package/lib/service/walkers/class-walker.js +6 -6
  25. package/lib/service/walkers/class-walker.js.map +1 -1
  26. package/lib/service/walkers/enum-walker.js.map +1 -1
  27. package/lib/service/walkers/interface-walker.js +1 -1
  28. package/lib/service/walkers/interface-walker.js.map +1 -1
  29. package/lib/service/walkers/walker.d.ts +3 -0
  30. package/lib/service/walkers/walker.js +7 -0
  31. package/lib/service/walkers/walker.js.map +1 -1
  32. package/lib/settings.d.ts +11 -0
  33. package/lib/settings.js +10 -0
  34. package/lib/settings.js.map +1 -1
  35. package/lib/transpiler/markdown/class-file-generatorHelper.js +2 -2
  36. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  37. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +2 -1
  38. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +26 -3
  39. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/cli/generate.ts +6 -0
  42. package/src/model/markdown-file.ts +2 -2
  43. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +16 -0
  44. package/src/model/markdown-generation-util/field-declaration-util.ts +3 -9
  45. package/src/model/markdown-generation-util/method-declaration-util.ts +3 -1
  46. package/src/model/markdown-generation-util/type-declaration-util.ts +3 -1
  47. package/src/model/markdown-type-file.ts +4 -10
  48. package/src/service/walkers/class-walker.ts +6 -7
  49. package/src/service/walkers/enum-walker.ts +0 -1
  50. package/src/service/walkers/interface-walker.ts +1 -1
  51. package/src/service/walkers/walker.ts +8 -1
  52. package/src/settings.ts +21 -0
  53. package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -2
  54. package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +26 -3
  55. package/ROADMAP.md +0 -16
@@ -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.frontMatterHeader));
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.frontMatterHeader));
18
+ this._fileContainer.pushFile(new MarkdownTypeFile(type, 1, this.getFrontMatterHeader(type)));
18
19
  }
19
20
 
20
- get frontMatterHeader(): string {
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