@xpack/doxygen2docusaurus 2.0.0 → 2.2.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 (365) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -1
  3. package/bin/doxygen2docusaurus.js +5 -5
  4. package/dist/cli/main.d.ts +0 -14
  5. package/dist/cli/main.d.ts.map +1 -1
  6. package/dist/cli/main.js +0 -34
  7. package/dist/cli/main.js.map +1 -1
  8. package/dist/docusaurus/cli-options.d.ts +3 -292
  9. package/dist/docusaurus/cli-options.d.ts.map +1 -1
  10. package/dist/docusaurus/cli-options.js +6 -290
  11. package/dist/docusaurus/cli-options.js.map +1 -1
  12. package/dist/docusaurus/generator.d.ts +0 -172
  13. package/dist/docusaurus/generator.d.ts.map +1 -1
  14. package/dist/docusaurus/generator.js +20 -280
  15. package/dist/docusaurus/generator.js.map +1 -1
  16. package/dist/docusaurus/renderers/conceptparts.d.ts +9 -0
  17. package/dist/docusaurus/renderers/conceptparts.d.ts.map +1 -0
  18. package/dist/docusaurus/renderers/conceptparts.js +21 -0
  19. package/dist/docusaurus/renderers/conceptparts.js.map +1 -0
  20. package/dist/docusaurus/renderers/descriptiontype.d.ts +0 -417
  21. package/dist/docusaurus/renderers/descriptiontype.d.ts.map +1 -1
  22. package/dist/docusaurus/renderers/descriptiontype.js +11 -555
  23. package/dist/docusaurus/renderers/descriptiontype.js.map +1 -1
  24. package/dist/docusaurus/renderers/docinternalstype.d.ts +0 -132
  25. package/dist/docusaurus/renderers/docinternalstype.d.ts.map +1 -1
  26. package/dist/docusaurus/renderers/docinternalstype.js +0 -156
  27. package/dist/docusaurus/renderers/docinternalstype.js.map +1 -1
  28. package/dist/docusaurus/renderers/doclisttype.d.ts +0 -22
  29. package/dist/docusaurus/renderers/doclisttype.d.ts.map +1 -1
  30. package/dist/docusaurus/renderers/doclisttype.js +0 -42
  31. package/dist/docusaurus/renderers/doclisttype.js.map +1 -1
  32. package/dist/docusaurus/renderers/doctabletype.d.ts +0 -88
  33. package/dist/docusaurus/renderers/doctabletype.d.ts.map +1 -1
  34. package/dist/docusaurus/renderers/doctabletype.js +1 -113
  35. package/dist/docusaurus/renderers/doctabletype.js.map +1 -1
  36. package/dist/docusaurus/renderers/doctitletype.d.ts +0 -22
  37. package/dist/docusaurus/renderers/doctitletype.d.ts.map +1 -1
  38. package/dist/docusaurus/renderers/doctitletype.js +0 -42
  39. package/dist/docusaurus/renderers/doctitletype.js.map +1 -1
  40. package/dist/docusaurus/renderers/docvariablelisttype.d.ts +0 -44
  41. package/dist/docusaurus/renderers/docvariablelisttype.d.ts.map +1 -1
  42. package/dist/docusaurus/renderers/docvariablelisttype.js +1 -69
  43. package/dist/docusaurus/renderers/docvariablelisttype.js.map +1 -1
  44. package/dist/docusaurus/renderers/docxrefsecttype.d.ts +0 -22
  45. package/dist/docusaurus/renderers/docxrefsecttype.d.ts.map +1 -1
  46. package/dist/docusaurus/renderers/docxrefsecttype.js +0 -38
  47. package/dist/docusaurus/renderers/docxrefsecttype.js.map +1 -1
  48. package/dist/docusaurus/renderers/element-renderer-base.d.ts +0 -74
  49. package/dist/docusaurus/renderers/element-renderer-base.d.ts.map +1 -1
  50. package/dist/docusaurus/renderers/element-renderer-base.js +0 -64
  51. package/dist/docusaurus/renderers/element-renderer-base.js.map +1 -1
  52. package/dist/docusaurus/renderers/inctype.d.ts +0 -23
  53. package/dist/docusaurus/renderers/inctype.d.ts.map +1 -1
  54. package/dist/docusaurus/renderers/inctype.js +0 -41
  55. package/dist/docusaurus/renderers/inctype.js.map +1 -1
  56. package/dist/docusaurus/renderers/linkedtexttype.d.ts +0 -22
  57. package/dist/docusaurus/renderers/linkedtexttype.d.ts.map +1 -1
  58. package/dist/docusaurus/renderers/linkedtexttype.js +0 -45
  59. package/dist/docusaurus/renderers/linkedtexttype.js.map +1 -1
  60. package/dist/docusaurus/renderers/listingtype.d.ts +0 -52
  61. package/dist/docusaurus/renderers/listingtype.d.ts.map +1 -1
  62. package/dist/docusaurus/renderers/listingtype.js +1 -88
  63. package/dist/docusaurus/renderers/listingtype.js.map +1 -1
  64. package/dist/docusaurus/renderers/paramtype.d.ts +0 -22
  65. package/dist/docusaurus/renderers/paramtype.d.ts.map +1 -1
  66. package/dist/docusaurus/renderers/paramtype.js +2 -51
  67. package/dist/docusaurus/renderers/paramtype.js.map +1 -1
  68. package/dist/docusaurus/renderers/referencetype.d.ts +0 -23
  69. package/dist/docusaurus/renderers/referencetype.d.ts.map +1 -1
  70. package/dist/docusaurus/renderers/referencetype.js +0 -38
  71. package/dist/docusaurus/renderers/referencetype.js.map +1 -1
  72. package/dist/docusaurus/renderers/reftexttype.d.ts +0 -22
  73. package/dist/docusaurus/renderers/reftexttype.d.ts.map +1 -1
  74. package/dist/docusaurus/renderers/reftexttype.js +0 -38
  75. package/dist/docusaurus/renderers/reftexttype.js.map +1 -1
  76. package/dist/docusaurus/renderers/reftype.d.ts +0 -22
  77. package/dist/docusaurus/renderers/reftype.d.ts.map +1 -1
  78. package/dist/docusaurus/renderers/reftype.js +0 -38
  79. package/dist/docusaurus/renderers/reftype.js.map +1 -1
  80. package/dist/docusaurus/renderers/renderers.d.ts +0 -151
  81. package/dist/docusaurus/renderers/renderers.d.ts.map +1 -1
  82. package/dist/docusaurus/renderers/renderers.js +15 -186
  83. package/dist/docusaurus/renderers/renderers.js.map +1 -1
  84. package/dist/docusaurus/renderers/substringtype.d.ts +0 -22
  85. package/dist/docusaurus/renderers/substringtype.d.ts.map +1 -1
  86. package/dist/docusaurus/renderers/substringtype.js +0 -39
  87. package/dist/docusaurus/renderers/substringtype.js.map +1 -1
  88. package/dist/docusaurus/renderers/tableofcontentstype.d.ts +0 -22
  89. package/dist/docusaurus/renderers/tableofcontentstype.d.ts.map +1 -1
  90. package/dist/docusaurus/renderers/tableofcontentstype.js +0 -39
  91. package/dist/docusaurus/renderers/tableofcontentstype.js.map +1 -1
  92. package/dist/docusaurus/types.d.ts +0 -110
  93. package/dist/docusaurus/types.d.ts.map +1 -1
  94. package/dist/docusaurus/types.js +0 -11
  95. package/dist/docusaurus/types.js.map +1 -1
  96. package/dist/docusaurus/utils.d.ts +0 -214
  97. package/dist/docusaurus/utils.d.ts.map +1 -1
  98. package/dist/docusaurus/utils.js +0 -296
  99. package/dist/docusaurus/utils.js.map +1 -1
  100. package/dist/docusaurus/view-model/classes-vm.d.ts +0 -137
  101. package/dist/docusaurus/view-model/classes-vm.d.ts.map +1 -1
  102. package/dist/docusaurus/view-model/classes-vm.js +9 -225
  103. package/dist/docusaurus/view-model/classes-vm.js.map +1 -1
  104. package/dist/docusaurus/view-model/collection-base.d.ts +0 -120
  105. package/dist/docusaurus/view-model/collection-base.d.ts.map +1 -1
  106. package/dist/docusaurus/view-model/collection-base.js +11 -101
  107. package/dist/docusaurus/view-model/collection-base.js.map +1 -1
  108. package/dist/docusaurus/view-model/compound-base-vm.d.ts +2 -147
  109. package/dist/docusaurus/view-model/compound-base-vm.d.ts.map +1 -1
  110. package/dist/docusaurus/view-model/compound-base-vm.js +47 -225
  111. package/dist/docusaurus/view-model/compound-base-vm.js.map +1 -1
  112. package/dist/docusaurus/view-model/concepts-vm.d.ts +27 -0
  113. package/dist/docusaurus/view-model/concepts-vm.d.ts.map +1 -0
  114. package/dist/docusaurus/view-model/concepts-vm.js +337 -0
  115. package/dist/docusaurus/view-model/concepts-vm.js.map +1 -0
  116. package/dist/docusaurus/view-model/description-anchors.d.ts +0 -58
  117. package/dist/docusaurus/view-model/description-anchors.d.ts.map +1 -1
  118. package/dist/docusaurus/view-model/description-anchors.js +0 -71
  119. package/dist/docusaurus/view-model/description-anchors.js.map +1 -1
  120. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts +0 -247
  121. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts.map +1 -1
  122. package/dist/docusaurus/view-model/files-and-folders-vm.js +61 -353
  123. package/dist/docusaurus/view-model/files-and-folders-vm.js.map +1 -1
  124. package/dist/docusaurus/view-model/groups-vm.d.ts +0 -148
  125. package/dist/docusaurus/view-model/groups-vm.d.ts.map +1 -1
  126. package/dist/docusaurus/view-model/groups-vm.js +2 -223
  127. package/dist/docusaurus/view-model/groups-vm.js.map +1 -1
  128. package/dist/docusaurus/view-model/members-vm.d.ts +0 -552
  129. package/dist/docusaurus/view-model/members-vm.d.ts.map +1 -1
  130. package/dist/docusaurus/view-model/members-vm.js +17 -702
  131. package/dist/docusaurus/view-model/members-vm.js.map +1 -1
  132. package/dist/docusaurus/view-model/namespaces-vm.d.ts +5 -199
  133. package/dist/docusaurus/view-model/namespaces-vm.d.ts.map +1 -1
  134. package/dist/docusaurus/view-model/namespaces-vm.js +85 -284
  135. package/dist/docusaurus/view-model/namespaces-vm.js.map +1 -1
  136. package/dist/docusaurus/view-model/options.d.ts +0 -43
  137. package/dist/docusaurus/view-model/options.d.ts.map +1 -1
  138. package/dist/docusaurus/view-model/options.js +0 -57
  139. package/dist/docusaurus/view-model/options.js.map +1 -1
  140. package/dist/docusaurus/view-model/pages-vm.d.ts +0 -115
  141. package/dist/docusaurus/view-model/pages-vm.d.ts.map +1 -1
  142. package/dist/docusaurus/view-model/pages-vm.js +39 -162
  143. package/dist/docusaurus/view-model/pages-vm.js.map +1 -1
  144. package/dist/docusaurus/view-model/tree-entries-vm.d.ts +8 -142
  145. package/dist/docusaurus/view-model/tree-entries-vm.d.ts.map +1 -1
  146. package/dist/docusaurus/view-model/tree-entries-vm.js +54 -174
  147. package/dist/docusaurus/view-model/tree-entries-vm.js.map +1 -1
  148. package/dist/docusaurus/view-model/view-model.d.ts +0 -125
  149. package/dist/docusaurus/view-model/view-model.d.ts.map +1 -1
  150. package/dist/docusaurus/view-model/view-model.js +20 -182
  151. package/dist/docusaurus/view-model/view-model.js.map +1 -1
  152. package/dist/docusaurus/workspace.d.ts +1 -126
  153. package/dist/docusaurus/workspace.d.ts.map +1 -1
  154. package/dist/docusaurus/workspace.js +8 -221
  155. package/dist/docusaurus/workspace.js.map +1 -1
  156. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts +7 -492
  157. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts.map +1 -1
  158. package/dist/doxygen/data-model/compounds/compounddef-dm.js +28 -672
  159. package/dist/doxygen/data-model/compounds/compounddef-dm.js.map +1 -1
  160. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts +0 -129
  161. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts.map +1 -1
  162. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js +1 -145
  163. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js.map +1 -1
  164. package/dist/doxygen/data-model/compounds/concepts-dm.d.ts +23 -0
  165. package/dist/doxygen/data-model/compounds/concepts-dm.d.ts.map +1 -0
  166. package/dist/doxygen/data-model/compounds/concepts-dm.js +94 -0
  167. package/dist/doxygen/data-model/compounds/concepts-dm.js.map +1 -0
  168. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts +104 -2848
  169. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts.map +1 -1
  170. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js +73 -3975
  171. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js.map +1 -1
  172. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts +0 -165
  173. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts.map +1 -1
  174. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js +0 -229
  175. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js.map +1 -1
  176. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts +0 -70
  177. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts.map +1 -1
  178. package/dist/doxygen/data-model/compounds/doxygentype-dm.js +0 -105
  179. package/dist/doxygen/data-model/compounds/doxygentype-dm.js.map +1 -1
  180. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts +0 -84
  181. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts.map +1 -1
  182. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js +1 -122
  183. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js.map +1 -1
  184. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts +0 -116
  185. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts.map +1 -1
  186. package/dist/doxygen/data-model/compounds/inctype-dm.js +3 -155
  187. package/dist/doxygen/data-model/compounds/inctype-dm.js.map +1 -1
  188. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts +3 -138
  189. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts.map +1 -1
  190. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js +5 -180
  191. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js.map +1 -1
  192. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts +0 -76
  193. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts.map +1 -1
  194. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js +0 -107
  195. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js.map +1 -1
  196. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts +0 -162
  197. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts.map +1 -1
  198. package/dist/doxygen/data-model/compounds/locationtype-dm.js +4 -203
  199. package/dist/doxygen/data-model/compounds/locationtype-dm.js.map +1 -1
  200. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts +2 -443
  201. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts.map +1 -1
  202. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js +19 -475
  203. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js.map +1 -1
  204. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts +0 -141
  205. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts.map +1 -1
  206. package/dist/doxygen/data-model/compounds/memberreftype-dm.js +0 -176
  207. package/dist/doxygen/data-model/compounds/memberreftype-dm.js.map +1 -1
  208. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts +0 -101
  209. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts.map +1 -1
  210. package/dist/doxygen/data-model/compounds/membertype-dm.js +0 -115
  211. package/dist/doxygen/data-model/compounds/membertype-dm.js.map +1 -1
  212. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts +0 -164
  213. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts.map +1 -1
  214. package/dist/doxygen/data-model/compounds/paramtype-dm.js +0 -208
  215. package/dist/doxygen/data-model/compounds/paramtype-dm.js.map +1 -1
  216. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts +0 -139
  217. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts.map +1 -1
  218. package/dist/doxygen/data-model/compounds/referencetype-dm.js +2 -175
  219. package/dist/doxygen/data-model/compounds/referencetype-dm.js.map +1 -1
  220. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts +0 -120
  221. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts.map +1 -1
  222. package/dist/doxygen/data-model/compounds/reftexttype-dm.js +2 -141
  223. package/dist/doxygen/data-model/compounds/reftexttype-dm.js.map +1 -1
  224. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts +0 -268
  225. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts.map +1 -1
  226. package/dist/doxygen/data-model/compounds/reftype-dm.js +4 -326
  227. package/dist/doxygen/data-model/compounds/reftype-dm.js.map +1 -1
  228. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts +0 -105
  229. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts.map +1 -1
  230. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js +1 -139
  231. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js.map +1 -1
  232. package/dist/doxygen/data-model/compounds/requirements-dm.d.ts +2 -0
  233. package/dist/doxygen/data-model/compounds/requirements-dm.d.ts.map +1 -0
  234. package/dist/doxygen/data-model/compounds/requirements-dm.js +2 -0
  235. package/dist/doxygen/data-model/compounds/requirements-dm.js.map +1 -0
  236. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts +0 -168
  237. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts.map +1 -1
  238. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js +0 -209
  239. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js.map +1 -1
  240. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts +0 -267
  241. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts.map +1 -1
  242. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js +0 -354
  243. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js.map +1 -1
  244. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts +0 -66
  245. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts.map +1 -1
  246. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js +0 -97
  247. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js.map +1 -1
  248. package/dist/doxygen/data-model/data-model.d.ts +0 -149
  249. package/dist/doxygen/data-model/data-model.d.ts.map +1 -1
  250. package/dist/doxygen/data-model/data-model.js +8 -200
  251. package/dist/doxygen/data-model/data-model.js.map +1 -1
  252. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts +0 -115
  253. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts.map +1 -1
  254. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js +4 -129
  255. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js.map +1 -1
  256. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts +0 -87
  257. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts.map +1 -1
  258. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js +0 -118
  259. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js.map +1 -1
  260. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts +0 -253
  261. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts.map +1 -1
  262. package/dist/doxygen/data-model/doxygen-xml-parser.js +0 -291
  263. package/dist/doxygen/data-model/doxygen-xml-parser.js.map +1 -1
  264. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts +0 -98
  265. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts.map +1 -1
  266. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js +2 -122
  267. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js.map +1 -1
  268. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts +0 -82
  269. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts.map +1 -1
  270. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js +0 -114
  271. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js.map +1 -1
  272. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts +0 -85
  273. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts.map +1 -1
  274. package/dist/doxygen/data-model/index/indexmembertype-dm.js +1 -107
  275. package/dist/doxygen/data-model/index/indexmembertype-dm.js.map +1 -1
  276. package/dist/doxygen/data-model/types.d.ts +0 -104
  277. package/dist/doxygen/data-model/types.d.ts.map +1 -1
  278. package/dist/doxygen/data-model/types.js +0 -52
  279. package/dist/doxygen/data-model/types.js.map +1 -1
  280. package/dist/index.d.ts +5 -16
  281. package/dist/index.d.ts.map +1 -1
  282. package/dist/index.js +5 -42
  283. package/dist/index.js.map +1 -1
  284. package/package.json +49 -52
  285. package/src/cli/main.ts +122 -0
  286. package/src/docusaurus/cli-options.ts +560 -0
  287. package/src/docusaurus/generator.ts +788 -0
  288. package/src/docusaurus/renderers/conceptparts.ts +119 -0
  289. package/src/docusaurus/renderers/descriptiontype.ts +1299 -0
  290. package/src/docusaurus/renderers/docinternalstype.ts +354 -0
  291. package/src/docusaurus/renderers/doclisttype.ts +134 -0
  292. package/src/docusaurus/renderers/doctabletype.ts +220 -0
  293. package/src/docusaurus/renderers/doctitletype.ts +77 -0
  294. package/src/docusaurus/renderers/docvariablelisttype.ts +123 -0
  295. package/src/docusaurus/renderers/docxrefsecttype.ts +84 -0
  296. package/src/docusaurus/renderers/element-renderer-base.ts +112 -0
  297. package/src/docusaurus/renderers/inctype.ts +75 -0
  298. package/src/docusaurus/renderers/linkedtexttype.ts +64 -0
  299. package/src/docusaurus/renderers/listingtype.ts +235 -0
  300. package/src/docusaurus/renderers/paramtype.ts +116 -0
  301. package/src/docusaurus/renderers/referencetype.ts +83 -0
  302. package/src/docusaurus/renderers/reftexttype.ts +81 -0
  303. package/src/docusaurus/renderers/reftype.ts +77 -0
  304. package/src/docusaurus/renderers/renderers.ts +812 -0
  305. package/src/docusaurus/renderers/substringtype.ts +53 -0
  306. package/src/docusaurus/renderers/tableofcontentstype.ts +74 -0
  307. package/src/docusaurus/types.ts +187 -0
  308. package/src/docusaurus/utils.ts +409 -0
  309. package/src/docusaurus/view-model/README.md +12 -0
  310. package/src/docusaurus/view-model/classes-vm.ts +1088 -0
  311. package/src/docusaurus/view-model/collection-base.ts +352 -0
  312. package/src/docusaurus/view-model/compound-base-vm.ts +1340 -0
  313. package/src/docusaurus/view-model/concepts-vm.ts +749 -0
  314. package/src/docusaurus/view-model/description-anchors.ts +107 -0
  315. package/src/docusaurus/view-model/files-and-folders-vm.ts +1293 -0
  316. package/src/docusaurus/view-model/groups-vm.ts +548 -0
  317. package/src/docusaurus/view-model/members-vm.ts +1943 -0
  318. package/src/docusaurus/view-model/namespaces-vm.ts +1037 -0
  319. package/src/docusaurus/view-model/options.ts +95 -0
  320. package/src/docusaurus/view-model/pages-vm.ts +389 -0
  321. package/src/docusaurus/view-model/tree-entries-vm.ts +376 -0
  322. package/src/docusaurus/view-model/view-model.ts +513 -0
  323. package/src/docusaurus/workspace.ts +588 -0
  324. package/src/doxygen/data-model/README.md +13 -0
  325. package/src/doxygen/data-model/compounds/compounddef-dm.ts +1230 -0
  326. package/src/doxygen/data-model/compounds/compoundreftype-dm.ts +266 -0
  327. package/src/doxygen/data-model/compounds/concepts-dm.ts +362 -0
  328. package/src/doxygen/data-model/compounds/descriptiontype-dm.ts +10114 -0
  329. package/src/doxygen/data-model/compounds/docvarlistentrytype-dm.ts +354 -0
  330. package/src/doxygen/data-model/compounds/doxygentype-dm.ts +187 -0
  331. package/src/doxygen/data-model/compounds/enumvaluetype-dm.ts +218 -0
  332. package/src/doxygen/data-model/compounds/inctype-dm.ts +217 -0
  333. package/src/doxygen/data-model/compounds/linkedtexttype-dm.ts +288 -0
  334. package/src/doxygen/data-model/compounds/listofallmemberstype-dm.ts +160 -0
  335. package/src/doxygen/data-model/compounds/locationtype-dm.ts +284 -0
  336. package/src/doxygen/data-model/compounds/memberdeftype-dm.ts +881 -0
  337. package/src/doxygen/data-model/compounds/memberreftype-dm.ts +270 -0
  338. package/src/doxygen/data-model/compounds/membertype-dm.ts +239 -0
  339. package/src/doxygen/data-model/compounds/paramtype-dm.ts +302 -0
  340. package/src/doxygen/data-model/compounds/referencetype-dm.ts +248 -0
  341. package/src/doxygen/data-model/compounds/reftexttype-dm.ts +234 -0
  342. package/src/doxygen/data-model/compounds/reftype-dm.ts +430 -0
  343. package/src/doxygen/data-model/compounds/reimplementtype-dm.ts +201 -0
  344. package/src/doxygen/data-model/compounds/requirements-dm.ts +50 -0
  345. package/src/doxygen/data-model/compounds/sectiondeftype-dm.ts +330 -0
  346. package/src/doxygen/data-model/compounds/tableofcontentstype-dm.ts +564 -0
  347. package/src/doxygen/data-model/compounds/templateparamlisttype-dm.ts +150 -0
  348. package/src/doxygen/data-model/data-model.ts +378 -0
  349. package/src/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.ts +271 -0
  350. package/src/doxygen/data-model/doxyfile/doxyfiletype-dm.ts +200 -0
  351. package/src/doxygen/data-model/doxygen-xml-parser.ts +522 -0
  352. package/src/doxygen/data-model/index/indexcompoundtype-dm.ts +256 -0
  353. package/src/doxygen/data-model/index/indexdoxygentype-dm.ts +196 -0
  354. package/src/doxygen/data-model/index/indexmembertype-dm.ts +230 -0
  355. package/src/doxygen/data-model/types.ts +175 -0
  356. package/src/doxygen/data-model/xsds/README.md +6 -0
  357. package/src/doxygen/data-model/xsds/compound.xsd +1788 -0
  358. package/src/doxygen/data-model/xsds/doxyfile.xsd +365 -0
  359. package/src/doxygen/data-model/xsds/index.xsd +74 -0
  360. package/src/doxygen/data-model/xsds/xml.xsd +23 -0
  361. package/src/index.ts +267 -0
  362. package/src/tsconfig.json +12 -0
  363. package/dist/doxygen2docusaurus.d.ts +0 -4774
  364. package/dist/tsconfig.tsbuildinfo +0 -1
  365. package/dist/tsdoc-metadata.json +0 -11
