typedoc 0.26.10 → 0.27.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 (336) hide show
  1. package/bin/package.json +3 -0
  2. package/bin/typedoc +1 -1
  3. package/dist/index.d.ts +23 -13
  4. package/dist/index.js +22 -81
  5. package/dist/lib/application-events.js +1 -4
  6. package/dist/lib/application.d.ts +26 -16
  7. package/dist/lib/application.js +222 -242
  8. package/dist/lib/cli.js +3 -40
  9. package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
  10. package/dist/lib/converter/comments/blockLexer.js +24 -30
  11. package/dist/lib/converter/comments/declarationReference.js +10 -21
  12. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
  13. package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
  14. package/dist/lib/converter/comments/discovery.d.ts +4 -4
  15. package/dist/lib/converter/comments/discovery.js +172 -148
  16. package/dist/lib/converter/comments/index.d.ts +4 -4
  17. package/dist/lib/converter/comments/index.js +39 -50
  18. package/dist/lib/converter/comments/lexer.d.ts +1 -1
  19. package/dist/lib/converter/comments/lexer.js +2 -5
  20. package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
  21. package/dist/lib/converter/comments/lineLexer.js +12 -15
  22. package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
  23. package/dist/lib/converter/comments/linkResolver.js +14 -21
  24. package/dist/lib/converter/comments/parser.d.ts +6 -6
  25. package/dist/lib/converter/comments/parser.js +69 -96
  26. package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
  27. package/dist/lib/converter/comments/rawLexer.js +13 -16
  28. package/dist/lib/converter/comments/tagName.js +1 -4
  29. package/dist/lib/converter/comments/textParser.d.ts +4 -4
  30. package/dist/lib/converter/comments/textParser.js +28 -30
  31. package/dist/lib/converter/components.d.ts +2 -3
  32. package/dist/lib/converter/components.js +2 -7
  33. package/dist/lib/converter/context.d.ts +9 -9
  34. package/dist/lib/converter/context.js +54 -44
  35. package/dist/lib/converter/convert-expression.js +16 -23
  36. package/dist/lib/converter/converter-events.d.ts +1 -0
  37. package/dist/lib/converter/converter-events.js +2 -4
  38. package/dist/lib/converter/converter.d.ts +16 -13
  39. package/dist/lib/converter/converter.js +210 -238
  40. package/dist/lib/converter/factories/index-signature.d.ts +1 -1
  41. package/dist/lib/converter/factories/index-signature.js +11 -17
  42. package/dist/lib/converter/factories/signature.d.ts +2 -2
  43. package/dist/lib/converter/factories/signature.js +95 -106
  44. package/dist/lib/converter/index.d.ts +6 -7
  45. package/dist/lib/converter/index.js +3 -11
  46. package/dist/lib/converter/jsdoc.d.ts +1 -1
  47. package/dist/lib/converter/jsdoc.js +34 -41
  48. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
  49. package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
  50. package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
  51. package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
  52. package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
  53. package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
  54. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
  55. package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
  56. package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
  57. package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
  58. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
  59. package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
  60. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
  61. package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
  62. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  63. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
  64. package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
  65. package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
  66. package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
  67. package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
  68. package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
  69. package/dist/lib/converter/plugins/TypePlugin.js +95 -158
  70. package/dist/lib/converter/plugins/index.d.ts +10 -9
  71. package/dist/lib/converter/plugins/index.js +10 -21
  72. package/dist/lib/converter/symbols.d.ts +1 -1
  73. package/dist/lib/converter/symbols.js +234 -227
  74. package/dist/lib/converter/types.d.ts +2 -2
  75. package/dist/lib/converter/types.js +252 -237
  76. package/dist/lib/converter/utils/nodes.js +5 -13
  77. package/dist/lib/converter/utils/reflections.d.ts +1 -1
  78. package/dist/lib/converter/utils/reflections.js +4 -7
  79. package/dist/lib/converter/utils/repository.d.ts +1 -1
  80. package/dist/lib/converter/utils/repository.js +103 -97
  81. package/dist/lib/converter/utils/symbols.js +3 -9
  82. package/dist/lib/internationalization/index.d.ts +3 -4
  83. package/dist/lib/internationalization/index.js +3 -8
  84. package/dist/lib/internationalization/internationalization.d.ts +5 -4
  85. package/dist/lib/internationalization/internationalization.js +97 -103
  86. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  87. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  88. package/dist/lib/internationalization/locales/en.cjs +366 -2
  89. package/dist/lib/internationalization/locales/en.d.cts +339 -2
  90. package/dist/lib/internationalization/locales/jp.cjs +8 -11
  91. package/dist/lib/internationalization/locales/jp.d.cts +310 -1
  92. package/dist/lib/internationalization/locales/ko.cjs +7 -9
  93. package/dist/lib/internationalization/locales/ko.d.cts +223 -1
  94. package/dist/lib/internationalization/locales/zh.cjs +7 -10
  95. package/dist/lib/internationalization/locales/zh.d.cts +381 -1
  96. package/dist/lib/internationalization/translatable.d.ts +4 -327
  97. package/dist/lib/internationalization/translatable.js +2 -360
  98. package/dist/lib/models/FileRegistry.d.ts +20 -9
  99. package/dist/lib/models/FileRegistry.js +54 -45
  100. package/dist/lib/models/ReflectionCategory.d.ts +2 -2
  101. package/dist/lib/models/ReflectionCategory.js +16 -12
  102. package/dist/lib/models/ReflectionGroup.d.ts +3 -3
  103. package/dist/lib/models/ReflectionGroup.js +23 -14
  104. package/dist/lib/models/comments/comment.d.ts +23 -37
  105. package/dist/lib/models/comments/comment.js +388 -325
  106. package/dist/lib/models/comments/index.d.ts +2 -2
  107. package/dist/lib/models/comments/index.js +1 -6
  108. package/dist/lib/models/index.d.ts +7 -7
  109. package/dist/lib/models/index.js +7 -23
  110. package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
  111. package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
  112. package/dist/lib/models/reflections/abstract.d.ts +17 -20
  113. package/dist/lib/models/reflections/abstract.js +249 -256
  114. package/dist/lib/models/reflections/container.d.ts +7 -7
  115. package/dist/lib/models/reflections/container.js +43 -16
  116. package/dist/lib/models/reflections/declaration.d.ts +15 -12
  117. package/dist/lib/models/reflections/declaration.js +150 -29
  118. package/dist/lib/models/reflections/document.d.ts +3 -3
  119. package/dist/lib/models/reflections/document.js +26 -13
  120. package/dist/lib/models/reflections/index.d.ts +15 -15
  121. package/dist/lib/models/reflections/index.js +12 -31
  122. package/dist/lib/models/reflections/kind.d.ts +1 -1
  123. package/dist/lib/models/reflections/kind.js +3 -6
  124. package/dist/lib/models/reflections/parameter.d.ts +5 -4
  125. package/dist/lib/models/reflections/parameter.js +11 -13
  126. package/dist/lib/models/reflections/project.d.ts +14 -9
  127. package/dist/lib/models/reflections/project.js +104 -56
  128. package/dist/lib/models/reflections/reference.d.ts +3 -3
  129. package/dist/lib/models/reflections/reference.js +6 -9
  130. package/dist/lib/models/reflections/signature.d.ts +8 -8
  131. package/dist/lib/models/reflections/signature.js +35 -14
  132. package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
  133. package/dist/lib/models/reflections/type-parameter.js +9 -10
  134. package/dist/lib/models/reflections/utils.js +1 -4
  135. package/dist/lib/models/reflections/variant.d.ts +8 -7
  136. package/dist/lib/models/reflections/variant.js +1 -2
  137. package/dist/lib/models/sources/file.d.ts +2 -2
  138. package/dist/lib/models/sources/file.js +22 -5
  139. package/dist/lib/models/sources/index.d.ts +1 -1
  140. package/dist/lib/models/sources/index.js +1 -5
  141. package/dist/lib/models/types.d.ts +26 -13
  142. package/dist/lib/models/types.js +236 -151
  143. package/dist/lib/output/components.d.ts +5 -11
  144. package/dist/lib/output/components.js +84 -125
  145. package/dist/lib/output/events.d.ts +3 -3
  146. package/dist/lib/output/events.js +128 -94
  147. package/dist/lib/output/formatter.d.ts +84 -0
  148. package/dist/lib/output/formatter.js +619 -0
  149. package/dist/lib/output/index.d.ts +9 -8
  150. package/dist/lib/output/index.js +7 -19
  151. package/dist/lib/output/models/UrlMapping.d.ts +2 -2
  152. package/dist/lib/output/models/UrlMapping.js +4 -5
  153. package/dist/lib/output/output.d.ts +13 -0
  154. package/dist/lib/output/output.js +72 -0
  155. package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
  156. package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
  157. package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
  158. package/dist/lib/output/plugins/IconsPlugin.js +28 -84
  159. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
  160. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
  161. package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
  162. package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
  163. package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
  164. package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
  165. package/dist/lib/output/plugins/index.d.ts +6 -6
  166. package/dist/lib/output/plugins/index.js +6 -15
  167. package/dist/lib/output/renderer.d.ts +14 -13
  168. package/dist/lib/output/renderer.js +129 -185
  169. package/dist/lib/output/theme.d.ts +9 -5
  170. package/dist/lib/output/theme.js +14 -62
  171. package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
  172. package/dist/lib/output/themes/MarkedPlugin.js +152 -117
  173. package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
  174. package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
  175. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
  176. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
  177. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  178. package/dist/lib/output/themes/default/Slugger.js +46 -0
  179. package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
  180. package/dist/lib/output/themes/default/layouts/default.js +67 -34
  181. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
  182. package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
  183. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
  184. package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
  185. package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
  186. package/dist/lib/output/themes/default/partials/comment.js +52 -29
  187. package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
  188. package/dist/lib/output/themes/default/partials/footer.js +11 -14
  189. package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
  190. package/dist/lib/output/themes/default/partials/header.js +9 -13
  191. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
  192. package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
  193. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
  194. package/dist/lib/output/themes/default/partials/icon.js +78 -73
  195. package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
  196. package/dist/lib/output/themes/default/partials/index.js +19 -22
  197. package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
  198. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
  199. package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
  200. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
  201. package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
  202. package/dist/lib/output/themes/default/partials/member.js +19 -24
  203. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
  204. package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
  205. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
  206. package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
  207. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
  208. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
  209. package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
  210. package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
  211. package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
  212. package/dist/lib/output/themes/default/partials/members.js +10 -42
  213. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  214. package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
  215. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
  216. package/dist/lib/output/themes/default/partials/navigation.js +51 -62
  217. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
  218. package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
  219. package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
  220. package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
  221. package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
  222. package/dist/lib/output/themes/default/partials/type.js +8 -388
  223. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
  224. package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
  225. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  226. package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
  227. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
  228. package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
  229. package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
  230. package/dist/lib/output/themes/default/templates/document.js +3 -7
  231. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
  232. package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
  233. package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
  234. package/dist/lib/output/themes/default/templates/index.js +3 -7
  235. package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
  236. package/dist/lib/output/themes/default/templates/reflection.js +31 -34
  237. package/dist/lib/output/themes/lib.d.ts +17 -3
  238. package/dist/lib/output/themes/lib.js +110 -49
  239. package/dist/lib/serialization/components.d.ts +2 -5
  240. package/dist/lib/serialization/components.js +1 -2
  241. package/dist/lib/serialization/deserializer.d.ts +21 -7
  242. package/dist/lib/serialization/deserializer.js +138 -123
  243. package/dist/lib/serialization/events.d.ts +2 -2
  244. package/dist/lib/serialization/events.js +6 -5
  245. package/dist/lib/serialization/index.d.ts +5 -5
  246. package/dist/lib/serialization/index.js +4 -33
  247. package/dist/lib/serialization/schema.d.ts +8 -2
  248. package/dist/lib/serialization/schema.js +2 -2
  249. package/dist/lib/serialization/serializer.d.ts +11 -5
  250. package/dist/lib/serialization/serializer.js +32 -25
  251. package/dist/lib/utils/array.d.ts +3 -0
  252. package/dist/lib/utils/array.js +26 -27
  253. package/dist/lib/utils/component.d.ts +2 -44
  254. package/dist/lib/utils/component.js +10 -102
  255. package/dist/lib/utils/entry-point.d.ts +3 -4
  256. package/dist/lib/utils/entry-point.js +114 -85
  257. package/dist/lib/utils/enum.js +6 -14
  258. package/dist/lib/utils/events.js +6 -12
  259. package/dist/lib/utils/fs.js +50 -91
  260. package/dist/lib/utils/general.d.ts +2 -1
  261. package/dist/lib/utils/general.js +50 -40
  262. package/dist/lib/utils/highlighter.js +30 -57
  263. package/dist/lib/utils/hooks.js +7 -13
  264. package/dist/lib/utils/html-entities.d.ts +8926 -0
  265. package/dist/lib/utils/html-entities.js +2329 -0
  266. package/dist/lib/utils/html.d.ts +8 -0
  267. package/dist/lib/utils/html.js +81 -34
  268. package/dist/lib/utils/index.d.ts +22 -22
  269. package/dist/lib/utils/index.js +20 -91
  270. package/dist/lib/utils/jsx.d.ts +12 -5
  271. package/dist/lib/utils/jsx.elements.js +1 -4
  272. package/dist/lib/utils/jsx.js +53 -20
  273. package/dist/lib/utils/loggers.d.ts +3 -3
  274. package/dist/lib/utils/loggers.js +36 -46
  275. package/dist/lib/utils/map.d.ts +1 -1
  276. package/dist/lib/utils/map.js +6 -13
  277. package/dist/lib/utils/minimalSourceFile.js +5 -7
  278. package/dist/lib/utils/options/declaration.d.ts +33 -7
  279. package/dist/lib/utils/options/declaration.js +20 -22
  280. package/dist/lib/utils/options/defaults.d.ts +3 -2
  281. package/dist/lib/utils/options/defaults.js +18 -38
  282. package/dist/lib/utils/options/help.d.ts +2 -2
  283. package/dist/lib/utils/options/help.js +7 -10
  284. package/dist/lib/utils/options/index.d.ts +6 -6
  285. package/dist/lib/utils/options/index.js +4 -18
  286. package/dist/lib/utils/options/options.d.ts +8 -5
  287. package/dist/lib/utils/options/options.js +47 -71
  288. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  289. package/dist/lib/utils/options/readers/arguments.js +15 -17
  290. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  291. package/dist/lib/utils/options/readers/index.js +4 -11
  292. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  293. package/dist/lib/utils/options/readers/package-json.js +15 -21
  294. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  295. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  296. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  297. package/dist/lib/utils/options/readers/typedoc.js +47 -90
  298. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  299. package/dist/lib/utils/options/sources/index.js +1 -5
  300. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  301. package/dist/lib/utils/options/sources/typedoc.js +220 -196
  302. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  303. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  304. package/dist/lib/utils/package-manifest.d.ts +1 -1
  305. package/dist/lib/utils/package-manifest.js +15 -19
  306. package/dist/lib/utils/paths.js +9 -15
  307. package/dist/lib/utils/perf.js +6 -11
  308. package/dist/lib/utils/plugins.d.ts +1 -1
  309. package/dist/lib/utils/plugins.js +16 -17
  310. package/dist/lib/utils/reflections.d.ts +1 -1
  311. package/dist/lib/utils/reflections.js +9 -12
  312. package/dist/lib/utils/set.js +2 -6
  313. package/dist/lib/utils/sort.d.ts +3 -3
  314. package/dist/lib/utils/sort.js +20 -24
  315. package/dist/lib/utils/tsconfig.d.ts +1 -1
  316. package/dist/lib/utils/tsconfig.js +13 -21
  317. package/dist/lib/utils/tsutils.d.ts +1 -1
  318. package/dist/lib/utils/tsutils.js +3 -30
  319. package/dist/lib/utils/validation.js +6 -12
  320. package/dist/lib/validation/documentation.d.ts +2 -2
  321. package/dist/lib/validation/documentation.js +26 -29
  322. package/dist/lib/validation/exports.d.ts +2 -2
  323. package/dist/lib/validation/exports.js +9 -11
  324. package/dist/lib/validation/links.d.ts +2 -2
  325. package/dist/lib/validation/links.js +4 -7
  326. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  327. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  328. package/package.json +14 -11
  329. package/static/main.js +4 -4
  330. package/static/style.css +91 -2
  331. package/tsdoc.json +30 -0
  332. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  333. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  334. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  335. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  336. package/dist/lib/utils/html-entities.json +0 -2326
