@ng-doc/builder 15.0.0-beta.33 → 15.0.0-beta.34

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 (200) hide show
  1. package/browser/index.d.ts +1 -1
  2. package/browser/index.js +2 -2
  3. package/browser/index.js.map +1 -1
  4. package/browser/schema.json +1 -20
  5. package/dev-server/index.d.ts +1 -1
  6. package/dev-server/index.js +2 -2
  7. package/dev-server/index.js.map +1 -1
  8. package/dev-server/schema.json +1 -20
  9. package/engine/.cache/apps/ng-doc/src/app/docs/content/api-templating/ng-doc.page.js +40 -8
  10. package/engine/.cache/apps/ng-doc/src/app/docs/content/guides/demo/ng-doc.page.js +51 -0
  11. package/engine/.cache/apps/ng-doc/src/app/docs/content/guides/ng-doc.category.js +41 -0
  12. package/engine/.cache/apps/ng-doc/src/app/docs/content/guides/playground/ng-doc.page.js +50 -0
  13. package/engine/.cache/apps/ng-doc/src/app/docs/content/guides/templating/ng-doc.page.js +51 -0
  14. package/engine/.cache/apps/ng-doc/src/app/docs/content/keywords/ng-doc.page.js +40 -8
  15. package/engine/.cache/apps/ng-doc/src/app/docs/content/ng-doc.category.js +28 -5
  16. package/engine/.cache/apps/ng-doc/src/app/docs/customization/layout/ng-doc.page.js +42 -0
  17. package/engine/.cache/apps/ng-doc/src/app/docs/customization/ng-doc.category.js +28 -5
  18. package/engine/.cache/apps/ng-doc/src/app/docs/customization/themes/ng-doc.page.js +40 -8
  19. package/engine/.cache/apps/ng-doc/src/app/docs/customization/type-controls/ng-doc.page.js +43 -0
  20. package/engine/.cache/apps/ng-doc/src/app/docs/develop/ng-doc.page.js +4293 -10
  21. package/engine/.cache/apps/ng-doc/src/app/docs/entities/api/ng-doc.page.js +40 -8
  22. package/engine/.cache/apps/ng-doc/src/app/docs/entities/category/ng-doc.page.js +40 -8
  23. package/engine/.cache/apps/ng-doc/src/app/docs/entities/dependencies/ng-doc.page.js +40 -8
  24. package/engine/.cache/apps/ng-doc/src/app/docs/entities/ng-doc.category.js +28 -5
  25. package/engine/.cache/apps/ng-doc/src/app/docs/entities/page/ng-doc.page.js +43 -11
  26. package/engine/.cache/apps/ng-doc/src/app/docs/getting-started/configuration/ng-doc.page.js +39 -8
  27. package/engine/.cache/apps/ng-doc/src/app/docs/getting-started/installation/ng-doc.page.js +39 -8
  28. package/engine/.cache/apps/ng-doc/src/app/docs/getting-started/ng-doc.category.js +29 -6
  29. package/engine/.cache/apps/ng-doc/src/app/docs/getting-started/roadmap/ng-doc.page.js +39 -8
  30. package/engine/.cache/apps/ng-doc/src/app/docs/getting-started/what-is-ng-doc/ng-doc.page.js +38 -7
  31. package/engine/.cache/apps/ng-doc/src/app/docs/ng-doc.api.js +50 -27
  32. package/engine/actions/demo.action.d.ts +1 -1
  33. package/engine/actions/demo.action.js +4 -2
  34. package/engine/actions/demo.action.js.map +1 -1
  35. package/engine/actions/playground.action.d.ts +2 -2
  36. package/engine/actions/playground.action.js +12 -11
  37. package/engine/actions/playground.action.js.map +1 -1
  38. package/engine/actions.d.ts +1 -1
  39. package/engine/actions.js.map +1 -1
  40. package/engine/builder.d.ts +2 -3
  41. package/engine/builder.js +30 -16
  42. package/engine/builder.js.map +1 -1
  43. package/engine/entities/abstractions/entity.d.ts +10 -10
  44. package/engine/entities/abstractions/entity.js +3 -3
  45. package/engine/entities/abstractions/entity.js.map +1 -1
  46. package/engine/entities/abstractions/file.entity.js +9 -5
  47. package/engine/entities/abstractions/file.entity.js.map +1 -1
  48. package/engine/entities/abstractions/module.entity.d.ts +3 -7
  49. package/engine/entities/abstractions/module.entity.js +8 -1
  50. package/engine/entities/abstractions/module.entity.js.map +1 -1
  51. package/engine/entities/abstractions/navigation.entity.d.ts +1 -7
  52. package/engine/entities/abstractions/navigation.entity.js +1 -10
  53. package/engine/entities/abstractions/navigation.entity.js.map +1 -1
  54. package/engine/entities/abstractions/route.entity.d.ts +8 -0
  55. package/engine/entities/abstractions/route.entity.js +19 -4
  56. package/engine/entities/abstractions/route.entity.js.map +1 -1
  57. package/engine/entities/abstractions/source-file.entity.d.ts +4 -0
  58. package/engine/entities/abstractions/source-file.entity.js +4 -0
  59. package/engine/entities/abstractions/source-file.entity.js.map +1 -1
  60. package/engine/entities/api-page.entity.d.ts +7 -7
  61. package/engine/entities/api-page.entity.js +19 -8
  62. package/engine/entities/api-page.entity.js.map +1 -1
  63. package/engine/entities/api-scope.entity.d.ts +4 -6
  64. package/engine/entities/api-scope.entity.js +8 -9
  65. package/engine/entities/api-scope.entity.js.map +1 -1
  66. package/engine/entities/api.entity.d.ts +1 -2
  67. package/engine/entities/api.entity.js +7 -5
  68. package/engine/entities/api.entity.js.map +1 -1
  69. package/engine/entities/category.entity.d.ts +2 -2
  70. package/engine/entities/category.entity.js +7 -2
  71. package/engine/entities/category.entity.js.map +1 -1
  72. package/engine/entities/dependencies.entity.d.ts +13 -3
  73. package/engine/entities/dependencies.entity.js +66 -64
  74. package/engine/entities/dependencies.entity.js.map +1 -1
  75. package/engine/entities/index.d.ts +0 -1
  76. package/engine/entities/index.js +0 -1
  77. package/engine/entities/index.js.map +1 -1
  78. package/engine/entities/page.entity.d.ts +2 -7
  79. package/engine/entities/page.entity.js +13 -22
  80. package/engine/entities/page.entity.js.map +1 -1
  81. package/engine/index.d.ts +0 -1
  82. package/engine/index.js +0 -1
  83. package/engine/index.js.map +1 -1
  84. package/engine/post-processors/html-plugins/autolink-headings.ts +40 -0
  85. package/engine/post-processors/html-plugins/keywords-processor.js +3 -2
  86. package/engine/post-processors/html-plugins/keywords-processor.js.map +1 -1
  87. package/engine/post-processors/html-plugins/keywords-processor.ts +125 -0
  88. package/engine/post-processors/html-plugins/mark-elements.d.ts +6 -0
  89. package/engine/post-processors/html-plugins/mark-elements.js +19 -0
  90. package/engine/post-processors/html-plugins/mark-elements.js.map +1 -0
  91. package/engine/post-processors/html-plugins/mark-elements.ts +17 -0
  92. package/engine/post-processors/html-plugins/slugger.d.ts +7 -0
  93. package/engine/post-processors/html-plugins/slugger.js +25 -0
  94. package/engine/post-processors/html-plugins/slugger.js.map +1 -0
  95. package/engine/post-processors/html-plugins/slugger.ts +26 -0
  96. package/engine/post-processors/html-post-processor.js +7 -2
  97. package/engine/post-processors/html-post-processor.js.map +1 -1
  98. package/engine/template-filters.d.ts +2 -1
  99. package/engine/template-filters.js +9 -1
  100. package/engine/template-filters.js.map +1 -1
  101. package/engine/variables.d.ts +0 -2
  102. package/engine/variables.js +1 -3
  103. package/engine/variables.js.map +1 -1
  104. package/helpers/build-assets.js +2 -0
  105. package/helpers/build-assets.js.map +1 -1
  106. package/helpers/build-global-indexes.js +1 -1
  107. package/helpers/build-global-indexes.js.map +1 -1
  108. package/helpers/create-builder-context.js +12 -5
  109. package/helpers/create-builder-context.js.map +1 -1
  110. package/helpers/entity-type.d.ts +5 -4
  111. package/helpers/entity-type.js +10 -9
  112. package/helpers/entity-type.js.map +1 -1
  113. package/helpers/generate-api-entities.js +3 -2
  114. package/helpers/generate-api-entities.js.map +1 -1
  115. package/helpers/get-component-asset.d.ts +10 -0
  116. package/helpers/get-component-asset.js +61 -0
  117. package/helpers/get-component-asset.js.map +1 -0
  118. package/helpers/get-demo-class-declarations.d.ts +6 -0
  119. package/helpers/get-demo-class-declarations.js +25 -0
  120. package/helpers/get-demo-class-declarations.js.map +1 -0
  121. package/helpers/get-entity-constructor.js +0 -3
  122. package/helpers/get-entity-constructor.js.map +1 -1
  123. package/helpers/get-keyword-type-from-entity.js +1 -1
  124. package/helpers/get-keyword-type-from-entity.js.map +1 -1
  125. package/helpers/get-playground-by-id.d.ts +7 -0
  126. package/helpers/get-playground-by-id.js +21 -0
  127. package/helpers/get-playground-by-id.js.map +1 -0
  128. package/helpers/get-playground-properties.d.ts +25 -0
  129. package/helpers/get-playground-properties.js +114 -0
  130. package/helpers/get-playground-properties.js.map +1 -0
  131. package/helpers/index.d.ts +6 -1
  132. package/helpers/index.js +6 -1
  133. package/helpers/index.js.map +1 -1
  134. package/helpers/load-config.d.ts +7 -0
  135. package/helpers/load-config.js +23 -0
  136. package/helpers/load-config.js.map +1 -0
  137. package/helpers/marked.js +1 -1
  138. package/helpers/marked.js.map +1 -1
  139. package/helpers/repo-link.d.ts +20 -0
  140. package/helpers/repo-link.js +40 -0
  141. package/helpers/repo-link.js.map +1 -0
  142. package/helpers/sort-navigation-entities.d.ts +6 -0
  143. package/helpers/sort-navigation-entities.js +24 -0
  144. package/helpers/sort-navigation-entities.js.map +1 -0
  145. package/helpers/typescript/create-project.js +2 -2
  146. package/helpers/typescript/create-project.js.map +1 -1
  147. package/interfaces/builder-context.d.ts +3 -3
  148. package/interfaces/configuration.d.ts +43 -0
  149. package/{engine/interfaces/entity-output.js → interfaces/configuration.js} +1 -1
  150. package/interfaces/configuration.js.map +1 -0
  151. package/interfaces/index.d.ts +2 -0
  152. package/interfaces/index.js +2 -0
  153. package/interfaces/index.js.map +1 -1
  154. package/interfaces/repo-config.d.ts +17 -0
  155. package/{engine/interfaces/actions/demo-options.js → interfaces/repo-config.js} +1 -1
  156. package/interfaces/repo-config.js.map +1 -0
  157. package/interfaces/schema.d.ts +3 -23
  158. package/package.json +11 -4
  159. package/schematics/page/index.js +1 -1
  160. package/schematics/page/index.js.map +1 -1
  161. package/templates/api-page.module.ts.nunj +13 -5
  162. package/templates/api-scope.module.ts.nunj +2 -2
  163. package/templates/api.module.ts.nunj +5 -5
  164. package/templates/category.module.ts.nunj +2 -2
  165. package/templates/context.ts.nunj +2 -2
  166. package/templates/helpers/declaration-modifiers.html.nunj +8 -4
  167. package/templates/page.module.ts.nunj +20 -7
  168. package/templates/playgrounds.ts.nunj +70 -0
  169. package/templates/routing.ts.nunj +1 -1
  170. package/types/component-asset.d.ts +2 -0
  171. package/types/component-asset.js +3 -0
  172. package/types/component-asset.js.map +1 -0
  173. package/types/index.d.ts +1 -0
  174. package/types/index.js +1 -0
  175. package/types/index.js.map +1 -1
  176. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/demos/button-demo/button-demo.component.js +0 -28
  177. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/demos/button-inline-demo/button-inline-demo.component.js +0 -30
  178. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/ng-doc.dependencies.js +0 -12
  179. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/ng-doc.module.js +0 -27
  180. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/ng-doc.page.js +0 -11
  181. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/ng-doc.category.js +0 -9
  182. package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/templating/ng-doc.page.js +0 -11
  183. package/engine/.cache/apps/ng-doc/src/app/docs/develop/custom-data.js +0 -6
  184. package/engine/.cache/ng-doc.buildinfo.json +0 -1
  185. package/engine/entities/playground.entity.d.ts +0 -16
  186. package/engine/entities/playground.entity.js +0 -65
  187. package/engine/entities/playground.entity.js.map +0 -1
  188. package/engine/interfaces/actions/demo-options.d.ts +0 -7
  189. package/engine/interfaces/actions/demo-options.js.map +0 -1
  190. package/engine/interfaces/actions/index.d.ts +0 -1
  191. package/engine/interfaces/actions/index.js +0 -5
  192. package/engine/interfaces/actions/index.js.map +0 -1
  193. package/engine/interfaces/entity-output.d.ts +0 -5
  194. package/engine/interfaces/entity-output.js.map +0 -1
  195. package/engine/interfaces/index.d.ts +0 -2
  196. package/engine/interfaces/index.js +0 -6
  197. package/engine/interfaces/index.js.map +0 -1
  198. package/helpers/declaration-to-playground.d.ts +0 -7
  199. package/helpers/declaration-to-playground.js +0 -33
  200. package/helpers/declaration-to-playground.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"marked.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/marked.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AACxC,mCAA8C;AAE9C,MAAM,WAAW,GAAW,0BAA0B,CAAC;AACvD,MAAM,cAAc,GAAW,6BAA6B,CAAC;AAE7D;;;;GAIG;AACH,SAAgB,M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C,MAAM,IAAI,GAAW,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,YAAY,CAAC;YAE9C,OAAO,8BAA8B,IAAI,WAAW,IAAI,KAAK,IAAA,iBAAU,EAAC,IAAI,CAAC,eAAe,CAAC;QAC9F,CAAC;QACD,UAAU,CAAC,KAAa;YACvB,IAAI,IAAI,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBAC9C,OAAO,kCAAkC,KAAK,CAAC,OAAO,CACrD,IAAI,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC,EACjC,KAAK,CACL,sBAAsB,CAAC;aACxB;YAED,IAAI,IAAI,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBACjD,OAAO,qCAAqC,KAAK,CAAC,OAAO,CACxD,IAAI,MAAM,CAAC,IAAI,cAAc,MAAM,CAAC,EACpC,KAAK,CACL,sBAAsB,CAAC;aACxB;YAED,OAAO,sBAAsB,KAAK,sBAAsB,CAAC;QAC1D,CAAC;KACD,CAAC;IAEF,eAAY,CAAC,GAAG,CAAC,EAAC,QAAQ,EAAC,CAAC,CAAC;IAE7B,OAAO,eAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;AACzD,CAAC;AA7BD,wBA6BC"}