@@ -0,0 +1,1340 @@
1
+ /*
2
+ * This file is part of the xPack project (http://xpack.github.io).
3
+ * Copyright (c) 2025-2026 Liviu Ionescu. All rights reserved.
4
+ *
5
+ * Permission to use, copy, modify, and/or distribute this software for any
6
+ * purpose is hereby granted, under the terms of the MIT license.
7
+ *
8
+ * If a copy of the license was not distributed with this file, it can be
9
+ * obtained from https://opensource.org/licenses/mit.
10
+ */
11
+
12
+ // ----------------------------------------------------------------------------
13
+
14
+ // import * as util from 'node:util'
15
+ import assert from 'node:assert'
16
+ import path from 'node:path'
17
+
18
+ import type { FrontMatter } from '../types.js'
19
+ import { ParaDataModel } from '../../doxygen/data-model/compounds/descriptiontype-dm.js'
20
+ import type { CollectionBase } from './collection-base.js'
21
+ import type { AbstractRefType } from '../../doxygen/data-model/compounds/reftype-dm.js'
22
+ import { joinWithLast, sanitizeAnonymousNamespace } from '../utils.js'
23
+ import { Section } from './members-vm.js'
24
+ import type { TemplateParamListDataModel } from '../../doxygen/data-model/compounds/templateparamlisttype-dm.js'
25
+ import { RefTextDataModel } from '../../doxygen/data-model/compounds/reftexttype-dm.js'
26
+ import type { DefValDataModel } from '../../doxygen/data-model/compounds/linkedtexttype-dm.js'
27
+ import type { LocationDataModel } from '../../doxygen/data-model/compounds/locationtype-dm.js'
28
+ import type { CompoundDefDataModel } from '../../doxygen/data-model/compounds/compounddef-dm.js'
29
+ import type { IncludesDataModel } from '../../doxygen/data-model/compounds/inctype-dm.js'
30
+ import {
31
+ SectionDefByKindDataModel,
32
+ type SectionDefDataModel,
33
+ } from '../../doxygen/data-model/compounds/sectiondeftype-dm.js'
34
+ import type { AbstractMemberBaseType } from '../../doxygen/data-model/compounds/memberdeftype-dm.js'
35
+ import type {
36
+ ReferenceDataModel,
37
+ ReferencedByDataModel,
38
+ } from '../../doxygen/data-model/compounds/referencetype-dm.js'
39
+ import { Concept } from './concepts-vm.js'
40
+
41
+ // ----------------------------------------------------------------------------
42
+
43
+ /**
44
+ * Abstract base class for all compound documentation objects.
45
+ *
46
+ * The CompoundBase class provides common functionality and structure for
47
+ * all types of documentation compounds (classes, files, namespaces, etc.),
48
+ * including rendering, navigation, and metadata management.
49
+ *
50
+ * @public
51
+ */
52
+ export abstract class CompoundBase {
53
+ /** The Doxygen compound kind (class, file, namespace, etc.). */
54
+ kind = ''
55
+
56
+ /** The display name of the compound. */
57
+ compoundName = ''
58
+
59
+ /** Unique identifier for the compound. */
60
+ id = ''
61
+
62
+ /** The collection this compound belongs to. */
63
+ collection: CollectionBase
64
+
65
+ /** HTML-rendered title string for display purposes. */
66
+ titleHtmlString: string | undefined
67
+
68
+ /** File path where the compound is located in the source. */
69
+ locationFilePath: string | undefined
70
+
71
+ // --------------------------------------------------------------------------
72
+
73
+ /** Parent compound in the hierarchy (not used for classes). */
74
+ parent?: CompoundBase
75
+
76
+ /**
77
+ * Array of child compound identifiers for two-step initialisation.
78
+ *
79
+ * Set in 2 steps, first the Ids and then, when all objects are in,
80
+ * the references.
81
+ * Folder objects use separate arrays for files and folders children.
82
+ */
83
+ childrenIds: string[] = []
84
+
85
+ /** Array of resolved child compound instances. */
86
+ children: CompoundBase[] = []
87
+
88
+ /**
89
+ * Short name for sidebar display within limited space.
90
+ * If undefined, the compound is excluded from the sidebar.
91
+ */
92
+ sidebarLabel: string | undefined
93
+
94
+ /**
95
+ * Relative path to the output folder starting with plural kind.
96
+ * If undefined, the compound is excluded from the sidebar.
97
+ */
98
+ sidebarId: string | undefined
99
+
100
+ /**
101
+ * Relative permalink below outputFolderPath without leading slash.
102
+ * If undefined, no Markdown file is generated for the compound.
103
+ */
104
+ relativePermalink: string | undefined
105
+
106
+ /** The name shown in the index section. */
107
+ indexName = ''
108
+
109
+ /** The name used in tree entries for top-level index pages. */
110
+ treeEntryName = ''
111
+
112
+ /** The name shown in the page title. */
113
+ pageTitle = ''
114
+
115
+ /** HTML-rendered brief description for display purposes. */
116
+ briefDescriptionHtmlString: string | undefined
117
+ /** HTML-rendered detailed description lines for full documentation. */
118
+ detailedDescriptionHtmlLines: string[] | undefined
119
+
120
+ /** Flag indicating if detailed description contains sect1 elements. */
121
+ hasSect1InDescription = false
122
+
123
+ /** Location information lines for rendering file/line references. */
124
+ locationLines: string[] | undefined
125
+
126
+ /** Array of member sections organised by type and visibility. */
127
+ sections: Section[] = []
128
+
129
+ /** Set of unique file locations for this compound. */
130
+ locationSet = new Set<string>()
131
+
132
+ /** Array of include directives for this compound. */
133
+ includes: IncludesDataModel[] | undefined
134
+
135
+ /** Map of inner compounds organised by type. */
136
+ innerCompounds: Map<string, CompoundDefDataModel> | undefined
137
+
138
+ /** Private data storage for internal compound definition reference. */
139
+ _private: {
140
+ /** Reference to the source data model object. */
141
+ _compoundDef?: CompoundDefDataModel | undefined
142
+ } = {}
143
+
144
+ // --------------------------------------------------------------------------
145
+
146
+ /**
147
+ * Creates a new compound base instance from definition data.
148
+ *
149
+ * @remarks
150
+ * Initialises the basic compound properties including kind, name,
151
+ * identifier, and optional title and location information. Sets up
152
+ * the collection reference and processes HTML rendering for titles.
153
+ *
154
+ * @param collection - The parent collection managing this compound
155
+ * @param compoundDef - The Doxygen compound definition containing source data
156
+ */
157
+ constructor(collection: CollectionBase, compoundDef: CompoundDefDataModel) {
158
+ this._private._compoundDef = compoundDef
159
+
160
+ this.collection = collection
161
+
162
+ const { kind, compoundName, id } = compoundDef
163
+ this.kind = kind
164
+ this.compoundName = sanitizeAnonymousNamespace(compoundName)
165
+ this.id = id
166
+
167
+ if (compoundDef.title !== undefined) {
168
+ this.titleHtmlString = this.collection.workspace.renderString(
169
+ compoundDef.title,
170
+ 'html'
171
+ )
172
+ }
173
+
174
+ if (compoundDef.location?.file !== undefined) {
175
+ const { file } = compoundDef.location
176
+ this.locationFilePath = file
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Creates and organises member sections for the compound.
182
+ *
183
+ * @remarks
184
+ * Processes section definitions from the compound data model,
185
+ * reorders them by type and visibility, and creates Section
186
+ * instances for rendering. Sorts sections according to their
187
+ * logical display order.
188
+ *
189
+ * @param classUnqualifiedName - Optional class name for special method
190
+ * detection
191
+ */
192
+ createSections(classUnqualifiedName?: string): void {
193
+ const reorderedSectionDefs = this.reorderSectionDefs(classUnqualifiedName)
194
+
195
+ if (reorderedSectionDefs !== undefined) {
196
+ const sections: Section[] = []
197
+ for (const sectionDef of reorderedSectionDefs) {
198
+ sections.push(new Section(this, sectionDef))
199
+ }
200
+ this.sections = sections.sort(
201
+ (a, b) => a.getSectionOrderByKind() - b.getSectionOrderByKind()
202
+ )
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Reorders section definitions by member type and adjusts section kinds.
208
+ *
209
+ * @remarks
210
+ * Processes member definitions and groups them by adjusted section
211
+ * kinds, handling user-defined sections separately. Creates new
212
+ * section definitions organised by member types for consistent
213
+ * display ordering.
214
+ *
215
+ * @param classUnqualifiedName - Optional class name for special method
216
+ * detection
217
+ * @returns Array of reordered section definitions or undefined if none exist
218
+ */
219
+ private reorderSectionDefs(
220
+ classUnqualifiedName?: string
221
+ ): SectionDefDataModel[] | undefined {
222
+ const sectionDefs = this._private._compoundDef?.sectionDefs
223
+ if (sectionDefs === undefined) {
224
+ return undefined
225
+ }
226
+
227
+ const resultSectionDefs: SectionDefDataModel[] = []
228
+ const sectionDefsByKind = new Map<string, SectionDefDataModel>()
229
+
230
+ for (const sectionDef of sectionDefs) {
231
+ if (
232
+ sectionDef.kind === 'user-defined' &&
233
+ sectionDef.header !== undefined
234
+ ) {
235
+ resultSectionDefs.push(sectionDef)
236
+ continue
237
+ }
238
+
239
+ if (sectionDef.memberDefs !== undefined) {
240
+ for (const memberDef of sectionDef.memberDefs) {
241
+ const adjustedSectionKind: string = this.adjustSectionKind(
242
+ sectionDef,
243
+ memberDef,
244
+ classUnqualifiedName
245
+ )
246
+
247
+ let mapSectionDef = sectionDefsByKind.get(adjustedSectionKind)
248
+ if (mapSectionDef === undefined) {
249
+ mapSectionDef = new SectionDefByKindDataModel(adjustedSectionKind)
250
+ sectionDefsByKind.set(adjustedSectionKind, mapSectionDef)
251
+ }
252
+ mapSectionDef.memberDefs ??= []
253
+ mapSectionDef.memberDefs.push(memberDef)
254
+ }
255
+ }
256
+
257
+ if (sectionDef.members !== undefined) {
258
+ for (const member of sectionDef.members) {
259
+ const adjustedSectionKind: string = this.adjustSectionKind(
260
+ sectionDef,
261
+ member,
262
+ classUnqualifiedName
263
+ )
264
+
265
+ let mapSectionDef = sectionDefsByKind.get(adjustedSectionKind)
266
+ if (mapSectionDef === undefined) {
267
+ mapSectionDef = new SectionDefByKindDataModel(adjustedSectionKind)
268
+ sectionDefsByKind.set(adjustedSectionKind, mapSectionDef)
269
+ }
270
+ mapSectionDef.members ??= []
271
+ mapSectionDef.members.push(member)
272
+ }
273
+ }
274
+ }
275
+
276
+ resultSectionDefs.push(...sectionDefsByKind.values())
277
+ return resultSectionDefs
278
+ }
279
+
280
+ // <xsd:simpleType name="DoxMemberKind">
281
+ // <xsd:restriction base="xsd:string">
282
+ // <xsd:enumeration value="define" />
283
+ // <xsd:enumeration value="property" />
284
+ // <xsd:enumeration value="event" />
285
+ // <xsd:enumeration value="variable" />
286
+ // <xsd:enumeration value="typedef" />
287
+ // <xsd:enumeration value="enum" />
288
+ // <xsd:enumeration value="function" />
289
+ // <xsd:enumeration value="signal" />
290
+ // <xsd:enumeration value="prototype" />
291
+ // <xsd:enumeration value="friend" />
292
+ // <xsd:enumeration value="dcop" />
293
+ // <xsd:enumeration value="slot" />
294
+ // <xsd:enumeration value="interface" />
295
+ // <xsd:enumeration value="service" />
296
+ // </xsd:restriction>
297
+ // </xsd:simpleType>
298
+
299
+ /**
300
+ * Adjusts section kind based on member type and context.
301
+ *
302
+ * @remarks
303
+ * Maps member kinds to appropriate section categories, handling
304
+ * special cases like operators, constructors, destructors, and
305
+ * various member types. Preserves visibility prefixes and applies
306
+ * context-specific adjustments.
307
+ *
308
+ * @param sectionDef - The section definition containing the member
309
+ * @param memberBase - The member whose section kind needs adjustment
310
+ * @param classUnqualifiedName - Optional class name for special method
311
+ * detection
312
+ * @returns The adjusted section kind string
313
+ */
314
+ private adjustSectionKind(
315
+ sectionDef: SectionDefDataModel,
316
+ memberBase: AbstractMemberBaseType,
317
+ classUnqualifiedName: string | undefined
318
+ ): string {
319
+ // In general, adjust to member kind.
320
+ let adjustedSectionKind: string = memberBase.kind
321
+
322
+ switch (memberBase.kind) {
323
+ case 'function':
324
+ // If public/protected/private, preserve the prefix.
325
+ if (this.isOperator(memberBase.name)) {
326
+ adjustedSectionKind = sectionDef.computeAdjustedKind('operator')
327
+ } else if (classUnqualifiedName !== undefined) {
328
+ if (memberBase.name === classUnqualifiedName) {
329
+ adjustedSectionKind = sectionDef.computeAdjustedKind('constructorr')
330
+ } else if (
331
+ memberBase.name.replace('~', '') === classUnqualifiedName
332
+ ) {
333
+ adjustedSectionKind = sectionDef.computeAdjustedKind('destructor')
334
+ } else {
335
+ adjustedSectionKind = sectionDef.computeAdjustedKind(
336
+ 'func',
337
+ 'function'
338
+ )
339
+ }
340
+ } else {
341
+ adjustedSectionKind = sectionDef.computeAdjustedKind(
342
+ 'func',
343
+ 'function'
344
+ )
345
+ }
346
+ break
347
+
348
+ case 'variable':
349
+ adjustedSectionKind = sectionDef.computeAdjustedKind(
350
+ 'attrib',
351
+ 'variable'
352
+ )
353
+ break
354
+
355
+ case 'typedef':
356
+ adjustedSectionKind = sectionDef.computeAdjustedKind('type', 'typedef')
357
+ break
358
+
359
+ case 'slot':
360
+ adjustedSectionKind = sectionDef.computeAdjustedKind('slot')
361
+ break
362
+
363
+ // case 'define':
364
+ // case 'property':
365
+ // case 'event':
366
+ // case 'enum':
367
+ // case 'signal':
368
+ // case 'prototype':
369
+ // case 'friend':
370
+ // case 'dcop':
371
+ // case 'interface':
372
+ // case 'service':
373
+ default: {
374
+ // Adjust to member kind.
375
+ const { kind } = memberBase
376
+ adjustedSectionKind = kind
377
+ break
378
+ }
379
+ }
380
+
381
+ // console.log('adjustedSectionKind:', memberBase.kind, adjustedSectionKind)
382
+ return adjustedSectionKind
383
+ }
384
+
385
+ /**
386
+ * Performs late-stage initialisation after all compounds are loaded.
387
+ *
388
+ * @remarks
389
+ * Processes description content, location information, member sections,
390
+ * and inner compounds. Renders HTML strings and builds location sets
391
+ * for comprehensive compound documentation. Called after initial
392
+ * object creation phase.
393
+ */
394
+ initializeLate(): void {
395
+ const { workspace } = this.collection
396
+
397
+ const compoundDef = this._private._compoundDef
398
+ assert(compoundDef !== undefined)
399
+
400
+ if (compoundDef.briefDescription !== undefined) {
401
+ // console.log(compoundDef.briefDescription)
402
+
403
+ assert(compoundDef.briefDescription.children !== undefined)
404
+ if (compoundDef.briefDescription.children.length > 1) {
405
+ assert(
406
+ compoundDef.briefDescription.children[1] instanceof ParaDataModel
407
+ )
408
+ this.briefDescriptionHtmlString = workspace
409
+ .renderElementsArrayToString(
410
+ compoundDef.briefDescription.children[1].children,
411
+ 'html'
412
+ )
413
+ .trim()
414
+ } else {
415
+ this.briefDescriptionHtmlString = workspace
416
+ .renderElementToString(compoundDef.briefDescription, 'html')
417
+ .trim()
418
+ }
419
+ }
420
+
421
+ if (compoundDef.detailedDescription !== undefined) {
422
+ // console.log(compoundDef.detailedDescription)
423
+ this.detailedDescriptionHtmlLines = workspace.renderElementToLines(
424
+ compoundDef.detailedDescription,
425
+ 'html'
426
+ )
427
+ }
428
+
429
+ if (this.kind === 'page') {
430
+ // The location for pages is not usable.
431
+ } else if (this.kind === 'dir') {
432
+ // The location for folders is not used.
433
+ } else {
434
+ if (compoundDef.location !== undefined) {
435
+ this.locationLines = this.renderLocationToLines(compoundDef.location)
436
+ }
437
+ }
438
+
439
+ if (compoundDef.sectionDefs !== undefined) {
440
+ for (const sectionDef of compoundDef.sectionDefs) {
441
+ if (sectionDef.memberDefs !== undefined) {
442
+ for (const memberDef of sectionDef.memberDefs) {
443
+ if (memberDef.location !== undefined) {
444
+ const { file } = memberDef.location
445
+ this.locationSet.add(file)
446
+ if (memberDef.location.bodyfile !== undefined) {
447
+ this.locationSet.add(memberDef.location.bodyfile)
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }
453
+ }
454
+
455
+ const { includes } = compoundDef
456
+ if (includes !== undefined) {
457
+ this.includes = includes
458
+ }
459
+
460
+ for (const innerKey of Object.keys(compoundDef)) {
461
+ if (
462
+ innerKey.startsWith('inner') &&
463
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
464
+ (compoundDef as any)[innerKey] !== undefined
465
+ ) {
466
+ this.innerCompounds ??= new Map()
467
+ this.innerCompounds.set(innerKey, compoundDef)
468
+ }
469
+ }
470
+ }
471
+
472
+ /**
473
+ * Determines if a member name represents an operator function.
474
+ *
475
+ * @remarks
476
+ * Checks if the name starts with 'operator' followed by operator
477
+ * characters, identifying C++ operator overload functions for
478
+ * proper categorisation in documentation sections.
479
+ *
480
+ * @param name - The member name to check
481
+ * @returns True if the name represents an operator function
482
+ */
483
+ isOperator(name: string): boolean {
484
+ // Two word operators, like
485
+ if (
486
+ name.startsWith('operator') &&
487
+ ' =!<>+-*/%&|^~,"(['.includes(name.charAt(8))
488
+ ) {
489
+ return true
490
+ }
491
+ return false
492
+ }
493
+
494
+ // --------------------------------------------------------------------------
495
+
496
+ /**
497
+ * Renders the compound to an array of markdown lines.
498
+ *
499
+ * @remarks
500
+ * Abstract method that must be implemented by derived classes to
501
+ * generate the complete documentation content for the compound,
502
+ * including descriptions, member listings, and navigation elements.
503
+ *
504
+ * @param frontMatter - The frontmatter configuration for the page
505
+ * @returns Array of markdown strings representing the complete documentation
506
+ */
507
+ abstract renderToLines(frontMatter: FrontMatter): string[]
508
+
509
+ // --------------------------------------------------------------------------
510
+
511
+ renderBriefDescriptionToHtmlString({
512
+ briefDescriptionHtmlString,
513
+ todo = '',
514
+ morePermalink,
515
+ }: {
516
+ briefDescriptionHtmlString: string | undefined
517
+ todo?: string
518
+ morePermalink?: string | undefined
519
+ }): string {
520
+ let text = ''
521
+
522
+ if (!this.collection.workspace.options.suggestToDoDescriptions) {
523
+ todo = ''
524
+ }
525
+
526
+ if (briefDescriptionHtmlString === undefined && todo.length === 0) {
527
+ return ''
528
+ }
529
+
530
+ if (
531
+ briefDescriptionHtmlString !== undefined &&
532
+ briefDescriptionHtmlString.length > 0
533
+ ) {
534
+ text += '<p>'
535
+ text += briefDescriptionHtmlString
536
+ if (morePermalink !== undefined && morePermalink.length > 0) {
537
+ text += ` <a href="${morePermalink}">`
538
+ text += 'More...'
539
+ text += '</a>'
540
+ }
541
+ text += '</p>'
542
+ } else if (todo.length > 0) {
543
+ text += `TODO: add <code>@brief</code> to <code>${todo}</code>`
544
+ }
545
+
546
+ return text
547
+ }
548
+
549
+ renderDetailedDescriptionToHtmlLines({
550
+ briefDescriptionHtmlString,
551
+ detailedDescriptionHtmlLines,
552
+ todo = '',
553
+ showHeader,
554
+ showBrief = false,
555
+ }: {
556
+ briefDescriptionHtmlString?: string | undefined
557
+ detailedDescriptionHtmlLines: string[] | undefined
558
+ todo?: string
559
+ showHeader: boolean
560
+ showBrief?: boolean
561
+ }): string[] {
562
+ const lines: string[] = []
563
+
564
+ if (!this.collection.workspace.options.suggestToDoDescriptions) {
565
+ todo = ''
566
+ }
567
+
568
+ // const workspace = this.collection.workspace
569
+ if (showHeader) {
570
+ if (
571
+ (detailedDescriptionHtmlLines !== undefined &&
572
+ detailedDescriptionHtmlLines.length > 0) ||
573
+ todo.length > 0 ||
574
+ (showBrief &&
575
+ briefDescriptionHtmlString !== undefined &&
576
+ briefDescriptionHtmlString.length > 0)
577
+ ) {
578
+ lines.push('')
579
+ lines.push('## Description {#details}')
580
+ }
581
+ }
582
+
583
+ if (showBrief) {
584
+ if (showHeader) {
585
+ lines.push('')
586
+ }
587
+ if (
588
+ briefDescriptionHtmlString !== undefined &&
589
+ briefDescriptionHtmlString.length > 0
590
+ ) {
591
+ // lines.push(`<p>${briefDescriptionNoParaString}</p>`)
592
+ lines.push(`<p>${briefDescriptionHtmlString}</p>`)
593
+ } else if (todo.length > 0) {
594
+ lines.push(`TODO: add <code>@brief</code> to <code>${todo}</code>`)
595
+ console.log('TODO: add @brief to', todo)
596
+ }
597
+ }
598
+
599
+ // console.log(
600
+ // util.inspect(detailedDescriptionLines, { compact: false, depth: 999 })
601
+ // )
602
+ if (
603
+ detailedDescriptionHtmlLines !== undefined &&
604
+ detailedDescriptionHtmlLines.length > 0
605
+ ) {
606
+ lines.push('')
607
+ lines.push(...detailedDescriptionHtmlLines)
608
+ } else if (todo.length > 0) {
609
+ lines.push('')
610
+ lines.push(`TODO: add <code>@details</code> to <code>${todo}</code>`)
611
+ console.log('TODO: add @details to', todo)
612
+ }
613
+
614
+ return lines
615
+ }
616
+
617
+ // --------------------------------------------------------------------------
618
+
619
+ hasInnerIndices(): boolean {
620
+ return this.innerCompounds !== undefined && this.innerCompounds.size > 0
621
+ }
622
+
623
+ renderInnerIndicesToLines({
624
+ suffixes = [],
625
+ }: {
626
+ suffixes?: string[]
627
+ }): string[] {
628
+ const lines: string[] = []
629
+
630
+ if (this.innerCompounds === undefined) {
631
+ return []
632
+ }
633
+
634
+ for (const innerKey of this.innerCompounds.keys()) {
635
+ if (innerKey.startsWith('inner')) {
636
+ const suffix = innerKey.substring(5)
637
+ if (!suffixes.includes(suffix)) {
638
+ console.warn(
639
+ innerKey,
640
+ 'not processed for',
641
+ this.compoundName,
642
+ 'in renderInnerIndicesToLines'
643
+ )
644
+ continue
645
+ }
646
+ }
647
+ }
648
+
649
+ const { workspace } = this.collection
650
+
651
+ for (const suffix of suffixes) {
652
+ const innerKey = `inner${suffix}`
653
+ const innerCompound: CompoundDefDataModel | undefined =
654
+ this.innerCompounds.get(innerKey)
655
+ if (innerCompound === undefined) {
656
+ continue
657
+ }
658
+
659
+ const innerObjects =
660
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
661
+ (innerCompound as any)[innerKey] as AbstractRefType[] | undefined
662
+
663
+ if (innerObjects === undefined || innerObjects.length === 0) {
664
+ continue
665
+ }
666
+
667
+ lines.push('')
668
+ lines.push(
669
+ `## ${
670
+ suffix === 'Dirs'
671
+ ? 'Folders'
672
+ : suffix === 'Groups'
673
+ ? 'Topics'
674
+ : suffix
675
+ } Index`
676
+ )
677
+
678
+ lines.push('')
679
+ lines.push('<table class="doxyMembersIndex">')
680
+
681
+ for (const innerObject of innerObjects) {
682
+ // console.log(
683
+ // util.inspect(innerObject, { compact: false, depth: 999 })
684
+ // )
685
+ const innerDataObject = workspace.viewModel.compoundsById.get(
686
+ innerObject.refid
687
+ )
688
+ if (innerDataObject !== undefined) {
689
+ const { kind } = innerDataObject
690
+ const itemType =
691
+ kind === 'dir' ? 'folder' : kind === 'group' ? '&nbsp;' : kind
692
+
693
+ const permalink = workspace.getPagePermalink(innerObject.refid)
694
+
695
+ // Debatable. The compound name has the full namespace,
696
+ // the index has the template signature.
697
+ const name = this.collection.workspace.renderString(
698
+ innerDataObject.indexName,
699
+ 'html'
700
+ )
701
+
702
+ let itemName = ''
703
+ if (permalink !== undefined && permalink.length > 0) {
704
+ itemName = `<a href="${permalink}">${name}</a>`
705
+ } else {
706
+ itemName = name
707
+ }
708
+
709
+ const childrenLines: string[] = []
710
+
711
+ const morePermalink =
712
+ innerDataObject.detailedDescriptionHtmlLines !== undefined &&
713
+ permalink !== undefined
714
+ ? `${permalink}/#details`
715
+ : undefined
716
+ if (
717
+ innerDataObject.briefDescriptionHtmlString !== undefined &&
718
+ innerDataObject.briefDescriptionHtmlString.length > 0
719
+ ) {
720
+ childrenLines.push(
721
+ this.renderBriefDescriptionToHtmlString({
722
+ briefDescriptionHtmlString:
723
+ innerDataObject.briefDescriptionHtmlString,
724
+ morePermalink,
725
+ })
726
+ )
727
+ }
728
+
729
+ lines.push('')
730
+
731
+ lines.push(
732
+ ...this.collection.workspace.renderMembersIndexItemToHtmlLines({
733
+ type: itemType,
734
+ name: itemName,
735
+ childrenLines,
736
+ })
737
+ )
738
+ } else {
739
+ lines.push('')
740
+
741
+ const itemType = 'class'
742
+ const { text: itemName } = innerObject
743
+ lines.push(
744
+ ...this.collection.workspace.renderMembersIndexItemToHtmlLines({
745
+ type: itemType,
746
+ name: itemName,
747
+ childrenLines: [],
748
+ })
749
+ )
750
+
751
+ if (this.collection.workspace.options.debug) {
752
+ console.warn(innerObject)
753
+ }
754
+ if (this.collection.workspace.options.verbose) {
755
+ console.warn(
756
+ 'Object definition not found, rendered summarily in ' +
757
+ 'renderInnerIndicesToLines()'
758
+ )
759
+ }
760
+ }
761
+ }
762
+
763
+ lines.push('')
764
+ lines.push('</table>')
765
+ }
766
+
767
+ return lines
768
+ }
769
+
770
+ /**
771
+ * Renders an index table of concept compounds to markdown lines.
772
+ *
773
+ * @remarks
774
+ * Generates a `## Concepts Index` section containing an HTML table
775
+ * of concept entries. Each entry includes a hyperlinked name when a
776
+ * permalink is available, and an optional brief description with a
777
+ * `More...` link when detailed description content is present.
778
+ *
779
+ * @param concepts - Array of concept compounds to render in the index
780
+ * @returns Array of markdown strings representing the concepts index
781
+ */
782
+ renderConceptsIndexToLines(concepts: Concept[]): string[] {
783
+ const lines: string[] = []
784
+
785
+ lines.push('')
786
+ lines.push('## Concepts Index')
787
+
788
+ lines.push('')
789
+ lines.push('<table class="doxyMembersIndex">')
790
+
791
+ for (const concept of concepts) {
792
+ const itemType = 'concept'
793
+
794
+ const permalink = this.collection.workspace.getPagePermalink(concept.id)
795
+
796
+ let itemName = ''
797
+ if (permalink !== undefined && permalink.length > 0) {
798
+ itemName = `<a href="${permalink}">${concept.indexName}</a>`
799
+ } else {
800
+ itemName = concept.indexName
801
+ }
802
+
803
+ const childrenLines: string[] = []
804
+
805
+ const morePermalink =
806
+ concept.detailedDescriptionHtmlLines !== undefined &&
807
+ permalink !== undefined
808
+ ? `${permalink}/#details`
809
+ : undefined
810
+ if (
811
+ concept.briefDescriptionHtmlString !== undefined &&
812
+ concept.briefDescriptionHtmlString.length > 0
813
+ ) {
814
+ childrenLines.push(
815
+ this.renderBriefDescriptionToHtmlString({
816
+ briefDescriptionHtmlString: concept.briefDescriptionHtmlString,
817
+ morePermalink,
818
+ })
819
+ )
820
+ }
821
+
822
+ lines.push('')
823
+
824
+ lines.push(
825
+ ...this.collection.workspace.renderMembersIndexItemToHtmlLines({
826
+ type: itemType,
827
+ name: itemName,
828
+ childrenLines,
829
+ })
830
+ )
831
+ }
832
+
833
+ lines.push('')
834
+ lines.push('</table>')
835
+
836
+ return lines
837
+ }
838
+
839
+ hasSections(): boolean {
840
+ return this.sections.length > 0
841
+ }
842
+
843
+ renderSectionIndicesToLines(): string[] {
844
+ const lines: string[] = []
845
+
846
+ for (const section of this.sections) {
847
+ // console.log(sectionDef)
848
+ lines.push(...section.renderIndexToLines())
849
+ }
850
+
851
+ return lines
852
+ }
853
+
854
+ // --------------------------------------------------------------------------
855
+
856
+ renderIncludesIndexToLines(): string[] {
857
+ const lines: string[] = []
858
+
859
+ const { workspace } = this.collection
860
+
861
+ if (this.includes !== undefined) {
862
+ const includeLines = workspace.renderElementsArrayToLines(
863
+ this.includes,
864
+ 'html'
865
+ )
866
+ lines.push('')
867
+ lines.push('## Included Headers')
868
+
869
+ lines.push('')
870
+ lines.push(`<div class="doxyIncludesList">${includeLines[0]}`)
871
+
872
+ for (const includeLine of includeLines.slice(1)) {
873
+ lines.push(includeLine)
874
+ }
875
+
876
+ lines.push('</div>')
877
+ }
878
+
879
+ return lines
880
+ }
881
+
882
+ // --------------------------------------------------------------------------
883
+
884
+ renderSectionsToLines(): string[] {
885
+ const lines: string[] = []
886
+
887
+ for (const section of this.sections) {
888
+ lines.push(...section.renderToLines())
889
+ }
890
+
891
+ return lines
892
+ }
893
+
894
+ renderLocationToLines(location: LocationDataModel | undefined): string[] {
895
+ const lines: string[] = []
896
+ let text = ''
897
+
898
+ const { workspace } = this.collection
899
+
900
+ if (location !== undefined) {
901
+ // console.log('location.file:', location.file)
902
+ if (location.file.includes('[')) {
903
+ // Ignore cases like `[generated]`, encountered in llvm.
904
+ return lines
905
+ }
906
+
907
+ // console.log(
908
+ // 'renderLocationToLines', this.kind, this.compoundName, this.id
909
+ // )
910
+ const file = workspace.filesByPath.get(location.file)
911
+ if (file !== undefined) {
912
+ const permalink: string | undefined = workspace.getPagePermalink(
913
+ file.id
914
+ )
915
+
916
+ if (
917
+ location.bodyfile !== undefined &&
918
+ location.file !== location.bodyfile
919
+ ) {
920
+ text += '<p>'
921
+ text += 'Declaration '
922
+ if (location.line !== undefined) {
923
+ text += 'at line '
924
+ const paddedLine = location.line.toString().padStart(5, '0')
925
+ const lineAttribute = `l${paddedLine}`
926
+ if (
927
+ permalink !== undefined &&
928
+ permalink.length > 0 &&
929
+ file.listingLineNumbers.has(location.line.valueOf())
930
+ ) {
931
+ text +=
932
+ `<a href="${permalink}/#${lineAttribute}">` +
933
+ workspace.renderString(location.line.toString(), 'html') +
934
+ `</a>`
935
+ } else {
936
+ text += location.line.toString()
937
+ }
938
+ text += ' of file '
939
+ } else {
940
+ text += ' in file '
941
+ }
942
+ const locationFile = workspace.renderString(
943
+ path.basename(location.file),
944
+ 'html'
945
+ )
946
+ if (permalink !== undefined && permalink.length > 0) {
947
+ text += `<a href="${permalink}">${locationFile}</a>`
948
+ } else {
949
+ text += locationFile
950
+ }
951
+
952
+ const definitionFile = workspace.filesByPath.get(location.bodyfile)
953
+ if (definitionFile !== undefined) {
954
+ const definitionPermalink = workspace.getPagePermalink(
955
+ definitionFile.id
956
+ )
957
+
958
+ text += ', definition '
959
+ if (location.bodystart !== undefined) {
960
+ text += 'at line '
961
+ const lineStart = `l${location.bodystart
962
+ .toString()
963
+ .padStart(5, '0')}`
964
+
965
+ if (
966
+ definitionPermalink !== undefined &&
967
+ definitionPermalink.length > 0 &&
968
+ definitionFile.listingLineNumbers.has(
969
+ location.bodystart.valueOf()
970
+ )
971
+ ) {
972
+ const bodyStart = workspace.renderString(
973
+ location.bodystart.toString(),
974
+ 'html'
975
+ )
976
+ text +=
977
+ `<a href="${definitionPermalink}/#${lineStart}">` +
978
+ bodyStart +
979
+ '</a>'
980
+ } else {
981
+ text += location.bodystart.toString()
982
+ }
983
+ text += ' of file '
984
+ } else {
985
+ text += ' in file '
986
+ }
987
+ const locationBodyFile = workspace.renderString(
988
+ path.basename(location.bodyfile),
989
+ 'html'
990
+ )
991
+ if (
992
+ definitionPermalink !== undefined &&
993
+ definitionPermalink.length > 0
994
+ ) {
995
+ text +=
996
+ `<a href="${definitionPermalink}">` + `${locationBodyFile}</a>`
997
+ } else {
998
+ text += locationBodyFile
999
+ }
1000
+ } else {
1001
+ if (this.collection.workspace.options.verbose) {
1002
+ console.warn('File', location.bodyfile, 'not a location.')
1003
+ }
1004
+ }
1005
+ text += '.'
1006
+ text += '</p>'
1007
+ text += '\n'
1008
+ } else {
1009
+ text += '<p>'
1010
+ text += 'Definition '
1011
+ if (location.line !== undefined) {
1012
+ text += 'at line '
1013
+ const paddedLine = location.line.toString().padStart(5, '0')
1014
+ const lineAttribute = `l${paddedLine}`
1015
+ if (
1016
+ permalink !== undefined &&
1017
+ permalink.length > 0 &&
1018
+ file.listingLineNumbers.has(location.line.valueOf())
1019
+ ) {
1020
+ const lineStr = location.line.toString()
1021
+ const lineHtml = workspace.renderString(lineStr, 'html')
1022
+ text +=
1023
+ `<a href="${permalink}/#${lineAttribute}">` + `${lineHtml}</a>`
1024
+ } else {
1025
+ text += location.line.toString()
1026
+ }
1027
+ text += ' of file '
1028
+ } else {
1029
+ text += ' in file '
1030
+ }
1031
+ const locationFile = workspace.renderString(
1032
+ path.basename(location.file),
1033
+ 'html'
1034
+ )
1035
+ if (permalink !== undefined && permalink.length > 0) {
1036
+ text += `<a href="${permalink}">${locationFile}</a>`
1037
+ } else {
1038
+ text += locationFile
1039
+ }
1040
+ text += '.'
1041
+ text += '</p>'
1042
+ text += '\n'
1043
+ }
1044
+ } else {
1045
+ if (this.collection.workspace.options.verbose) {
1046
+ console.warn('File', location.file, 'not a known location.')
1047
+ }
1048
+ }
1049
+ }
1050
+
1051
+ if (text.length > 0) {
1052
+ lines.push('')
1053
+ lines.push(text)
1054
+ }
1055
+
1056
+ return lines
1057
+ }
1058
+
1059
+ renderGeneratedFromToLines(): string[] {
1060
+ const lines: string[] = []
1061
+
1062
+ if (this.locationSet.size > 0) {
1063
+ lines.push('')
1064
+ lines.push('<hr/>')
1065
+ lines.push('')
1066
+ lines.push(
1067
+ `The documentation for this ${this.kind} was generated from the ` +
1068
+ `following file${this.locationSet.size > 1 ? 's' : ''}:`
1069
+ )
1070
+ lines.push('')
1071
+
1072
+ lines.push('<ul>')
1073
+
1074
+ const { workspace } = this.collection
1075
+
1076
+ const sortedFiles = [...this.locationSet].sort((a, b) =>
1077
+ a.localeCompare(b)
1078
+ )
1079
+ for (const fileName of sortedFiles) {
1080
+ // console.log('search', fileName)
1081
+ const fileNameEscaped = workspace.renderString(
1082
+ path.basename(fileName),
1083
+ 'html'
1084
+ )
1085
+ const file = workspace.filesByPath.get(fileName)
1086
+ if (file !== undefined) {
1087
+ const permalink: string | undefined = workspace.getPagePermalink(
1088
+ file.id
1089
+ )
1090
+ if (permalink !== undefined && permalink.length > 0) {
1091
+ lines.push(`<li><a href="${permalink}">${fileNameEscaped}</a></li>`)
1092
+ } else {
1093
+ lines.push(`<li>${fileNameEscaped}</li>`)
1094
+ }
1095
+ } else {
1096
+ lines.push(`<li>${fileNameEscaped}</li>`)
1097
+ }
1098
+ }
1099
+ lines.push('</ul>')
1100
+ }
1101
+
1102
+ return lines
1103
+ }
1104
+
1105
+ renderReferencesToHtmlString(
1106
+ references: ReferenceDataModel[] | undefined
1107
+ ): string {
1108
+ let text = ''
1109
+
1110
+ if (references === undefined || references.length === 0) {
1111
+ return ''
1112
+ }
1113
+
1114
+ const { workspace } = this.collection
1115
+
1116
+ const referenceLines: string[] = []
1117
+
1118
+ for (const reference of references) {
1119
+ referenceLines.push(workspace.renderElementToString(reference, 'html'))
1120
+ }
1121
+
1122
+ text += '<p>'
1123
+ if (referenceLines.length === 1) {
1124
+ text += 'Reference '
1125
+ } else {
1126
+ text += 'References '
1127
+ }
1128
+ text += joinWithLast(referenceLines, ', ', ' and ')
1129
+ text += '.'
1130
+ text += '</p>'
1131
+ text += '\n'
1132
+
1133
+ return text
1134
+ }
1135
+
1136
+ renderReferencedByToHtmlString(
1137
+ referencedBy: ReferencedByDataModel[] | undefined
1138
+ ): string {
1139
+ let text = ''
1140
+
1141
+ if (referencedBy === undefined || referencedBy.length === 0) {
1142
+ return ''
1143
+ }
1144
+
1145
+ const { workspace } = this.collection
1146
+
1147
+ const referenceLines: string[] = []
1148
+
1149
+ for (const reference of referencedBy) {
1150
+ referenceLines.push(workspace.renderElementToString(reference, 'html'))
1151
+ }
1152
+
1153
+ text += '<p>'
1154
+ text += 'Referenced by '
1155
+ text += joinWithLast(referenceLines, ', ', ' and ')
1156
+ text += '.'
1157
+ text += '</p>'
1158
+ text += '\n'
1159
+
1160
+ return text
1161
+ }
1162
+
1163
+ // --------------------------------------------------------------------------
1164
+
1165
+ /**
1166
+ * Return an array of types, like `class T`, or `class U = T`, or `N T::* MP`
1167
+ * @param templateParamList
1168
+ * @returns
1169
+ */
1170
+
1171
+ collectTemplateParameters({
1172
+ templateParamList,
1173
+ withDefaults = false,
1174
+ }: {
1175
+ templateParamList: TemplateParamListDataModel | undefined
1176
+ withDefaults?: boolean
1177
+ }): string[] {
1178
+ if (templateParamList?.params === undefined) {
1179
+ return []
1180
+ }
1181
+
1182
+ const templateParameters: string[] = []
1183
+
1184
+ for (const param of templateParamList.params) {
1185
+ // console.log(util.inspect(param, { compact: false, depth: 999 }))
1186
+ assert(param.type !== undefined)
1187
+
1188
+ let paramString = ''
1189
+ assert(param.type.children !== undefined)
1190
+ for (const child of param.type.children) {
1191
+ if (typeof child === 'string') {
1192
+ paramString += child
1193
+ } else if ((child as object) instanceof RefTextDataModel) {
1194
+ paramString += (child as RefTextDataModel).text
1195
+ }
1196
+ }
1197
+
1198
+ if (param.declname !== undefined) {
1199
+ paramString += ` ${param.declname}`
1200
+ }
1201
+
1202
+ if (withDefaults) {
1203
+ if (param.defval !== undefined) {
1204
+ const defval: DefValDataModel = param.defval
1205
+ paramString += ' = '
1206
+ assert(defval.children !== undefined)
1207
+ for (const child of defval.children) {
1208
+ if (typeof child === 'string') {
1209
+ paramString += child
1210
+ } else if (child instanceof RefTextDataModel) {
1211
+ paramString += child.text
1212
+ }
1213
+ }
1214
+ }
1215
+ }
1216
+
1217
+ templateParameters.push(paramString)
1218
+ }
1219
+
1220
+ return templateParameters
1221
+ }
1222
+
1223
+ isTemplate(
1224
+ templateParamList: TemplateParamListDataModel | undefined
1225
+ ): boolean {
1226
+ return (templateParamList?.params ?? []).length > 0
1227
+ }
1228
+
1229
+ collectTemplateParameterNames(
1230
+ templateParamList: TemplateParamListDataModel
1231
+ ): string[] {
1232
+ if (templateParamList.params === undefined) {
1233
+ return []
1234
+ }
1235
+
1236
+ const templateParameterNames: string[] = []
1237
+
1238
+ for (const param of templateParamList.params) {
1239
+ // console.log(util.inspect(param, { compact: false, depth: 999 }))
1240
+ assert(param.type !== undefined)
1241
+
1242
+ let paramString = ''
1243
+
1244
+ // declname? defname? order?
1245
+ if (param.declname !== undefined) {
1246
+ paramString += param.declname
1247
+ } else {
1248
+ assert(param.type.children !== undefined)
1249
+ for (const child of param.type.children) {
1250
+ if (typeof child === 'string') {
1251
+ // Extract the parameter name, passed as `class T`.
1252
+ paramString += child
1253
+ } else if ((child as object) instanceof RefTextDataModel) {
1254
+ paramString += (child as RefTextDataModel).text
1255
+ }
1256
+ }
1257
+ }
1258
+
1259
+ const paramName = paramString
1260
+ .replaceAll(/class /g, '')
1261
+ .replaceAll(/typename /g, '')
1262
+ templateParameterNames.push(paramName)
1263
+ }
1264
+ return templateParameterNames
1265
+ }
1266
+
1267
+ renderTemplateParametersToString({
1268
+ templateParamList,
1269
+ withDefaults = false,
1270
+ }: {
1271
+ templateParamList: TemplateParamListDataModel | undefined
1272
+ withDefaults?: boolean
1273
+ }): string {
1274
+ let text = ''
1275
+
1276
+ if (templateParamList?.params !== undefined) {
1277
+ const templateParameters: string[] = this.collectTemplateParameters({
1278
+ templateParamList,
1279
+ withDefaults,
1280
+ })
1281
+ if (templateParameters.length > 0) {
1282
+ text += `<${templateParameters.join(', ')}>`
1283
+ }
1284
+ }
1285
+ return text
1286
+ }
1287
+
1288
+ renderTemplateParameterNamesToString(
1289
+ templateParamList: TemplateParamListDataModel | undefined
1290
+ ): string {
1291
+ let text = ''
1292
+
1293
+ if (templateParamList?.params !== undefined) {
1294
+ const templateParameterNames: string[] =
1295
+ this.collectTemplateParameterNames(templateParamList)
1296
+ if (templateParameterNames.length > 0) {
1297
+ text += `<${templateParameterNames.join(', ')}>`
1298
+ }
1299
+ }
1300
+ return text
1301
+ }
1302
+
1303
+ // --------------------------------------------------------------------------
1304
+
1305
+ /**
1306
+ * Determines whether the compound has any displayable content.
1307
+ *
1308
+ * @remarks
1309
+ * Checks for the presence of brief descriptions, detailed descriptions,
1310
+ * or member sections to determine if the compound documentation page
1311
+ * should be generated. Can be overridden by derived classes to add
1312
+ * additional content checks.
1313
+ *
1314
+ * @returns True if the compound has content worth displaying
1315
+ */
1316
+ hasAnyContent(): boolean {
1317
+ if (
1318
+ this.briefDescriptionHtmlString !== undefined &&
1319
+ this.briefDescriptionHtmlString.length > 0
1320
+ ) {
1321
+ // console.log('has content brief', this.compoundName)
1322
+ return true
1323
+ }
1324
+ if (
1325
+ this.detailedDescriptionHtmlLines !== undefined &&
1326
+ this.detailedDescriptionHtmlLines.length > 0
1327
+ ) {
1328
+ // console.log('has content details', this.compoundName)
1329
+ return true
1330
+ }
1331
+ if (this.sections.length > 0) {
1332
+ // console.log('has content sections.length', this)
1333
+ return true
1334
+ }
1335
+
1336
+ return false
1337
+ }
1338
+ }
1339
+
1340
+ // ----------------------------------------------------------------------------