@@ -1,15 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SitemapPlugin = exports.NavigationPlugin = exports.JavascriptIndexPlugin = exports.IconsPlugin = exports.AssetsPlugin = exports.MarkedPlugin = void 0;
4
- var MarkedPlugin_1 = require("../themes/MarkedPlugin");
5
- Object.defineProperty(exports, "MarkedPlugin", { enumerable: true, get: function () { return MarkedPlugin_1.MarkedPlugin; } });
6
- var AssetsPlugin_1 = require("./AssetsPlugin");
7
- Object.defineProperty(exports, "AssetsPlugin", { enumerable: true, get: function () { return AssetsPlugin_1.AssetsPlugin; } });
8
- var IconsPlugin_1 = require("./IconsPlugin");
9
- Object.defineProperty(exports, "IconsPlugin", { enumerable: true, get: function () { return IconsPlugin_1.IconsPlugin; } });
10
- var JavascriptIndexPlugin_1 = require("./JavascriptIndexPlugin");
11
- Object.defineProperty(exports, "JavascriptIndexPlugin", { enumerable: true, get: function () { return JavascriptIndexPlugin_1.JavascriptIndexPlugin; } });
12
- var NavigationPlugin_1 = require("./NavigationPlugin");
13
- Object.defineProperty(exports, "NavigationPlugin", { enumerable: true, get: function () { return NavigationPlugin_1.NavigationPlugin; } });
14
- var SitemapPlugin_1 = require("./SitemapPlugin");
15
- Object.defineProperty(exports, "SitemapPlugin", { enumerable: true, get: function () { return SitemapPlugin_1.SitemapPlugin; } });
1
+ export { MarkedPlugin } from "../themes/MarkedPlugin.js";
2
+ export { AssetsPlugin } from "./AssetsPlugin.js";
3
+ export { IconsPlugin } from "./IconsPlugin.js";
4
+ export { JavascriptIndexPlugin } from "./JavascriptIndexPlugin.js";
5
+ export { NavigationPlugin } from "./NavigationPlugin.js";
6
+ export { SitemapPlugin } from "./SitemapPlugin.js";
@@ -1,13 +1,12 @@
1
- import type { Application } from "../application";
2
- import type { Theme } from "./theme";
3
- import { RendererEvent, PageEvent, IndexEvent, type MarkdownEvent } from "./events";
4
- import type { ProjectReflection } from "../models/reflections/project";
5
- import { RendererComponent } from "./components";
6
- import { ChildableComponent } from "../utils/component";
7
- import { EventHooks } from "../utils";
8
- import { type Comment, Reflection } from "../models";
9
- import type { JsxElement } from "../utils/jsx.elements";
10
- import type { DefaultThemeRenderContext } from "./themes/default/DefaultThemeRenderContext";
1
+ import type { Application } from "../application.js";
2
+ import type { Theme } from "./theme.js";
3
+ import { RendererEvent, PageEvent, IndexEvent, type MarkdownEvent } from "./events.js";
4
+ import type { ProjectReflection } from "../models/reflections/project.js";
5
+ import { EventHooks, AbstractComponent } from "../utils/index.js";
6
+ import { type Comment, Reflection } from "../models/index.js";
7
+ import type { JsxElement } from "../utils/jsx.elements.js";
8
+ import type { DefaultThemeRenderContext } from "./themes/default/DefaultThemeRenderContext.js";
9
+ import { MarkedPlugin } from "./plugins/index.js";
11
10
  /**
12
11
  * Describes the hooks available to inject output in the default theme.
13
12
  * If the available hooks don't let you put something where you'd like, please open an issue!
@@ -114,9 +113,10 @@ export interface RendererEvents {
114
113
  * Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
115
114
  * an instance of {@link IndexEvent}.
116
115
  *
117
- * @document ../../../internal-docs/custom-themes.md
116
+ * @summary Writes HTML output from TypeDoc's models
117
+ * @group Common
118
118
  */