@@ -0,0 +1,20 @@
1
+ import { NgDocRepoConfig } from '../interfaces';
2
+ /**
3
+ *
4
+ * @param repoConfig
5
+ * @param repoConfig.url
6
+ * @param repoConfig.mainBranch
7
+ * @param filePath
8
+ * @param scope
9
+ * @param lineNumber
10
+ */
11
+ export declare function editFileInRepoUrl({ url, mainBranch }: NgDocRepoConfig, filePath: string, scope: string, lineNumber?: number): string;
12
+ /**
13
+ *
14
+ * @param repoConfig
15
+ * @param repoConfig.url
16
+ * @param repoConfig.releaseBranch
17
+ * @param filePath
18
+ * @param lineNumber
19
+ */
20
+ export declare function viewFileInRepoUrl({ url, releaseBranch }: NgDocRepoConfig, filePath: string, lineNumber?: number): string;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.viewFileInRepoUrl = exports.editFileInRepoUrl = void 0;
4
+ const slash_1 = require("./slash");
5
+ /**
6
+ *
7
+ * @param repoConfig
8
+ * @param repoConfig.url
9
+ * @param repoConfig.mainBranch
10
+ * @param filePath
11
+ * @param scope
12
+ * @param lineNumber
13
+ */
14
+ function editFileInRepoUrl({ url, mainBranch }, filePath, scope, lineNumber) {
15
+ if (url && mainBranch) {
16
+ const rUrl = url.replace(/\/$/, '');
17
+ const fPath = (0, slash_1.slash)(filePath).replace(/^\//, '');
18
+ return `${rUrl}/edit/${mainBranch}/${fPath}?message=docs(${scope}): describe your changes here...${lineNumber ? `#L${lineNumber}` : ''}`;
19
+ }
20
+ return filePath;
21
+ }
22
+ exports.editFileInRepoUrl = editFileInRepoUrl;
23
+ /**
24
+ *
25
+ * @param repoConfig
26
+ * @param repoConfig.url
27
+ * @param repoConfig.releaseBranch
28
+ * @param filePath
29
+ * @param lineNumber
30
+ */
31
+ function viewFileInRepoUrl({ url, releaseBranch }, filePath, lineNumber) {
32
+ if (url && releaseBranch) {
33
+ const rUrl = url.replace(/\/$/, '');
34
+ const fPath = (0, slash_1.slash)(filePath).replace(/^\//, '');
35
+ return `${rUrl}/blob/${releaseBranch}/${fPath}${lineNumber ? `#L${lineNumber}` : ''}`;
36
+ }
37
+ return filePath;
38
+ }
39
+ exports.viewFileInRepoUrl = viewFileInRepoUrl;
40
+ //# sourceMappingURL=repo-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-link.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/repo-link.ts"],"names":[],"mappings":";;;AACA,mCAA8B;AAE9B;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAChC,EAAC,GAAG,EAAE,UAAU,EAAkB,EAClC,QAAgB,EAChB,KAAa,EACb,UAAmB;IAEnB,IAAI,GAAG,IAAI,UAAU,EAAE;QACtB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjD,OAAO,GAAG,IAAI,SAAS,UAAU,IAAI,KAAK,iBAAiB,KAAK,mCAC/D,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EAClC,EAAE,CAAC;KACH;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAhBD,8CAgBC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAChC,EAAC,GAAG,EAAE,aAAa,EAAkB,EACrC,QAAgB,EAChB,UAAmB;IAEnB,IAAI,GAAG,IAAI,aAAa,EAAE;QACzB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjD,OAAO,GAAG,IAAI,SAAS,aAAa,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;KACtF;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAbD,8CAaC"}
@@ -0,0 +1,6 @@
1
+ import { NgDocNavigationEntity } from '../engine/entities/abstractions/navigation.entity';
2
+ /**
3
+ *
4
+ * @param entities
5
+ */
6
+ export declare function sortNavigationEntities<T>(entities: Array<NgDocNavigationEntity<T>>): Array<NgDocNavigationEntity<T>>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortNavigationEntities = void 0;
4
+ const is_present_1 = require("@ng-doc/core/helpers/is-present");
5
+ /**
6
+ *
7
+ * @param entities
8
+ */
9
+ function sortNavigationEntities(entities) {
10
+ return entities.sort((a, b) => {
11
+ if ((0, is_present_1.isPresent)(a.order) && (0, is_present_1.isPresent)(b.order)) {
12
+ return a.order - b.order;
13
+ }
14
+ if ((0, is_present_1.isPresent)(a.order)) {
15
+ return -1;
16
+ }
17
+ if ((0, is_present_1.isPresent)(b.order)) {
18
+ return 1;
19
+ }
20
+ return a.title.localeCompare(b.title);
21
+ });
22
+ }
23
+ exports.sortNavigationEntities = sortNavigationEntities;
24
+ //# sourceMappingURL=sort-navigation-entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-navigation-entities.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/sort-navigation-entities.ts"],"names":[],"mappings":";;;AAAA,gEAA0D;AAI1D;;;GAGG;AACH,SAAgB,sBAAsB,CAAI,QAAyC;IAClF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAA2B,EAAE,CAA2B,EAAE,EAAE;QACjF,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YAC7C,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;SACzB;QACD,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACvB,OAAO,CAAC,CAAC,CAAC;SACV;QACD,IAAI,IAAA,sBAAS,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACvB,OAAO,CAAC,CAAC;SACT;QACD,OAAO,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACJ,CAAC;AAbD,wDAaC"}
@@ -27,8 +27,8 @@ function createProject(options) {
27
27
  ...options === null || options === void 0 ? void 0 : options.compilerOptions,
28
28
  },
29
29
  skipAddingFilesFromTsConfig: true,
30
- skipFileDependencyResolution: true,
31
- skipLoadingLibFiles: true,
30
+ skipFileDependencyResolution: false,
31
+ skipLoadingLibFiles: false,
32
32
  });