119
- export declare class Renderer extends ChildableComponent<Application, RendererComponent, RendererEvents> {
119
+ export declare class Renderer extends AbstractComponent<Application, RendererEvents> {
120
120
  private themes;
121
121
  /** @event */
122
122
  static readonly EVENT_BEGIN_PAGE = "beginPage";
@@ -173,6 +173,8 @@ export declare class Renderer extends ChildableComponent<Application, RendererCo
173
173
  private accessor highlightLanguages;
174
174
  private accessor pretty;
175
175
  renderStartTime: number;
176
+ markedPlugin: MarkedPlugin;
177
+ constructor(owner: Application);
176
178
  /**
177
179
  * Define a new theme that can be used to render output.
178
180
  * This API will likely be changing at some point, to allow more easily overriding parts of the theme without
@@ -215,4 +217,3 @@ export declare class Renderer extends ChildableComponent<Application, RendererCo
215
217
  */
216
218
  private prepareOutputDirectory;
217
219
  }
218
- import "./plugins";
@@ -1,20 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
19
2
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
20
3
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
@@ -49,30 +32,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
49
32
  }
50
33
  return useValue ? value : void 0;
51
34
  };
52
- var __importStar = (this && this.__importStar) || function (mod) {
53
- if (mod && mod.__esModule) return mod;
54
- var result = {};
55
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
56
- __setModuleDefault(result, mod);
57
- return result;
58
- };
59
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
60
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
61
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
62
- };
63
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
64
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
65
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
66
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
67
- };
68
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
69
- if (kind === "m") throw new TypeError("Private method is not writable");
70
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
71
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
72
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
73
- };
74
- Object.defineProperty(exports, "__esModule", { value: true });
75
- exports.Renderer = void 0;
76
35
  /**
77
36
  * Holds all logic used render and output the final documentation.
78
37
  *
@@ -81,18 +40,16 @@ exports.Renderer = void 0;
81
40
  * series of {@link RendererEvent} events. Instances of {@link BasePlugin} can listen to these events and
82
41
  * alter the generated output.
83
42
  */
84
- const fs = __importStar(require("fs"));
85
- const path = __importStar(require("path"));
86
- const events_1 = require("./events");
87
- const fs_1 = require("../utils/fs");
88
- const DefaultTheme_1 = require("./themes/default/DefaultTheme");
89
- const components_1 = require("./components");
90
- const component_1 = require("../utils/component");
91
- const utils_1 = require("../utils");
92
- const highlighter_1 = require("../utils/highlighter");
93
- const models_1 = require("../models");
94
- const type_1 = require("./themes/default/partials/type");
95
- const jsx_1 = require("../utils/jsx");
43
+ import * as fs from "fs";
44
+ import * as path from "path";
45
+ import { RendererEvent, PageEvent, IndexEvent, } from "./events.js";
46
+ import { writeFileSync } from "../utils/fs.js";
47
+ import { DefaultTheme } from "./themes/default/DefaultTheme.js";
48
+ import { Option, EventHooks, AbstractComponent } from "../utils/index.js";
49
+ import { loadHighlighter } from "../utils/highlighter.js";
50
+ import { Reflection } from "../models/index.js";
51
+ import { setRenderSettings } from "../utils/jsx.js";
52
+ import { AssetsPlugin, IconsPlugin, JavascriptIndexPlugin, MarkedPlugin, NavigationPlugin, SitemapPlugin, } from "./plugins/index.js";
96
53
  /**
97
54
  * The renderer processes a {@link ProjectReflection} using a {@link Theme} instance and writes
98
55
  * the emitted html documents to a output directory. You can specify which theme should be used
@@ -122,15 +79,11 @@ const jsx_1 = require("../utils/jsx");
122
79
  * Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
123
80
  * an instance of {@link IndexEvent}.
124
81
  *
125
- * @document ../../../internal-docs/custom-themes.md
82
+ * @summary Writes HTML output from TypeDoc's models
83
+ * @group Common
126
84
  */