33
33
  }
34
34
  exports.createProject = createProject;
@@ -1 +1 @@
1
- {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/create-project.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uCAAmF;AAEnF,sDAAkD;AAElD;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACrD,OAAO,IAAI,kBAAO,CAAC;QAClB,GAAG,OAAO;QACV,eAAe,EAAE;YAChB,MAAM,EAAE,qBAAU,CAAC,QAAQ;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,sBAAU,EAAE,uBAAuB,CAAC;YAC/D,gBAAgB,EAAE,+BAAoB,CAAC,MAAM;YAC7C,eAAe,EAAE,IAAI;YACrB,KAAK,EAAE,EAAE;YACT,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe;SAC3B;QACD,2BAA2B,EAAE,IAAI;QACjC,4BAA4B,EAAE,IAAI;QAClC,mBAAmB,EAAE,IAAI;KACzB,CAAC,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
1
+ {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/create-project.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uCAAmF;AAEnF,sDAAkD;AAElD;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACrD,OAAO,IAAI,kBAAO,CAAC;QAClB,GAAG,OAAO;QACV,eAAe,EAAE;YAChB,MAAM,EAAE,qBAAU,CAAC,QAAQ;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,sBAAU,EAAE,uBAAuB,CAAC;YAC/D,gBAAgB,EAAE,+BAAoB,CAAC,MAAM;YAC7C,eAAe,EAAE,IAAI;YACrB,KAAK,EAAE,EAAE;YACT,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe;SAC3B;QACD,2BAA2B,EAAE,IAAI;QACjC,4BAA4B,EAAE,KAAK;QACnC,mBAAmB,EAAE,KAAK;KAC1B,CAAC,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
@@ -1,14 +1,14 @@
1
1
  import { BuilderContext } from '@angular-devkit/architect';
2
2
  import { NgDocStyleType } from '@ng-doc/core';
3
- import { NgDocSchema } from './schema';
3
+ import { NgDocConfiguration } from './configuration';
4
4
  export interface NgDocBuilderContext {
5
5
  tsConfig: string;
6
- options: NgDocSchema;
6
+ config: NgDocConfiguration;
7
7
  context: BuilderContext;
8
8
  inlineStyleLanguage: NgDocStyleType;
9
9
  pagesPaths: string[];
10
10
  assetsPath: string;
11
11
  buildPath: string;
12
12
  apiPath: string;
13
- modulesPath: string;
13
+ guidesPath: string;
14
14
  }
@@ -0,0 +1,43 @@
1
+ import { NgDocHeading } from '@ng-doc/core';
2
+ import { NgDocGlobalKeyword } from './keyword-map';
3
+ import { NgDocRepoConfig } from './repo-config';
4
+ /**
5
+ * NgDoc configuration interface, that configure NgDoc library
6
+ */
7
+ export interface NgDocConfiguration {
8
+ /**
9
+ * List of paths to your documentation location (e.g. "src/app")
10
+ */
11
+ pages?: string | string[];
12
+ /**
13
+ * Route prefix uses to add some additional route segment before documentation pages,
14
+ * you can use it e.g. to wrap documentation with additional route like "docs".
15
+ */
16
+ routePrefix?: string;
17
+ /**
18
+ * List of the global keywords, to create link to foreign websites
19
+ */
20
+ keywords?: Record<string, NgDocGlobalKeyword>;
21
+ /**
22
+ * The repository configuration.
23
+ * If it is defined, Ngoc will use it to display the "Suggest edits" button, and "View source" button, on each page.
24
+ */
25
+ repoConfig?: NgDocRepoConfig;
26
+ /**
27
+ * The path to the tsconfig file (NgDoc uses tsconfig of your application by default, but you can override it)
28
+ */
29
+ tsConfig?: string;
30
+ /**
31
+ * The configuration for the guides
32
+ */
33
+ guide?: NgDocGuideConfiguration;
34
+ }
35
+ /**
36
+ * The configuration for the guide page
37
+ */
38
+ export interface NgDocGuideConfiguration {
39
+ /**
40
+ * Defines a list of the heading levels for which the anchor will be generated.
41
+ */
42
+ anchorHeadings?: NgDocHeading[];
43
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=entity-output.js.map
3
+ //# sourceMappingURL=configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../libs/builder/interfaces/configuration.ts"],"names":[],"mappings":""}
@@ -2,8 +2,10 @@ export * from './action-output';
2
2
  export * from './asset';
3
3
  export * from './builder-context';
4
4
  export * from './built-output';
5
+ export * from './configuration';
5
6
  export * from './keyword-map';
6
7
  export * from './page-index';
7
8
  export * from './path-anchor';
8
9
  export * from './renderer-options';
10
+ export * from './repo-config';
9
11
  export * from './schema';
@@ -5,9 +5,11 @@ tslib_1.__exportStar(require("./action-output"), exports);
5
5
  tslib_1.__exportStar(require("./asset"), exports);
6
6
  tslib_1.__exportStar(require("./builder-context"), exports);
7
7
  tslib_1.__exportStar(require("./built-output"), exports);
8
+ tslib_1.__exportStar(require("./configuration"), exports);
8
9
  tslib_1.__exportStar(require("./keyword-map"), exports);
9
10
  tslib_1.__exportStar(require("./page-index"), exports);
10
11
  tslib_1.__exportStar(require("./path-anchor"), exports);
11
12
  tslib_1.__exportStar(require("./renderer-options"), exports);
13
+ tslib_1.__exportStar(require("./repo-config"), exports);
12
14
  tslib_1.__exportStar(require("./schema"), exports);
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,kDAAwB;AACxB,4DAAkC;AAClC,yDAA+B;AAC/B,wDAA8B;AAC9B,uDAA6B;AAC7B,wDAA8B;AAC9B,6DAAmC;AACnC,mDAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,kDAAwB;AACxB,4DAAkC;AAClC,yDAA+B;AAC/B,0DAAgC;AAChC,wDAA8B;AAC9B,uDAA6B;AAC7B,wDAA8B;AAC9B,6DAAmC;AACnC,wDAA8B;AAC9B,mDAAyB"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The repository configuration interface.
3
+ */
4
+ export interface NgDocRepoConfig {
5
+ /**
6
+ * The URL of the repository (e.g. "https://github.com/skoropadas/ng-doc")
7
+ */
8
+ url: string;
9
+ /**
10
+ * The develop branch name (e.g. "master"/"main")
11
+ */
12
+ mainBranch: string;
13
+ /**
14
+ * The release branch name (e.g. "release"), uses to generate correct links for the "View source" button
15
+ */
16
+ releaseBranch: string;
17
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=demo-options.js.map
3
+ //# sourceMappingURL=repo-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-config.js","sourceRoot":"","sources":["../../../../libs/builder/interfaces/repo-config.ts"],"names":[],"mappings":""}
@@ -1,29 +1,9 @@
1
- import { NgDocGlobalKeyword } from './keyword-map';
1
+ import { NgDocConfiguration } from './configuration';
2
2
  export interface NgDocSchema {
3
3
  browserTarget: string;
4
4
  main: string;
5
- ngDoc?: NgDocConfiguration;
6
- }
7
- /**
8
- * NgDoc configuration interface, that configure NgDoc library
9
- */
10
- export interface NgDocConfiguration {
11
5
  /**
12
- * List of paths to your documentation location (e.g. "src/app")
6
+ * @deprecated Please use `ng-doc.config.js` file instead. Check our configuration guide for more details.
13
7
  */
14
- pages?: string | string[];
15
- /**
16
- * Route prefix uses to add some additional route segment before documentation pages,
17
- * you can use it e.g. to wrap documentation with additional route like "docs".
18
- */
19
- routePrefix?: string;
20
- /**
21
- * Tag for of the current target, you can use it in conjunction with the `onlyForTags` field in your pages to
22
- * hide pages for certain documentation builds
23
- */
24
- tag?: string;
25
- /**
26
- * List of the global keywords, to create link to foreign websites
27
- */
28
- keywords?: Record<string, NgDocGlobalKeyword>;
8
+ ngDoc?: NgDocConfiguration;
29
9
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ng-doc/builder",
3
- "version": "15.0.0-beta.33",
3
+ "version": "15.0.0-beta.34",
4
4
  "type": "commonjs",
5
5
  "builders": "./builders.json",
6
6
  "schematics": "./schematics/collection.json",
7
7
  "dependencies": {
8
- "@ng-doc/core": "15.0.0-beta.33",
8
+ "@ng-doc/core": "15.0.0-beta.34",
9
9
  "@angular-devkit/architect": ">=0.1500.0",
10
10
  "chokidar": "^3.5.3",
11
11
  "minimatch": "^5.1.0",
@@ -21,10 +21,17 @@
21
21
  "rehype": "^9.0.1",
22
22
  "rehype-format": "^3.1.0",
23
23
  "rehype-highlight": "^4.1.0",
24
- "rehype-slug": "^4.0.0",
24
+ "hast-util-to-string": "^1.0.4",
25
+ "unist-util-visit": "^2.0.1",
26
+ "github-slugger": "^1.5.0",
27
+ "hast-util-heading-rank": "^1.0.1",
28
+ "hast-util-has-property": "^1.0.4",
25
29
  "highlight.js": "^11.5.1",
26
30
  "raw-loader": "^4.0.2",
27
- "@microsoft/tsdoc": "^0.14.2"
31
+ "esbuild": "^0.17.8",
32
+ "@microsoft/tsdoc": "^0.14.2",
33
+ "cosmiconfig": "^8.1.0",
34
+ "cosmiconfig-typescript-swc-loader": "^0.0.2"
28
35
  },
29
36
  "publishConfig": {
30
37
  "access": "public"
@@ -20,7 +20,7 @@ function build(options) {
20
20
  const closestCategoryFile = options.category
21
21
  ? (0, helpers_1.findClosestFile)(options.path, engine_1.CATEGORY_NAME)
22
22
  : null;
23
- const pageName = (0, strings_1.classify)(options.title);
23
+ const pageName = (0, strings_1.classify)(options.title + 'Page');
24
24
  const categoryConstantName = options.category && closestCategoryFile ? (0, utils_1.extractDefaultExportName)(closestCategoryFile) : null;
25
25
  const categoryImportPath = closestCategoryFile
26
26
  ? (0, path_1.relative)(path, closestCategoryFile).replace(/.ts$/, '')
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/page/index.ts"],"names":[],"mappings":";;;AAAA,oEAA2E;AAC3E,2DAaoC;AACpC,+BAA8C;AAE9C,yCAA2C;AAC3C,2CAA8C;AAC9C,oCAAkD;AAGlD,MAAM,aAAa,GAAa,CAAC,2BAA2B,EAAE,iCAAiC,CAAC,CAAC;AAEjG;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,OAA6B;IAClD,OAAO,CAAC,IAAU,EAAE,EAAE;QACrB,MAAM,IAAI,GAAW,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAA,mBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACxE,MAAM,mBAAmB,GAAkB,OAAO,CAAC,QAAQ;YAC1D,CAAC,CAAC,IAAA,yBAAe,EAAC,OAAO,CAAC,IAAI,EAAE,sBAAa,CAAC;YAC9C,CAAC,CAAC,IAAI,CAAC;QACR,MAAM,QAAQ,GAAW,IAAA,kBAAQ,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,oBAAoB,GACzB,OAAO,CAAC,QAAQ,IAAI,mBAAmB,CAAC,CAAC,CAAC,IAAA,gCAAwB,EAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChG,MAAM,kBAAkB,GAAkB,mBAAmB;YAC5D,CAAC,CAAC,IAAA,eA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,kBAAkB;oBAC9B,QAAQ;oBACR,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC;gBACF,IAAA,iBAAI,EAAC,IAAI,CAAC;gBACV,IAAA,oBAAO,EAAC,CAAC,SAAoB,EAAE,EAAE;oBAChC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;wBAChC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;qBAClD;oBACD,OAAO,SAAS,CAAC;gBAClB,CAAC,CAAC;aACF,CAAC,EACF,0BAAa,CAAC,SAAS,CACvB;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAxCD,sBAwCC"}
@@ -3,14 +3,22 @@ import {ChangeDetectionStrategy, Component, NgModule, Type} from "@angular/core"
3
3
  import {RouterModule} from "@angular/router";
4
4
  import {CommonModule} from '@angular/common';
5
5
  import {NgDocDemoAssets, NgDocPageModule, NgDocRootPage} from '@ng-doc/app';
6
+ import {NgDocPageType} from '@ng-doc/core';
6
7
  import pageContent from '!!raw-loader!{{ page.builtPagePath }}';
7
8
 
8
9
  @Component({
9
10
  template: `<ng-doc-page></ng-doc-page>`,
10
11
  changeDetection: ChangeDetectionStrategy.OnPush,
11
- providers: [{provide: NgDocRootPage, useExisting: {{ page.componentName }}}],
12
+ providers: [{provide: NgDocRootPage, useExisting: DynamicComponent}],
12
13
  })
13
- export class {{ page.componentName }} extends NgDocRootPage {
14
+ export class DynamicComponent extends NgDocRootPage {
15
+ readonly pageType: NgDocPageType = 'api';
16
+ {%- if page.editSourceFileUrl %}
17
+ readonly editSourceFileUrl: string = '{{ page.editSourceFileUrl }}';
18
+ {%- endif %}
19
+ {%- if page.viewSourceFileUrl %}
20
+ readonly viewSourceFileUrl: string = '{{ page.viewSourceFileUrl }}';
21
+ {%- endif %}
14
22
  readonly pageContent: string = pageContent;
15
23
  readonly demo: Record<string, Type<unknown>> | undefined = undefined;
16
24
  readonly demoAssets: NgDocDemoAssets | undefined = undefined;
@@ -21,17 +29,17 @@ export class {{ page.componentName }} extends NgDocRootPage {
21
29
  }
22
30
 
23
31
  @NgModule({
24
- declarations: [{{ page.componentName }}],
32
+ declarations: [DynamicComponent],
25
33
  imports: [
26
34
  CommonModule,
27
35
  NgDocPageModule,
28
36
  RouterModule.forChild([{
29
37
  path: '',
30
- component: {{ page.componentName }},
38
+ component: DynamicComponent,
31
39
  title: '{{ page.title }}',
32
40
  }]),
33
41
  ],
34
42
  exports: [RouterModule]
35
43
  })
36
- export class {{ page.moduleName }} {
44
+ export class DynamicModule {
37
45
  }
@@ -14,7 +14,7 @@ import {RouterModule} from "@angular/router";
14
14
  {%- for page in scope.children %}
15
15
  {
16
16
  path: '{{ page.route }}',
17
- loadChildren: () => import('{{ page.moduleImport }}').then(m => m.{{ page.moduleName }})
17
+ loadChildren: () => import('{{ page.moduleImport }}').then(m => m.DynamicModule)
18
18
  },
19
19
  {%- endfor %}
20
20
  ]
@@ -23,5 +23,5 @@ import {RouterModule} from "@angular/router";
23
23
  ],
24
24
  exports: [RouterModule]
25
25
  })
26
- export class {{ scope.moduleName }} {
26
+ export class DynamicModule {
27
27
  }
@@ -13,28 +13,28 @@ import apiList from './ng-doc.api-list.json';
13
13
  }],
14
14
  changeDetection: ChangeDetectionStrategy.OnPush,
15
15
  })
16
- export class {{ api.componentName }} {
16
+ export class DynamicComponent {
17
17
  }
18
18
 
19
19
  @NgModule({
20
- declarations: [{{ api.componentName }}],
20
+ declarations: [DynamicComponent],
21
21
  imports: [
22
22
  CommonModule,
23
23
  NgDocApiListModule,
24
24
  RouterModule.forChild([
25
25
  {
26
26
  path: '',
27
- component: {{ api.componentName }},
27
+ component: DynamicComponent,
28
28
  },
29
29
  {%- for scope in api.children %}
30
30
  {
31
31
  path: '{{ scope.route }}',
32
- loadChildren: () => import('{{ scope.moduleImport }}').then(m => m.{{ scope.moduleName }})
32
+ loadChildren: () => import('{{ scope.moduleImport }}').then(m => m.DynamicModule)
33
33
  },
34
34
  {%- endfor %}
35
35
  ]),
36
36
  ],
37
37
  exports: [RouterModule]
38
38
  })
39
- export class {{ api.moduleName }} {
39
+ export class DynamicModule {
40
40
  }
@@ -13,7 +13,7 @@ import {RouterModule} from "@angular/router";
13
13
  {%- for child in category.children %}
14
14
  {
15
15
  path: '{{ child.route }}',
16
- loadChildren: () => import('{{ child.moduleImport }}').then(m => m.{{ child.moduleName }})
16
+ loadChildren: () => import('{{ child.moduleImport }}').then(m => m.DynamicModule)
17
17
  },
18
18
  {%- endfor %}
19
19
  ]
@@ -22,5 +22,5 @@ import {RouterModule} from "@angular/router";
22
22
  ],
23
23
  exports: [RouterModule]
24
24
  })
25
- export class {{ category.moduleName }} {
25
+ export class DynamicModule {
26
26
  }
@@ -19,14 +19,14 @@ export const ngDocContextProvider: Provider = {
19
19
  {%- endif %}
20
20
  {%- if entity.navigationItems.length %}
21
21
  children: [
22
- {%- for child in entity.navigationItems %}
22
+ {%- for child in entity.navigationItems | sortNavigationEntities %}
23
23
  {{ nav(child) }},
24
24
  {%- endfor %}
25
25
  ]
26
26
  {%- endif %}
27
27
  }
28
28
  {%- endmacro %}
29
- {%- for entity in entities %}
29
+ {%- for entity in entities | sortNavigationEntities %}
30
30
  {{ nav(entity) }},
31
31
  {%- endfor %}
32
32
  ],
@@ -7,11 +7,13 @@
7
7
  {% set isStatic = declaration.isStatic and declaration.isStatic() %}
8
8
  {% set isAsync = declaration.isAsync and declaration.isAsync() %}
9
9
  {% set isReadonly = declaration.isReadonly and declaration.isReadonly() %}
10
- {% set tooltip = ["Abstract" if isAbstract, 'Static' if isStatic, 'Async' if isAsync, 'Readonly' if isReadonly] | noEmpty | join(', ') %}
10
+ {% set isProtected = declaration.getScope and declaration.getScope() == 'protected' %}
11
+ {% set tooltip = ["Protected" if isProtected, "Abstract" if isAbstract, 'Static' if isStatic, 'Async' if isAsync, 'Readonly' if isReadonly] | noEmpty | join(', ') %}
11
12
 
12
13
  {%- if type == 'badge' %}
13
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
14
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
14
15
  <span class="ng-doc-badge-wrapper" ngDocTooltip="{{ tooltip }}">
16
+ {{ badgeMacro.render("protected") if isProtected }}
15
17
  {{ badgeMacro.render("abstract") if isAbstract }}
16
18
  {{ badgeMacro.render("static") if isStatic }}
17
19
  {{ badgeMacro.render("async") if isAsync }}
@@ -20,8 +22,9 @@
20
22
  {%- endif %}
21
23
 
22
24
  {%- elseif type == 'modifier' %}
23
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
25
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
24
26
  <div class="ng-doc-modifiers-wrapper">
27
+ {{ modifierMacro.render("protected") if isProtected }}
25
28
  {{ modifierMacro.render("abstract") if isAbstract }}
26
29
  {{ modifierMacro.render("static") if isStatic }}
27
30
  {{ modifierMacro.render("async") if isAsync }}
@@ -29,8 +32,9 @@
29
32
  </div>
30
33
  {%- endif %}
31
34
  {%- else %}
32
- {%- if isAbstract or isStatic or isAsync or isReadonly %}
35
+ {%- if isAbstract or isStatic or isAsync or isReadonly or isProtected %}
33
36
  <span class="ng-doc-tags-wrapper">
37
+ {{ tagMacro.render("protected") if isProtected }}
34
38
  {{ tagMacro.render("abstract") if isAbstract }}
35
39
  {{ tagMacro.render("static") if isStatic }}
36
40
  {{ tagMacro.render("async") if isAsync }}
@@ -3,9 +3,11 @@ import {Component, NgModule, Type, ChangeDetectionStrategy} from '@angular/core'
3
3
  import {RouterModule} from '@angular/router';
4
4
  import {CommonModule} from '@angular/common';
5
5
  import {NgDocPageModule, NgDocRootPage, NgDocDemoAssets} from '@ng-doc/app';
6
+ import {NgDocDependencies, NgDocPageType} from '@ng-doc/core';
6
7
  import pageContent from '!!raw-loader!{{ page.builtPagePath }}';
7
8
  {%- if page.pageDependencies %}
8
9
  // noinspection ES6UnusedImports
10
+ import {PlaygroundsModule} from './playgrounds';
9
11
  import pageDependencies from '{{ page.pageDependencies.importPath }}';
10
12
  {%- endif %}
11
13
  {%- if page.componentsAssets %}
@@ -17,14 +19,24 @@ import demoAssets from '{{ page.componentsAssets }}';
17
19
  @Component({
18
20
  template: `<ng-doc-page></ng-doc-page>`,
19
21
  changeDetection: ChangeDetectionStrategy.OnPush,
20
- providers: [{provide: NgDocRootPage, useExisting: {{ page.componentName }}}],
22
+ providers: [{provide: NgDocRootPage, useExisting: DynamicComponent}],
21
23
  })
22
- export class {{ page.componentName }} extends NgDocRootPage {
24
+ export class DynamicComponent extends NgDocRootPage {
25
+ readonly pageType: NgDocPageType = 'guide';
23
26
  readonly pageContent: string = pageContent;
27
+
28
+ {%- if page.editSourceFileUrl %}
29
+ readonly editSourceFileUrl: string = '{{ page.editSourceFileUrl }}';
30
+ {%- endif %}
31
+
32
+ {%- if page.viewSourceFileUrl %}
33
+ readonly viewSourceFileUrl: string = '{{ page.viewSourceFileUrl }}';
34
+ {%- endif %}
35
+
24
36
  {%- if page.pageDependencies %}
25
- readonly demo: Record<string, Type<unknown>> | undefined = pageDependencies.demo;
26
- readonly module: Type<unknown> | undefined = pageDependencies.module;
37
+ readonly dependencies?: NgDocDependencies = pageDependencies;
27
38
  {%- endif %}
39
+
28
40
  {%- if page.componentsAssets %}
29
41
  readonly demoAssets: NgDocDemoAssets = demoAssets;
30
42
  {%- endif %}
@@ -35,21 +47,22 @@ export class {{ page.componentName }} extends NgDocRootPage {
35
47
  }
36
48
 
37
49
  @NgModule({
38
- declarations: [{{ page.componentName }}],
50
+ declarations: [DynamicComponent],
39
51
  imports: [
40
52
  CommonModule,
41
53
  NgDocPageModule,
42
54
  {%- if page.pageDependencies %}
43
55
  pageDependencies.module,
56
+ PlaygroundsModule,
44
57
  {%- endif %}
45
58
  RouterModule.forChild([{
46
59
  path: '',
47
- component: {{ page.componentName }},
60
+ component: DynamicComponent,
48
61
  title: '{{ page.title }}',
49
62
  }]),
50
63
  ],
51
64
  exports: [RouterModule]
52
65
  })
53
- export class {{ page.moduleName }} {
66
+ export class DynamicModule {
54
67
  }
55
68