127
85
  let Renderer = (() => {
128
- var _Renderer_themeName_accessor_storage, _Renderer_cleanOutputDir_accessor_storage, _Renderer_cname_accessor_storage, _Renderer_githubPages_accessor_storage, _Renderer_cacheBust_accessor_storage, _Renderer_lightTheme_accessor_storage, _Renderer_darkTheme_accessor_storage, _Renderer_highlightLanguages_accessor_storage, _Renderer_pretty_accessor_storage;
129
- let _classDecorators = [(0, component_1.Component)({ name: "renderer", internal: true, childClass: components_1.RendererComponent })];
130
- let _classDescriptor;
131
- let _classExtraInitializers = [];
132
- let _classThis;
133
- let _classSuper = component_1.ChildableComponent;
86
+ let _classSuper = AbstractComponent;
134
87
  let _themeName_decorators;
135
88
  let _themeName_initializers = [];
136
89
  let _themeName_extraInitializers = [];
@@ -158,72 +111,115 @@ let Renderer = (() => {
158
111
  let _pretty_decorators;
159
112
  let _pretty_initializers = [];
160
113
  let _pretty_extraInitializers = [];
161
- var Renderer = _classThis = class extends _classSuper {
162
- constructor() {
163
- super(...arguments);
164
- this.themes = new Map([
165
- ["default", DefaultTheme_1.DefaultTheme],
166
- ]);
167
- /**
168
- * A list of async jobs which must be completed *before* rendering output.
169
- * They will be called after {@link RendererEvent.BEGIN} has fired, but before any files have been written.
170
- *
171
- * This may be used by plugins to register work that must be done to prepare output files. For example: asynchronously
172
- * transform markdown to HTML.
173
- *
174
- * Note: This array is cleared after calling the contained functions on each {@link Renderer.render} call.
175
- */
176
- this.preRenderAsyncJobs = [];
177
- /**
178
- * A list of async jobs which must be completed after rendering output files but before generation is considered successful.
179
- * These functions will be called after all documents have been written to the filesystem.
180
- *
181
- * This may be used by plugins to register work that must be done to finalize output files. For example: asynchronously
182
- * generating an image referenced in a render hook.
183
- *
184
- * Note: This array is cleared after calling the contained functions on each {@link Renderer.render} call.
185
- */
186
- this.postRenderAsyncJobs = [];
187
- /**
188
- * Hooks which will be called when rendering pages.
189
- * Note:
190
- * - Hooks added during output will be discarded at the end of rendering.
191
- * - Hooks added during a page render will be discarded at the end of that page's render.
192
- *
193
- * See {@link RendererHooks} for a description of each available hook, and when it will be called.
194
- */
195
- this.hooks = new utils_1.EventHooks();
196
- _Renderer_themeName_accessor_storage.set(this, __runInitializers(this, _themeName_initializers, void 0));
197
- _Renderer_cleanOutputDir_accessor_storage.set(this, (__runInitializers(this, _themeName_extraInitializers), __runInitializers(this, _cleanOutputDir_initializers, void 0)));
198
- _Renderer_cname_accessor_storage.set(this, (__runInitializers(this, _cleanOutputDir_extraInitializers), __runInitializers(this, _cname_initializers, void 0)));
199
- _Renderer_githubPages_accessor_storage.set(this, (__runInitializers(this, _cname_extraInitializers), __runInitializers(this, _githubPages_initializers, void 0)));
200
- _Renderer_cacheBust_accessor_storage.set(this, (__runInitializers(this, _githubPages_extraInitializers), __runInitializers(this, _cacheBust_initializers, void 0)));
201
- _Renderer_lightTheme_accessor_storage.set(this, (__runInitializers(this, _cacheBust_extraInitializers), __runInitializers(this, _lightTheme_initializers, void 0)));
202
- _Renderer_darkTheme_accessor_storage.set(this, (__runInitializers(this, _lightTheme_extraInitializers), __runInitializers(this, _darkTheme_initializers, void 0)));
203
- _Renderer_highlightLanguages_accessor_storage.set(this, (__runInitializers(this, _darkTheme_extraInitializers), __runInitializers(this, _highlightLanguages_initializers, void 0)));
204
- _Renderer_pretty_accessor_storage.set(this, (__runInitializers(this, _highlightLanguages_extraInitializers), __runInitializers(this, _pretty_initializers, void 0)));
205
- this.renderStartTime = (__runInitializers(this, _pretty_extraInitializers), -1);
114
+ return class Renderer extends _classSuper {
115
+ static {
116
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
117
+ _themeName_decorators = [Option("theme")];
118
+ _cleanOutputDir_decorators = [Option("cleanOutputDir")];
119
+ _cname_decorators = [Option("cname")];
120
+ _githubPages_decorators = [Option("githubPages")];
121
+ _cacheBust_decorators = [Option("cacheBust")];
122
+ _lightTheme_decorators = [Option("lightHighlightTheme")];
123
+ _darkTheme_decorators = [Option("darkHighlightTheme")];
124
+ _highlightLanguages_decorators = [Option("highlightLanguages")];
125
+ _pretty_decorators = [Option("pretty")];
126
+ __esDecorate(this, null, _themeName_decorators, { kind: "accessor", name: "themeName", static: false, private: false, access: { has: obj => "themeName" in obj, get: obj => obj.themeName, set: (obj, value) => { obj.themeName = value; } }, metadata: _metadata }, _themeName_initializers, _themeName_extraInitializers);
127
+ __esDecorate(this, null, _cleanOutputDir_decorators, { kind: "accessor", name: "cleanOutputDir", static: false, private: false, access: { has: obj => "cleanOutputDir" in obj, get: obj => obj.cleanOutputDir, set: (obj, value) => { obj.cleanOutputDir = value; } }, metadata: _metadata }, _cleanOutputDir_initializers, _cleanOutputDir_extraInitializers);
128
+ __esDecorate(this, null, _cname_decorators, { kind: "accessor", name: "cname", static: false, private: false, access: { has: obj => "cname" in obj, get: obj => obj.cname, set: (obj, value) => { obj.cname = value; } }, metadata: _metadata }, _cname_initializers, _cname_extraInitializers);
129
+ __esDecorate(this, null, _githubPages_decorators, { kind: "accessor", name: "githubPages", static: false, private: false, access: { has: obj => "githubPages" in obj, get: obj => obj.githubPages, set: (obj, value) => { obj.githubPages = value; } }, metadata: _metadata }, _githubPages_initializers, _githubPages_extraInitializers);
130
+ __esDecorate(this, null, _cacheBust_decorators, { kind: "accessor", name: "cacheBust", static: false, private: false, access: { has: obj => "cacheBust" in obj, get: obj => obj.cacheBust, set: (obj, value) => { obj.cacheBust = value; } }, metadata: _metadata }, _cacheBust_initializers, _cacheBust_extraInitializers);
131
+ __esDecorate(this, null, _lightTheme_decorators, { kind: "accessor", name: "lightTheme", static: false, private: false, access: { has: obj => "lightTheme" in obj, get: obj => obj.lightTheme, set: (obj, value) => { obj.lightTheme = value; } }, metadata: _metadata }, _lightTheme_initializers, _lightTheme_extraInitializers);
132
+ __esDecorate(this, null, _darkTheme_decorators, { kind: "accessor", name: "darkTheme", static: false, private: false, access: { has: obj => "darkTheme" in obj, get: obj => obj.darkTheme, set: (obj, value) => { obj.darkTheme = value; } }, metadata: _metadata }, _darkTheme_initializers, _darkTheme_extraInitializers);
133
+ __esDecorate(this, null, _highlightLanguages_decorators, { kind: "accessor", name: "highlightLanguages", static: false, private: false, access: { has: obj => "highlightLanguages" in obj, get: obj => obj.highlightLanguages, set: (obj, value) => { obj.highlightLanguages = value; } }, metadata: _metadata }, _highlightLanguages_initializers, _highlightLanguages_extraInitializers);
134
+ __esDecorate(this, null, _pretty_decorators, { kind: "accessor", name: "pretty", static: false, private: false, access: { has: obj => "pretty" in obj, get: obj => obj.pretty, set: (obj, value) => { obj.pretty = value; } }, metadata: _metadata }, _pretty_initializers, _pretty_extraInitializers);
135
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
206
136
  }
137
+ themes = new Map([
138
+ ["default", DefaultTheme],
139
+ ]);
140
+ /** @event */
141
+ static EVENT_BEGIN_PAGE = PageEvent.BEGIN;
142
+ /** @event */
143
+ static EVENT_END_PAGE = PageEvent.END;
144
+ /** @event */
145
+ static EVENT_BEGIN = RendererEvent.BEGIN;
146
+ /** @event */
147
+ static EVENT_END = RendererEvent.END;
148
+ /** @event */
149
+ static EVENT_PREPARE_INDEX = IndexEvent.PREPARE_INDEX;
150
+ /**
151
+ * A list of async jobs which must be completed *before* rendering output.
152
+ * They will be called after {@link RendererEvent.BEGIN} has fired, but before any files have been written.
153
+ *
154
+ * This may be used by plugins to register work that must be done to prepare output files. For example: asynchronously
155
+ * transform markdown to HTML.
156
+ *
157
+ * Note: This array is cleared after calling the contained functions on each {@link Renderer.render} call.
158
+ */
159
+ preRenderAsyncJobs = [];
160
+ /**
161
+ * A list of async jobs which must be completed after rendering output files but before generation is considered successful.
162
+ * These functions will be called after all documents have been written to the filesystem.
163
+ *
164
+ * This may be used by plugins to register work that must be done to finalize output files. For example: asynchronously
165
+ * generating an image referenced in a render hook.
166
+ *
167
+ * Note: This array is cleared after calling the contained functions on each {@link Renderer.render} call.
168
+ */
169
+ postRenderAsyncJobs = [];
170
+ /**
171
+ * The theme that is used to render the documentation.
172
+ */
173
+ theme;
174
+ /**
175
+ * Hooks which will be called when rendering pages.
176
+ * Note:
177
+ * - Hooks added during output will be discarded at the end of rendering.
178
+ * - Hooks added during a page render will be discarded at the end of that page's render.
179
+ *
180
+ * See {@link RendererHooks} for a description of each available hook, and when it will be called.
181
+ */
182
+ hooks = new EventHooks();
183
+ #themeName_accessor_storage = __runInitializers(this, _themeName_initializers, void 0);
207
184
  /** @internal */
208
- get themeName() { return __classPrivateFieldGet(this, _Renderer_themeName_accessor_storage, "f"); }
209
- set themeName(value) { __classPrivateFieldSet(this, _Renderer_themeName_accessor_storage, value, "f"); }
210
- get cleanOutputDir() { return __classPrivateFieldGet(this, _Renderer_cleanOutputDir_accessor_storage, "f"); }
211
- set cleanOutputDir(value) { __classPrivateFieldSet(this, _Renderer_cleanOutputDir_accessor_storage, value, "f"); }
212
- get cname() { return __classPrivateFieldGet(this, _Renderer_cname_accessor_storage, "f"); }
213
- set cname(value) { __classPrivateFieldSet(this, _Renderer_cname_accessor_storage, value, "f"); }
214
- get githubPages() { return __classPrivateFieldGet(this, _Renderer_githubPages_accessor_storage, "f"); }
215
- set githubPages(value) { __classPrivateFieldSet(this, _Renderer_githubPages_accessor_storage, value, "f"); }
185
+ get themeName() { return this.#themeName_accessor_storage; }
186
+ set themeName(value) { this.#themeName_accessor_storage = value; }
187
+ #cleanOutputDir_accessor_storage = (__runInitializers(this, _themeName_extraInitializers), __runInitializers(this, _cleanOutputDir_initializers, void 0));
188
+ get cleanOutputDir() { return this.#cleanOutputDir_accessor_storage; }
189
+ set cleanOutputDir(value) { this.#cleanOutputDir_accessor_storage = value; }
190
+ #cname_accessor_storage = (__runInitializers(this, _cleanOutputDir_extraInitializers), __runInitializers(this, _cname_initializers, void 0));
191
+ get cname() { return this.#cname_accessor_storage; }
192
+ set cname(value) { this.#cname_accessor_storage = value; }
193
+ #githubPages_accessor_storage = (__runInitializers(this, _cname_extraInitializers), __runInitializers(this, _githubPages_initializers, void 0));
194
+ get githubPages() { return this.#githubPages_accessor_storage; }
195
+ set githubPages(value) { this.#githubPages_accessor_storage = value; }
196
+ #cacheBust_accessor_storage = (__runInitializers(this, _githubPages_extraInitializers), __runInitializers(this, _cacheBust_initializers, void 0));
216
197
  /** @internal */
217
- get cacheBust() { return __classPrivateFieldGet(this, _Renderer_cacheBust_accessor_storage, "f"); }
218
- set cacheBust(value) { __classPrivateFieldSet(this, _Renderer_cacheBust_accessor_storage, value, "f"); }
219
- get lightTheme() { return __classPrivateFieldGet(this, _Renderer_lightTheme_accessor_storage, "f"); }
220
- set lightTheme(value) { __classPrivateFieldSet(this, _Renderer_lightTheme_accessor_storage, value, "f"); }
221
- get darkTheme() { return __classPrivateFieldGet(this, _Renderer_darkTheme_accessor_storage, "f"); }
222
- set darkTheme(value) { __classPrivateFieldSet(this, _Renderer_darkTheme_accessor_storage, value, "f"); }
223
- get highlightLanguages() { return __classPrivateFieldGet(this, _Renderer_highlightLanguages_accessor_storage, "f"); }
224
- set highlightLanguages(value) { __classPrivateFieldSet(this, _Renderer_highlightLanguages_accessor_storage, value, "f"); }
225
- get pretty() { return __classPrivateFieldGet(this, _Renderer_pretty_accessor_storage, "f"); }
226
- set pretty(value) { __classPrivateFieldSet(this, _Renderer_pretty_accessor_storage, value, "f"); }
198
+ get cacheBust() { return this.#cacheBust_accessor_storage; }
199
+ set cacheBust(value) { this.#cacheBust_accessor_storage = value; }
200
+ #lightTheme_accessor_storage = (__runInitializers(this, _cacheBust_extraInitializers), __runInitializers(this, _lightTheme_initializers, void 0));
201
+ get lightTheme() { return this.#lightTheme_accessor_storage; }
202
+ set lightTheme(value) { this.#lightTheme_accessor_storage = value; }
203
+ #darkTheme_accessor_storage = (__runInitializers(this, _lightTheme_extraInitializers), __runInitializers(this, _darkTheme_initializers, void 0));
204
+ get darkTheme() { return this.#darkTheme_accessor_storage; }
205
+ set darkTheme(value) { this.#darkTheme_accessor_storage = value; }
206
+ #highlightLanguages_accessor_storage = (__runInitializers(this, _darkTheme_extraInitializers), __runInitializers(this, _highlightLanguages_initializers, void 0));
207
+ get highlightLanguages() { return this.#highlightLanguages_accessor_storage; }
208
+ set highlightLanguages(value) { this.#highlightLanguages_accessor_storage = value; }
209
+ #pretty_accessor_storage = (__runInitializers(this, _highlightLanguages_extraInitializers), __runInitializers(this, _pretty_initializers, void 0));
210
+ get pretty() { return this.#pretty_accessor_storage; }
211
+ set pretty(value) { this.#pretty_accessor_storage = value; }
212
+ renderStartTime = (__runInitializers(this, _pretty_extraInitializers), -1);
213
+ markedPlugin;
214
+ constructor(owner) {
215
+ super(owner);
216
+ this.markedPlugin = new MarkedPlugin(this);
217
+ new AssetsPlugin(this);
218
+ new IconsPlugin(this);
219
+ new JavascriptIndexPlugin(this);
220
+ new NavigationPlugin(this);
221
+ new SitemapPlugin(this);
222
+ }
227
223
  /**
228
224
  * Define a new theme that can be used to render output.
229
225
  * This API will likely be changing at some point, to allow more easily overriding parts of the theme without
@@ -244,25 +240,24 @@ let Renderer = (() => {
244
240
  * @param outputDirectory The path of the directory the documentation should be rendered to.
245
241
  */
246
242
  async render(project, outputDirectory) {
247
- (0, jsx_1.setRenderSettings)({ pretty: this.pretty });
243
+ setRenderSettings({ pretty: this.pretty });
248
244
  const momento = this.hooks.saveMomento();
249
245
  this.renderStartTime = Date.now();
250
246
  if (!this.prepareTheme() ||
251
247
  !(await this.prepareOutputDirectory(outputDirectory))) {
252
248
  return;
253
249
  }
254
- const output = new events_1.RendererEvent(outputDirectory, project);
250
+ const output = new RendererEvent(outputDirectory, project);
255
251
  output.urls = this.theme.getUrls(project);
256
- this.trigger(events_1.RendererEvent.BEGIN, output);
252
+ this.trigger(RendererEvent.BEGIN, output);
257
253
  await this.runPreRenderJobs(output);
258
254
  this.application.logger.verbose(`There are ${output.urls.length} pages to write.`);
259
255
  output.urls.forEach((mapping) => {
260
256
  this.renderDocument(...output.createPageEvent(mapping));
261
- (0, type_1.validateStateIsClean)(mapping.url);
262
257
  });
263
258
  await Promise.all(this.postRenderAsyncJobs.map((job) => job(output)));
264
259
  this.postRenderAsyncJobs = [];
265
- this.trigger(events_1.RendererEvent.END, output);
260
+ this.trigger(RendererEvent.END, output);
266
261
  this.theme = void 0;
267
262
  this.hooks.restoreMomento(momento);
268
263
  }
@@ -274,7 +269,7 @@ let Renderer = (() => {
274
269
  this.application.logger.verbose(`Pre render async jobs took ${Date.now() - start}ms`);
275
270
  }
276
271
  async loadHighlighter() {
277
- await (0, highlighter_1.loadHighlighter)(this.lightTheme, this.darkTheme,
272
+ await loadHighlighter(this.lightTheme, this.darkTheme,
278
273
  // Checked in option validation
279
274
  this.highlightLanguages);
280
275
  }
@@ -286,17 +281,17 @@ let Renderer = (() => {
286
281
  */
287
282
  renderDocument(template, page) {
288
283
  const momento = this.hooks.saveMomento();
289
- this.trigger(events_1.PageEvent.BEGIN, page);
290
- if (page.model instanceof models_1.Reflection) {
284
+ this.trigger(PageEvent.BEGIN, page);
285
+ if (page.model instanceof Reflection) {
291
286
  page.contents = this.theme.render(page, template);
292
287
  }
293
288
  else {
294
289
  throw new Error("Should be unreachable");
295
290
  }
296
- this.trigger(events_1.PageEvent.END, page);
291
+ this.trigger(PageEvent.END, page);
297
292
  this.hooks.restoreMomento(momento);
298
293
  try {
299
- (0, fs_1.writeFileSync)(page.filename, page.contents);
294
+ writeFileSync(page.filename, page.contents);
300
295
  }
301
296
  catch (error) {
302
297
  this.application.logger.error(this.application.i18n.could_not_write_0(page.filename));
@@ -368,56 +363,5 @@ let Renderer = (() => {
368
363
  return true;
369
364
  }
370
365
  };
371
- _Renderer_themeName_accessor_storage = new WeakMap();
372
- _Renderer_cleanOutputDir_accessor_storage = new WeakMap();
373
- _Renderer_cname_accessor_storage = new WeakMap();
374
- _Renderer_githubPages_accessor_storage = new WeakMap();
375
- _Renderer_cacheBust_accessor_storage = new WeakMap();
376
- _Renderer_lightTheme_accessor_storage = new WeakMap();
377
- _Renderer_darkTheme_accessor_storage = new WeakMap();
378
- _Renderer_highlightLanguages_accessor_storage = new WeakMap();
379
- _Renderer_pretty_accessor_storage = new WeakMap();
380
- __setFunctionName(_classThis, "Renderer");
381
- (() => {
382
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
383
- _themeName_decorators = [(0, utils_1.Option)("theme")];
384
- _cleanOutputDir_decorators = [(0, utils_1.Option)("cleanOutputDir")];
385
- _cname_decorators = [(0, utils_1.Option)("cname")];
386
- _githubPages_decorators = [(0, utils_1.Option)("githubPages")];
387
- _cacheBust_decorators = [(0, utils_1.Option)("cacheBust")];
388
- _lightTheme_decorators = [(0, utils_1.Option)("lightHighlightTheme")];
389
- _darkTheme_decorators = [(0, utils_1.Option)("darkHighlightTheme")];
390
- _highlightLanguages_decorators = [(0, utils_1.Option)("highlightLanguages")];
391
- _pretty_decorators = [(0, utils_1.Option)("pretty")];
392
- __esDecorate(_classThis, null, _themeName_decorators, { kind: "accessor", name: "themeName", static: false, private: false, access: { has: obj => "themeName" in obj, get: obj => obj.themeName, set: (obj, value) => { obj.themeName = value; } }, metadata: _metadata }, _themeName_initializers, _themeName_extraInitializers);
393
- __esDecorate(_classThis, null, _cleanOutputDir_decorators, { kind: "accessor", name: "cleanOutputDir", static: false, private: false, access: { has: obj => "cleanOutputDir" in obj, get: obj => obj.cleanOutputDir, set: (obj, value) => { obj.cleanOutputDir = value; } }, metadata: _metadata }, _cleanOutputDir_initializers, _cleanOutputDir_extraInitializers);
394
- __esDecorate(_classThis, null, _cname_decorators, { kind: "accessor", name: "cname", static: false, private: false, access: { has: obj => "cname" in obj, get: obj => obj.cname, set: (obj, value) => { obj.cname = value; } }, metadata: _metadata }, _cname_initializers, _cname_extraInitializers);
395
- __esDecorate(_classThis, null, _githubPages_decorators, { kind: "accessor", name: "githubPages", static: false, private: false, access: { has: obj => "githubPages" in obj, get: obj => obj.githubPages, set: (obj, value) => { obj.githubPages = value; } }, metadata: _metadata }, _githubPages_initializers, _githubPages_extraInitializers);
396
- __esDecorate(_classThis, null, _cacheBust_decorators, { kind: "accessor", name: "cacheBust", static: false, private: false, access: { has: obj => "cacheBust" in obj, get: obj => obj.cacheBust, set: (obj, value) => { obj.cacheBust = value; } }, metadata: _metadata }, _cacheBust_initializers, _cacheBust_extraInitializers);
397
- __esDecorate(_classThis, null, _lightTheme_decorators, { kind: "accessor", name: "lightTheme", static: false, private: false, access: { has: obj => "lightTheme" in obj, get: obj => obj.lightTheme, set: (obj, value) => { obj.lightTheme = value; } }, metadata: _metadata }, _lightTheme_initializers, _lightTheme_extraInitializers);
398
- __esDecorate(_classThis, null, _darkTheme_decorators, { kind: "accessor", name: "darkTheme", static: false, private: false, access: { has: obj => "darkTheme" in obj, get: obj => obj.darkTheme, set: (obj, value) => { obj.darkTheme = value; } }, metadata: _metadata }, _darkTheme_initializers, _darkTheme_extraInitializers);
399
- __esDecorate(_classThis, null, _highlightLanguages_decorators, { kind: "accessor", name: "highlightLanguages", static: false, private: false, access: { has: obj => "highlightLanguages" in obj, get: obj => obj.highlightLanguages, set: (obj, value) => { obj.highlightLanguages = value; } }, metadata: _metadata }, _highlightLanguages_initializers, _highlightLanguages_extraInitializers);
400
- __esDecorate(_classThis, null, _pretty_decorators, { kind: "accessor", name: "pretty", static: false, private: false, access: { has: obj => "pretty" in obj, get: obj => obj.pretty, set: (obj, value) => { obj.pretty = value; } }, metadata: _metadata }, _pretty_initializers, _pretty_extraInitializers);
401
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
402
- Renderer = _classThis = _classDescriptor.value;
403
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
404
- })();
405
- /** @event */
406
- _classThis.EVENT_BEGIN_PAGE = events_1.PageEvent.BEGIN;
407
- /** @event */
408
- _classThis.EVENT_END_PAGE = events_1.PageEvent.END;
409
- /** @event */
410
- _classThis.EVENT_BEGIN = events_1.RendererEvent.BEGIN;
411
- /** @event */
412
- _classThis.EVENT_END = events_1.RendererEvent.END;
413
- /** @event */
414
- _classThis.EVENT_PREPARE_INDEX = events_1.IndexEvent.PREPARE_INDEX;
415
- (() => {
416
- __runInitializers(_classThis, _classExtraInitializers);
417
- })();
418
- return Renderer = _classThis;
419
366
  })();
420
- exports.Renderer = Renderer;
421
- // HACK: THIS HAS TO STAY DOWN HERE
422
- // if you try to move it up to the top of the file, then you'll run into stuff being used before it has been defined.
423
- require("./plugins");
367
+ export { Renderer };
@@ -1,8 +1,9 @@
1
- import type { ProjectReflection } from "../models/reflections/project";
2
- import type { RenderTemplate, UrlMapping } from "./models/UrlMapping";
3
- import { RendererComponent } from "./components";
4
- import type { PageEvent } from "./events";
5
- import type { Reflection } from "../models";
1
+ import type { ProjectReflection } from "../models/reflections/project.js";
2
+ import type { RenderTemplate, UrlMapping } from "./models/UrlMapping.js";
3
+ import { RendererComponent } from "./components.js";
4
+ import type { PageEvent } from "./events.js";
5
+ import type { Reflection } from "../models/index.js";
6
+ import type { Slugger } from "./themes/default/Slugger.js";
6
7
  /**
7
8
  * Base class of all themes.
8
9
  *
@@ -12,6 +13,7 @@ import type { Reflection } from "../models";
12
13
  * {@link Renderer} to control and manipulate the output process.
13
14
  */
14
15
  export declare abstract class Theme extends RendererComponent {
16
+ private sluggers;
15
17
  /**
16
18
  * Map the models of the given project to the desired output files.
17
19
  * It is assumed that with the project structure:
@@ -33,4 +35,6 @@ export declare abstract class Theme extends RendererComponent {
33
35
  * Renders the provided page to a string, which will be written to disk by the {@link Renderer}
34
36
  */
35
37
  abstract render(page: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>): string;
38
+ setSlugger(reflection: Reflection, slugger: Slugger): void;
39
+ getSlugger(reflection: Reflection): Slugger;
36
40
  }
@@ -1,46 +1,4 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.Theme = void 0;
42
- const components_1 = require("./components");
43
- const component_1 = require("../utils/component");
1
+ import { RendererComponent } from "./components.js";
44
2
  /**
45
3
  * Base class of all themes.
46
4
  *
@@ -49,22 +7,16 @@ const component_1 = require("../utils/component");
49
7
  * and templates to use. Additionally themes can subscribe to the events emitted by
50
8
  * {@link Renderer} to control and manipulate the output process.
51
9
  */
52
- let Theme = (() => {
53
- let _classDecorators = [(0, component_1.Component)({ name: "theme", internal: true })];
54
- let _classDescriptor;
55
- let _classExtraInitializers = [];
56
- let _classThis;
57
- let _classSuper = components_1.RendererComponent;
58
- var Theme = _classThis = class extends _classSuper {
59
- };
60
- __setFunctionName(_classThis, "Theme");
61
- (() => {
62
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
63
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
- Theme = _classThis = _classDescriptor.value;
65
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
66
- __runInitializers(_classThis, _classExtraInitializers);
67
- })();
68
- return Theme = _classThis;
69
- })();
70
- exports.Theme = Theme;
10
+ export class Theme extends RendererComponent {
11
+ sluggers = new Map();
12
+ setSlugger(reflection, slugger) {
13
+ this.sluggers.set(reflection, slugger);
14
+ }
15
+ getSlugger(reflection) {
16
+ if (this.sluggers.has(reflection)) {
17
+ return this.sluggers.get(reflection);
18
+ }
19
+ // A slugger should always be defined at least for the project
20
+ return this.getSlugger(reflection.parent);
21
+ }
22
+ }