@xpack/doxygen2docusaurus 1.0.2

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 (273) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/bin/doxygen2docusaurus.js +45 -0
  4. package/dist/cli/main.d.ts +10 -0
  5. package/dist/cli/main.d.ts.map +1 -0
  6. package/dist/cli/main.js +66 -0
  7. package/dist/cli/main.js.map +1 -0
  8. package/dist/docusaurus/cli-options.d.ts +98 -0
  9. package/dist/docusaurus/cli-options.d.ts.map +1 -0
  10. package/dist/docusaurus/cli-options.js +212 -0
  11. package/dist/docusaurus/cli-options.js.map +1 -0
  12. package/dist/docusaurus/generator.d.ts +22 -0
  13. package/dist/docusaurus/generator.d.ts.map +1 -0
  14. package/dist/docusaurus/generator.js +461 -0
  15. package/dist/docusaurus/generator.js.map +1 -0
  16. package/dist/docusaurus/renderers/descriptiontype.d.ts +63 -0
  17. package/dist/docusaurus/renderers/descriptiontype.d.ts.map +1 -0
  18. package/dist/docusaurus/renderers/descriptiontype.js +674 -0
  19. package/dist/docusaurus/renderers/descriptiontype.js.map +1 -0
  20. package/dist/docusaurus/renderers/docinternalstype.d.ts +21 -0
  21. package/dist/docusaurus/renderers/docinternalstype.d.ts.map +1 -0
  22. package/dist/docusaurus/renderers/docinternalstype.js +159 -0
  23. package/dist/docusaurus/renderers/docinternalstype.js.map +1 -0
  24. package/dist/docusaurus/renderers/doclisttype.d.ts +6 -0
  25. package/dist/docusaurus/renderers/doclisttype.d.ts.map +1 -0
  26. package/dist/docusaurus/renderers/doclisttype.js +86 -0
  27. package/dist/docusaurus/renderers/doclisttype.js.map +1 -0
  28. package/dist/docusaurus/renderers/doctabletype.d.ts +15 -0
  29. package/dist/docusaurus/renderers/doctabletype.d.ts.map +1 -0
  30. package/dist/docusaurus/renderers/doctabletype.js +98 -0
  31. package/dist/docusaurus/renderers/doctabletype.js.map +1 -0
  32. package/dist/docusaurus/renderers/doctitletype.d.ts +6 -0
  33. package/dist/docusaurus/renderers/doctitletype.d.ts.map +1 -0
  34. package/dist/docusaurus/renderers/doctitletype.js +38 -0
  35. package/dist/docusaurus/renderers/doctitletype.js.map +1 -0
  36. package/dist/docusaurus/renderers/docvariablelisttype.d.ts +9 -0
  37. package/dist/docusaurus/renderers/docvariablelisttype.d.ts.map +1 -0
  38. package/dist/docusaurus/renderers/docvariablelisttype.js +57 -0
  39. package/dist/docusaurus/renderers/docvariablelisttype.js.map +1 -0
  40. package/dist/docusaurus/renderers/docxrefsecttype.d.ts +6 -0
  41. package/dist/docusaurus/renderers/docxrefsecttype.d.ts.map +1 -0
  42. package/dist/docusaurus/renderers/docxrefsecttype.js +44 -0
  43. package/dist/docusaurus/renderers/docxrefsecttype.js.map +1 -0
  44. package/dist/docusaurus/renderers/element-renderer-base.d.ts +12 -0
  45. package/dist/docusaurus/renderers/element-renderer-base.d.ts.map +1 -0
  46. package/dist/docusaurus/renderers/element-renderer-base.js +25 -0
  47. package/dist/docusaurus/renderers/element-renderer-base.js.map +1 -0
  48. package/dist/docusaurus/renderers/inctype.d.ts +6 -0
  49. package/dist/docusaurus/renderers/inctype.d.ts.map +1 -0
  50. package/dist/docusaurus/renderers/inctype.js +42 -0
  51. package/dist/docusaurus/renderers/inctype.js.map +1 -0
  52. package/dist/docusaurus/renderers/linkedtexttype.d.ts +6 -0
  53. package/dist/docusaurus/renderers/linkedtexttype.d.ts.map +1 -0
  54. package/dist/docusaurus/renderers/linkedtexttype.js +32 -0
  55. package/dist/docusaurus/renderers/linkedtexttype.js.map +1 -0
  56. package/dist/docusaurus/renderers/listingtype.d.ts +10 -0
  57. package/dist/docusaurus/renderers/listingtype.d.ts.map +1 -0
  58. package/dist/docusaurus/renderers/listingtype.js +121 -0
  59. package/dist/docusaurus/renderers/listingtype.js.map +1 -0
  60. package/dist/docusaurus/renderers/paramtype.d.ts +6 -0
  61. package/dist/docusaurus/renderers/paramtype.d.ts.map +1 -0
  62. package/dist/docusaurus/renderers/paramtype.js +63 -0
  63. package/dist/docusaurus/renderers/paramtype.js.map +1 -0
  64. package/dist/docusaurus/renderers/referencetype.d.ts +6 -0
  65. package/dist/docusaurus/renderers/referencetype.d.ts.map +1 -0
  66. package/dist/docusaurus/renderers/referencetype.js +42 -0
  67. package/dist/docusaurus/renderers/referencetype.js.map +1 -0
  68. package/dist/docusaurus/renderers/reftexttype.d.ts +6 -0
  69. package/dist/docusaurus/renderers/reftexttype.d.ts.map +1 -0
  70. package/dist/docusaurus/renderers/reftexttype.js +41 -0
  71. package/dist/docusaurus/renderers/reftexttype.js.map +1 -0
  72. package/dist/docusaurus/renderers/reftype.d.ts +6 -0
  73. package/dist/docusaurus/renderers/reftype.d.ts.map +1 -0
  74. package/dist/docusaurus/renderers/reftype.js +38 -0
  75. package/dist/docusaurus/renderers/reftype.js.map +1 -0
  76. package/dist/docusaurus/renderers/renderers.d.ts +33 -0
  77. package/dist/docusaurus/renderers/renderers.d.ts.map +1 -0
  78. package/dist/docusaurus/renderers/renderers.js +303 -0
  79. package/dist/docusaurus/renderers/renderers.js.map +1 -0
  80. package/dist/docusaurus/renderers/substringtype.d.ts +6 -0
  81. package/dist/docusaurus/renderers/substringtype.d.ts.map +1 -0
  82. package/dist/docusaurus/renderers/substringtype.js +24 -0
  83. package/dist/docusaurus/renderers/substringtype.js.map +1 -0
  84. package/dist/docusaurus/renderers/tableofcontentstype.d.ts +6 -0
  85. package/dist/docusaurus/renderers/tableofcontentstype.d.ts.map +1 -0
  86. package/dist/docusaurus/renderers/tableofcontentstype.js +41 -0
  87. package/dist/docusaurus/renderers/tableofcontentstype.js.map +1 -0
  88. package/dist/docusaurus/types.d.ts +53 -0
  89. package/dist/docusaurus/types.d.ts.map +1 -0
  90. package/dist/docusaurus/types.js +13 -0
  91. package/dist/docusaurus/types.js.map +1 -0
  92. package/dist/docusaurus/utils.d.ts +16 -0
  93. package/dist/docusaurus/utils.d.ts.map +1 -0
  94. package/dist/docusaurus/utils.js +169 -0
  95. package/dist/docusaurus/utils.js.map +1 -0
  96. package/dist/docusaurus/view-model/classes-vm.d.ts +35 -0
  97. package/dist/docusaurus/view-model/classes-vm.d.ts.map +1 -0
  98. package/dist/docusaurus/view-model/classes-vm.js +707 -0
  99. package/dist/docusaurus/view-model/classes-vm.js.map +1 -0
  100. package/dist/docusaurus/view-model/collection-base.d.ts +28 -0
  101. package/dist/docusaurus/view-model/collection-base.d.ts.map +1 -0
  102. package/dist/docusaurus/view-model/collection-base.js +155 -0
  103. package/dist/docusaurus/view-model/collection-base.js.map +1 -0
  104. package/dist/docusaurus/view-model/compound-base-vm.d.ts +112 -0
  105. package/dist/docusaurus/view-model/compound-base-vm.d.ts.map +1 -0
  106. package/dist/docusaurus/view-model/compound-base-vm.js +829 -0
  107. package/dist/docusaurus/view-model/compound-base-vm.js.map +1 -0
  108. package/dist/docusaurus/view-model/description-anchors.d.ts +17 -0
  109. package/dist/docusaurus/view-model/description-anchors.d.ts.map +1 -0
  110. package/dist/docusaurus/view-model/description-anchors.js +37 -0
  111. package/dist/docusaurus/view-model/description-anchors.js.map +1 -0
  112. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts +45 -0
  113. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts.map +1 -0
  114. package/dist/docusaurus/view-model/files-and-folders-vm.js +749 -0
  115. package/dist/docusaurus/view-model/files-and-folders-vm.js.map +1 -0
  116. package/dist/docusaurus/view-model/groups-vm.d.ts +20 -0
  117. package/dist/docusaurus/view-model/groups-vm.d.ts.map +1 -0
  118. package/dist/docusaurus/view-model/groups-vm.js +297 -0
  119. package/dist/docusaurus/view-model/groups-vm.js.map +1 -0
  120. package/dist/docusaurus/view-model/members-vm.d.ts +81 -0
  121. package/dist/docusaurus/view-model/members-vm.d.ts.map +1 -0
  122. package/dist/docusaurus/view-model/members-vm.js +1017 -0
  123. package/dist/docusaurus/view-model/members-vm.js.map +1 -0
  124. package/dist/docusaurus/view-model/namespaces-vm.d.ts +24 -0
  125. package/dist/docusaurus/view-model/namespaces-vm.d.ts.map +1 -0
  126. package/dist/docusaurus/view-model/namespaces-vm.js +527 -0
  127. package/dist/docusaurus/view-model/namespaces-vm.js.map +1 -0
  128. package/dist/docusaurus/view-model/options.d.ts +8 -0
  129. package/dist/docusaurus/view-model/options.d.ts.map +1 -0
  130. package/dist/docusaurus/view-model/options.js +42 -0
  131. package/dist/docusaurus/view-model/options.js.map +1 -0
  132. package/dist/docusaurus/view-model/pages-vm.d.ts +18 -0
  133. package/dist/docusaurus/view-model/pages-vm.d.ts.map +1 -0
  134. package/dist/docusaurus/view-model/pages-vm.js +160 -0
  135. package/dist/docusaurus/view-model/pages-vm.js.map +1 -0
  136. package/dist/docusaurus/view-model/tree-entries-vm.d.ts +44 -0
  137. package/dist/docusaurus/view-model/tree-entries-vm.d.ts.map +1 -0
  138. package/dist/docusaurus/view-model/tree-entries-vm.js +139 -0
  139. package/dist/docusaurus/view-model/tree-entries-vm.js.map +1 -0
  140. package/dist/docusaurus/view-model/view-model.d.ts +34 -0
  141. package/dist/docusaurus/view-model/view-model.d.ts.map +1 -0
  142. package/dist/docusaurus/view-model/view-model.js +284 -0
  143. package/dist/docusaurus/view-model/view-model.js.map +1 -0
  144. package/dist/docusaurus/workspace.d.ts +65 -0
  145. package/dist/docusaurus/workspace.d.ts.map +1 -0
  146. package/dist/docusaurus/workspace.js +350 -0
  147. package/dist/docusaurus/workspace.js.map +1 -0
  148. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts +97 -0
  149. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts.map +1 -0
  150. package/dist/doxygen/data-model/compounds/compounddef-dm.js +498 -0
  151. package/dist/doxygen/data-model/compounds/compounddef-dm.js.map +1 -0
  152. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts +27 -0
  153. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts.map +1 -0
  154. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js +91 -0
  155. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js.map +1 -0
  156. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts +1214 -0
  157. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts.map +1 -0
  158. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js +5995 -0
  159. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js.map +1 -0
  160. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts +22 -0
  161. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts.map +1 -0
  162. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js +136 -0
  163. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js.map +1 -0
  164. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts +14 -0
  165. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts.map +1 -0
  166. package/dist/doxygen/data-model/compounds/doxygentype-dm.js +87 -0
  167. package/dist/doxygen/data-model/compounds/doxygentype-dm.js.map +1 -0
  168. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts +23 -0
  169. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts.map +1 -0
  170. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js +104 -0
  171. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js.map +1 -0
  172. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts +24 -0
  173. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts.map +1 -0
  174. package/dist/doxygen/data-model/compounds/inctype-dm.js +84 -0
  175. package/dist/doxygen/data-model/compounds/inctype-dm.js.map +1 -0
  176. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts +33 -0
  177. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts.map +1 -0
  178. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js +102 -0
  179. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js.map +1 -0
  180. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts +17 -0
  181. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts.map +1 -0
  182. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js +69 -0
  183. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js.map +1 -0
  184. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts +24 -0
  185. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts.map +1 -0
  186. package/dist/doxygen/data-model/compounds/locationtype-dm.js +109 -0
  187. package/dist/doxygen/data-model/compounds/locationtype-dm.js.map +1 -0
  188. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts +67 -0
  189. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts.map +1 -0
  190. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js +253 -0
  191. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js.map +1 -0
  192. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts +21 -0
  193. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts.map +1 -0
  194. package/dist/doxygen/data-model/compounds/memberreftype-dm.js +105 -0
  195. package/dist/doxygen/data-model/compounds/memberreftype-dm.js.map +1 -0
  196. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts +17 -0
  197. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts.map +1 -0
  198. package/dist/doxygen/data-model/compounds/membertype-dm.js +87 -0
  199. package/dist/doxygen/data-model/compounds/membertype-dm.js.map +1 -0
  200. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts +25 -0
  201. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts.map +1 -0
  202. package/dist/doxygen/data-model/compounds/paramtype-dm.js +115 -0
  203. package/dist/doxygen/data-model/compounds/paramtype-dm.js.map +1 -0
  204. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts +26 -0
  205. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts.map +1 -0
  206. package/dist/doxygen/data-model/compounds/referencetype-dm.js +93 -0
  207. package/dist/doxygen/data-model/compounds/referencetype-dm.js.map +1 -0
  208. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts +15 -0
  209. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts.map +1 -0
  210. package/dist/doxygen/data-model/compounds/reftexttype-dm.js +80 -0
  211. package/dist/doxygen/data-model/compounds/reftexttype-dm.js.map +1 -0
  212. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts +55 -0
  213. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts.map +1 -0
  214. package/dist/doxygen/data-model/compounds/reftype-dm.js +152 -0
  215. package/dist/doxygen/data-model/compounds/reftype-dm.js.map +1 -0
  216. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts +20 -0
  217. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts.map +1 -0
  218. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js +77 -0
  219. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js.map +1 -0
  220. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts +34 -0
  221. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts.map +1 -0
  222. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js +139 -0
  223. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js.map +1 -0
  224. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts +46 -0
  225. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts.map +1 -0
  226. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js +235 -0
  227. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js.map +1 -0
  228. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts +17 -0
  229. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts.map +1 -0
  230. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js +69 -0
  231. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js.map +1 -0
  232. package/dist/doxygen/data-model/data-model.d.ts +91 -0
  233. package/dist/doxygen/data-model/data-model.d.ts.map +1 -0
  234. package/dist/doxygen/data-model/data-model.js +245 -0
  235. package/dist/doxygen/data-model/data-model.js.map +1 -0
  236. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts +21 -0
  237. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts.map +1 -0
  238. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js +95 -0
  239. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js.map +1 -0
  240. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts +20 -0
  241. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts.map +1 -0
  242. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js +92 -0
  243. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js.map +1 -0
  244. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts +261 -0
  245. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts.map +1 -0
  246. package/dist/doxygen/data-model/doxygen-xml-parser.js +459 -0
  247. package/dist/doxygen/data-model/doxygen-xml-parser.js.map +1 -0
  248. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts +21 -0
  249. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts.map +1 -0
  250. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js +96 -0
  251. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js.map +1 -0
  252. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts +20 -0
  253. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts.map +1 -0
  254. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js +93 -0
  255. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js.map +1 -0
  256. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts +19 -0
  257. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts.map +1 -0
  258. package/dist/doxygen/data-model/index/indexmembertype-dm.js +89 -0
  259. package/dist/doxygen/data-model/index/indexmembertype-dm.js.map +1 -0
  260. package/dist/doxygen/data-model/types.d.ts +44 -0
  261. package/dist/doxygen/data-model/types.d.ts.map +1 -0
  262. package/dist/doxygen/data-model/types.js +24 -0
  263. package/dist/doxygen/data-model/types.js.map +1 -0
  264. package/dist/index.d.ts +43 -0
  265. package/dist/index.d.ts.map +1 -0
  266. package/dist/index.js +69 -0
  267. package/dist/index.js.map +1 -0
  268. package/dist/tsconfig.tsbuildinfo +1 -0
  269. package/package.json +99 -0
  270. package/template/css/custom.css +908 -0
  271. package/template/img/README.md +3 -0
  272. package/template/img/document-svgrepo-com.svg +5 -0
  273. package/template/img/folder-svgrepo-com.svg +5 -0
@@ -0,0 +1,1017 @@
1
+ /*
2
+ * This file is part of the xPack project (http://xpack.github.io).
3
+ * Copyright (c) 2025 Liviu Ionescu. All rights reserved.
4
+ *
5
+ * Permission to use, copy, modify, and/or distribute this software
6
+ * for any 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
9
+ * be obtained from https://opensource.org/licenses/MIT.
10
+ */
11
+ // ----------------------------------------------------------------------------
12
+ import * as util from 'node:util';
13
+ import assert from 'node:assert';
14
+ import { getPermalinkAnchor, sanitizeAnonymousNamespace } from '../utils.js';
15
+ import { MemberProgramListingDataModel, ParaDataModel, } from '../../doxygen/data-model/compounds/descriptiontype-dm.js';
16
+ // ----------------------------------------------------------------------------
17
+ export const sectionHeaders = {
18
+ typedef: ['Typedefs', 100], // DoxMemberKind too
19
+ 'public-type': ['Public Member Typedefs', 110],
20
+ 'protected-type': ['Protected Member Typedefs', 120],
21
+ 'private-type': ['Private Member Typedefs', 130],
22
+ 'package-type': ['Package Member Typedefs', 140],
23
+ enum: ['Enumerations', 150], // DoxMemberKind too
24
+ friend: ['Friends', 160], // DoxMemberKind too
25
+ interface: ['Interfaces', 170], // DoxMemberKind only
26
+ // Extra, not present in Doxygen.
27
+ constructorr: ['Constructors', 200],
28
+ 'public-constructorr': ['Public Constructors', 200],
29
+ 'protected-constructorr': ['Protected Constructors', 210],
30
+ 'private-constructorr': ['Private Constructors', 220],
31
+ // Extra, not present in Doxygen.
32
+ 'public-destructor': ['Public Destructor', 230],
33
+ 'protected-destructor': ['Protected Destructor', 240],
34
+ 'private-destructor': ['Private Destructor', 250],
35
+ // Extra, not present in Doxygen.
36
+ operator: ['Operators', 300],
37
+ 'public-operator': ['Public Operators', 310],
38
+ 'protected-operator': ['Protected Operators', 320],
39
+ 'private-operator': ['Private Operators', 330],
40
+ 'package-operator': ['Package Operators', 340],
41
+ func: ['Functions', 350],
42
+ function: ['Functions', 350], // DoxMemberKind only
43
+ 'public-func': ['Public Member Functions', 360],
44
+ 'protected-func': ['Protected Member Functions', 370],
45
+ 'private-func': ['Private Member Functions', 380],
46
+ 'package-func': ['Package Member Functions', 390],
47
+ var: ['Variables', 400],
48
+ variable: ['Variables', 400], // DoxMemberKind only
49
+ 'public-attrib': ['Public Member Attributes', 410],
50
+ 'protected-attrib': ['Protected Member Attributes', 420],
51
+ 'private-attrib': ['Private Member Attributes', 430],
52
+ 'package-attrib': ['Package Member Attributes', 440],
53
+ 'public-static-operator': ['Public Operators', 450],
54
+ 'protected-static-operator': ['Protected Operators', 460],
55
+ 'private-static-operator': ['Private Operators', 470],
56
+ 'package-static-operator': ['Package Operators', 480],
57
+ 'public-static-func': ['Public Static Functions', 500],
58
+ 'protected-static-func': ['Protected Static Functions', 510],
59
+ 'private-static-func': ['Private Static Functions', 520],
60
+ 'package-static-func': ['Package Static Functions', 530],
61
+ 'public-static-attrib': ['Public Static Attributes', 600],
62
+ 'protected-static-attrib': ['Protected Static Attributes', 610],
63
+ 'private-static-attrib': ['Private Static Attributes', 620],
64
+ 'package-static-attrib': ['Package Static Attributes', 630],
65
+ slot: ['Slots', 700], // DoxMemberKind only
66
+ 'public-slot': ['Public Slots', 700],
67
+ 'protected-slot': ['Protected Slot', 710],
68
+ 'private-slot': ['Private Slot', 720],
69
+ related: ['Related', 800],
70
+ define: ['Macro Definitions', 810], // DoxMemberKind too
71
+ prototype: ['Prototypes', 820], // DoxMemberKind too
72
+ signal: ['Signals', 830], // DoxMemberKind too
73
+ // 'dcop-func': ['DCOP Functions', 840],
74
+ dcop: ['DCOP Functions', 840], // DoxMemberKind only
75
+ property: ['Properties', 850], // DoxMemberKind too
76
+ event: ['Events', 860], // DoxMemberKind too
77
+ service: ['Services', 870], // DoxMemberKind only
78
+ 'user-defined': ['Definitions', 1000],
79
+ };
80
+ // ----------------------------------------------------------------------------
81
+ export class Section {
82
+ compound;
83
+ kind;
84
+ headerName;
85
+ descriptionLines;
86
+ // Both references and definitions.
87
+ indexMembers = [];
88
+ // Only definitions.
89
+ definitionMembers = [];
90
+ _private = {};
91
+ constructor(compound, sectionDef) {
92
+ // console.log(compound.kind, compound.compoundName, sectionDef.kind)
93
+ this._private._sectionDef = sectionDef;
94
+ this.compound = compound;
95
+ const { kind } = sectionDef;
96
+ this.kind = kind;
97
+ this.headerName = this.getHeaderNameByKind(sectionDef);
98
+ assert(this.headerName.length > 0);
99
+ const members = [];
100
+ if (sectionDef.memberDefs !== undefined) {
101
+ for (const memberDefDataModel of sectionDef.memberDefs) {
102
+ const member = new Member(this, memberDefDataModel);
103
+ members.push(member);
104
+ // Do not add it to the global map since additional checks are needed
105
+ // therefore the procedure is done in the global generator.
106
+ }
107
+ }
108
+ if (sectionDef.members !== undefined) {
109
+ for (const memberRef of sectionDef.members) {
110
+ members.push(new MemberRef(this, memberRef));
111
+ }
112
+ }
113
+ // Original order.
114
+ this.indexMembers = members;
115
+ const definitionMembers = [];
116
+ for (const member of this.indexMembers) {
117
+ if (member instanceof Member) {
118
+ definitionMembers.push(member);
119
+ }
120
+ }
121
+ // Sorted.
122
+ this.definitionMembers = definitionMembers.sort((a, b) => a.name.localeCompare(b.name));
123
+ }
124
+ initializeLate() {
125
+ const { workspace } = this.compound.collection;
126
+ assert(this._private._sectionDef !== undefined);
127
+ const { _sectionDef: sectionDef } = this._private;
128
+ if (sectionDef.description !== undefined) {
129
+ this.descriptionLines = workspace.renderElementToLines(sectionDef.description, 'html');
130
+ // console.log(this.indexMembers, this.descriptionLines)
131
+ }
132
+ }
133
+ hasDefinitionMembers() {
134
+ return this.definitionMembers.length > 0;
135
+ }
136
+ // --------------------------------------------------------------------------
137
+ // <xsd:simpleType name="DoxSectionKind">
138
+ // <xsd:restriction base="xsd:string">
139
+ // <xsd:enumeration value="user-defined" />
140
+ // <xsd:enumeration value="public-type" />
141
+ // <xsd:enumeration value="public-func" />
142
+ // <xsd:enumeration value="public-attrib" />
143
+ // <xsd:enumeration value="public-slot" />
144
+ // <xsd:enumeration value="signal" />
145
+ // <xsd:enumeration value="dcop-func" />
146
+ // <xsd:enumeration value="property" />
147
+ // <xsd:enumeration value="event" />
148
+ // <xsd:enumeration value="public-static-func" />
149
+ // <xsd:enumeration value="public-static-attrib" />
150
+ // <xsd:enumeration value="protected-type" />
151
+ // <xsd:enumeration value="protected-func" />
152
+ // <xsd:enumeration value="protected-attrib" />
153
+ // <xsd:enumeration value="protected-slot" />
154
+ // <xsd:enumeration value="protected-static-func" />
155
+ // <xsd:enumeration value="protected-static-attrib" />
156
+ // <xsd:enumeration value="package-type" />
157
+ // <xsd:enumeration value="package-func" />
158
+ // <xsd:enumeration value="package-attrib" />
159
+ // <xsd:enumeration value="package-static-func" />
160
+ // <xsd:enumeration value="package-static-attrib" />
161
+ // <xsd:enumeration value="private-type" />
162
+ // <xsd:enumeration value="private-func" />
163
+ // <xsd:enumeration value="private-attrib" />
164
+ // <xsd:enumeration value="private-slot" />
165
+ // <xsd:enumeration value="private-static-func" />
166
+ // <xsd:enumeration value="private-static-attrib" />
167
+ // <xsd:enumeration value="friend" />
168
+ // <xsd:enumeration value="related" />
169
+ // <xsd:enumeration value="define" />
170
+ // <xsd:enumeration value="prototype" />
171
+ // <xsd:enumeration value="typedef" />
172
+ // <xsd:enumeration value="enum" />
173
+ // <xsd:enumeration value="func" />
174
+ // <xsd:enumeration value="var" />
175
+ // </xsd:restriction>
176
+ // </xsd:simpleType>
177
+ getHeaderNameByKind(sectionDef) {
178
+ // User defined sections have their own header.
179
+ const { header, kind } = sectionDef;
180
+ if (kind === 'user-defined') {
181
+ if (header !== undefined) {
182
+ return header.trim();
183
+ }
184
+ console.warn('sectionDef of kind user-defined');
185
+ return 'User Defined';
186
+ }
187
+ if (header !== undefined) {
188
+ console.warn('header', header, 'ignored in sectionDef of kind', kind);
189
+ }
190
+ // ------------------------------------------------------------------------
191
+ const sectionHeader = sectionHeaders[kind];
192
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
193
+ if (sectionHeader === undefined) {
194
+ console.error(util.inspect(sectionDef, { compact: false, depth: 999 }));
195
+ console.error(sectionDef.constructor.name, 'kind', kind, 'not yet rendered in', this.constructor.name, 'getHeaderNameByKind');
196
+ return '';
197
+ }
198
+ return sectionHeader[0].trim();
199
+ }
200
+ getSectionOrderByKind() {
201
+ const { kind } = this;
202
+ if (kind === 'user-defined') {
203
+ return 1000; // At the end.
204
+ }
205
+ const header = sectionHeaders[kind];
206
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
207
+ assert(header !== undefined);
208
+ return header[1];
209
+ }
210
+ // --------------------------------------------------------------------------
211
+ renderIndexToLines() {
212
+ const lines = [];
213
+ // console.log(sectionDef)
214
+ if (this.indexMembers.length > 0) {
215
+ lines.push('');
216
+ lines.push(`## ${this.headerName} Index`);
217
+ lines.push('');
218
+ lines.push('<table class="doxyMembersIndex">');
219
+ for (const member of this.indexMembers) {
220
+ if (member instanceof Member) {
221
+ lines.push(...member.renderIndexToLines());
222
+ }
223
+ else if (member instanceof MemberRef) {
224
+ const referredMember = this.compound.collection.workspace.viewModel.membersById.get(member.refid);
225
+ assert(referredMember !== undefined);
226
+ lines.push(...referredMember.renderIndexToLines());
227
+ }
228
+ }
229
+ lines.push('');
230
+ lines.push('</table>');
231
+ }
232
+ return lines;
233
+ }
234
+ // --------------------------------------------------------------------------
235
+ renderToLines() {
236
+ const lines = [];
237
+ if (!this.hasDefinitionMembers()) {
238
+ return lines;
239
+ }
240
+ // TODO: filter out members defined in other compounds.
241
+ lines.push('');
242
+ lines.push('<div class="doxySectionDef">');
243
+ lines.push('');
244
+ lines.push(`## ${this.headerName}`);
245
+ if (this.descriptionLines !== undefined) {
246
+ lines.push('');
247
+ lines.push(...this.compound.renderDetailedDescriptionToHtmlLines({
248
+ detailedDescriptionHtmlLines: this.descriptionLines,
249
+ showHeader: false,
250
+ }));
251
+ }
252
+ for (const member of this.definitionMembers) {
253
+ lines.push(...member.renderToLines());
254
+ }
255
+ lines.push('');
256
+ lines.push('</div>');
257
+ return lines;
258
+ }
259
+ }
260
+ // ----------------------------------------------------------------------------
261
+ class MemberBase {
262
+ section;
263
+ name;
264
+ constructor(section, name) {
265
+ this.section = section;
266
+ this.name = name;
267
+ }
268
+ // Intentionally left blank for subclasses to override.
269
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
270
+ initializeLate() { }
271
+ }
272
+ export class Member extends MemberBase {
273
+ id;
274
+ kind;
275
+ briefDescriptionHtmlString;
276
+ detailedDescriptionHtmlLines;
277
+ argsstring;
278
+ qualifiedName;
279
+ definition;
280
+ type;
281
+ // Markdown, since it may include constructs like []().
282
+ initializerHtmlLines;
283
+ locationMarkdownLines;
284
+ templateParameters;
285
+ enumHtmlLines;
286
+ parametersHtmlString;
287
+ programListing;
288
+ referencedByMarkdownString;
289
+ referencesMarkdownString;
290
+ enumValues;
291
+ labels = [];
292
+ isTrailingType = false;
293
+ isConstexpr = false;
294
+ isStrong = false;
295
+ isConst = false;
296
+ isStatic = false;
297
+ _private = {};
298
+ constructor(section, memberDef) {
299
+ super(section, memberDef.name);
300
+ this._private._memberDef = memberDef;
301
+ const { id, kind } = memberDef;
302
+ this.id = id;
303
+ this.kind = kind;
304
+ }
305
+ initializeLate() {
306
+ super.initializeLate();
307
+ const { _memberDef: memberDef } = this._private;
308
+ assert(memberDef !== undefined);
309
+ const { workspace } = this.section.compound.collection;
310
+ if (memberDef.briefDescription !== undefined) {
311
+ // console.log(memberDef.briefDescription)
312
+ assert(memberDef.briefDescription.children !== undefined);
313
+ for (const child of memberDef.briefDescription.children) {
314
+ if (child instanceof ParaDataModel) {
315
+ child.skipPara = true;
316
+ }
317
+ }
318
+ this.briefDescriptionHtmlString = workspace
319
+ .renderElementToString(memberDef.briefDescription, 'html')
320
+ .trim();
321
+ }
322
+ if (memberDef.detailedDescription !== undefined) {
323
+ this.detailedDescriptionHtmlLines = workspace.renderElementToLines(memberDef.detailedDescription, 'html');
324
+ }
325
+ const { argsstring } = memberDef;
326
+ this.argsstring = argsstring;
327
+ if (memberDef.type !== undefined) {
328
+ this.type = workspace.renderElementToString(memberDef.type, 'html').trim();
329
+ }
330
+ if (memberDef.initializer !== undefined) {
331
+ this.initializerHtmlLines = workspace.renderElementToLines(memberDef.initializer, 'html');
332
+ }
333
+ if (memberDef.location !== undefined) {
334
+ this.locationMarkdownLines = this.section.compound.renderLocationToLines(memberDef.location);
335
+ if (workspace.options.renderProgramListingInline) {
336
+ this.programListing = this.filterProgramListingForLocation(memberDef.location);
337
+ }
338
+ }
339
+ if (memberDef.references !== undefined) {
340
+ this.referencesMarkdownString =
341
+ this.section.compound.renderReferencesToHtmlString(memberDef.references);
342
+ }
343
+ if (memberDef.referencedBy !== undefined) {
344
+ this.referencedByMarkdownString =
345
+ this.section.compound.renderReferencedByToHtmlString(memberDef.referencedBy);
346
+ }
347
+ const labels = [];
348
+ if (memberDef.inline?.valueOf() ?? false) {
349
+ labels.push('inline');
350
+ }
351
+ if (memberDef.explicit?.valueOf() ?? false) {
352
+ labels.push('explicit');
353
+ }
354
+ if (memberDef.nodiscard?.valueOf() ?? false) {
355
+ labels.push('nodiscard');
356
+ }
357
+ if (memberDef.constexpr?.valueOf() ?? false) {
358
+ labels.push('constexpr');
359
+ }
360
+ if (memberDef.noexcept?.valueOf() ?? false) {
361
+ labels.push('noexcept');
362
+ }
363
+ if (memberDef.prot === 'protected') {
364
+ labels.push('protected');
365
+ }
366
+ if (memberDef.staticc?.valueOf() ?? false) {
367
+ this.isStatic = true;
368
+ labels.push('static');
369
+ }
370
+ if (memberDef.virt !== undefined && memberDef.virt === 'virtual') {
371
+ labels.push('virtual');
372
+ }
373
+ // WARNING: there is no explicit attribute for 'delete'.
374
+ if (memberDef.argsstring?.endsWith('=delete') ?? false) {
375
+ labels.push('delete');
376
+ }
377
+ // WARNING: there is no explicit attribute for 'default'.
378
+ if (memberDef.argsstring?.endsWith('=default') ?? false) {
379
+ labels.push('default');
380
+ }
381
+ if (memberDef.strong?.valueOf() ?? false) {
382
+ labels.push('strong');
383
+ }
384
+ if (memberDef.mutable?.valueOf() ?? false) {
385
+ labels.push('mutable');
386
+ }
387
+ // WARNING: could not find how to generate 'inherited'.
388
+ this.labels = labels;
389
+ const type = this.type ?? '';
390
+ const templateParamList = memberDef.templateparamlist ??
391
+ this.section.compound.templateParamList;
392
+ if (this.section.compound.isTemplate(templateParamList) &&
393
+ (type.includes('decltype(') ||
394
+ (type.includes('&lt;') && type.includes('&gt;')))) {
395
+ this.isTrailingType = true;
396
+ }
397
+ if (templateParamList?.params !== undefined) {
398
+ this.templateParameters = sanitizeAnonymousNamespace(this.section.compound.renderTemplateParametersToString({
399
+ templateParamList,
400
+ withDefaults: true,
401
+ }));
402
+ }
403
+ if (memberDef.params !== undefined) {
404
+ const parameters = [];
405
+ for (const param of memberDef.params) {
406
+ parameters.push(workspace.renderElementToString(param, 'html').trim());
407
+ }
408
+ if (parameters.length > 0) {
409
+ this.parametersHtmlString = parameters.join(', ');
410
+ }
411
+ }
412
+ if (memberDef.kind === 'enum' && memberDef.enumvalues !== undefined) {
413
+ const enumValues = [];
414
+ for (const enumValueDataModel of memberDef.enumvalues) {
415
+ enumValues.push(new EnumValue(this, enumValueDataModel));
416
+ }
417
+ if (enumValues.length > 0) {
418
+ this.enumValues = enumValues;
419
+ this.enumHtmlLines = this.renderEnumToLines();
420
+ }
421
+ }
422
+ if (memberDef.qualifiedName !== undefined) {
423
+ this.qualifiedName = sanitizeAnonymousNamespace(memberDef.qualifiedName);
424
+ }
425
+ if (memberDef.definition !== undefined) {
426
+ this.definition = sanitizeAnonymousNamespace(memberDef.definition);
427
+ }
428
+ if ((memberDef.constexpr?.valueOf() ?? false) &&
429
+ !type.includes('constexpr')) {
430
+ this.isConstexpr = true;
431
+ }
432
+ this.isStrong = memberDef.strong?.valueOf() ?? false;
433
+ this.isConst = memberDef.constt?.valueOf() ?? false;
434
+ // Clear the reference, it is no longer needed.
435
+ this._private._memberDef = undefined;
436
+ }
437
+ filterProgramListingForLocation(location) {
438
+ // console.log(location)
439
+ const { workspace } = this.section.compound.collection;
440
+ if (location === undefined) {
441
+ return undefined;
442
+ }
443
+ let programListing = undefined;
444
+ let definitionFile = undefined;
445
+ let startLine = -1;
446
+ let endLine = -1;
447
+ if (location.bodyfile !== undefined) {
448
+ definitionFile = workspace.filesByPath.get(location.bodyfile);
449
+ if (definitionFile === undefined) {
450
+ console.log('no definition');
451
+ return undefined;
452
+ }
453
+ if (definitionFile.programListing === undefined) {
454
+ console.log('no listing');
455
+ return undefined;
456
+ }
457
+ if (location.bodystart !== undefined) {
458
+ startLine = location.bodystart.valueOf();
459
+ if (location.bodyend !== undefined) {
460
+ endLine = location.bodyend.valueOf();
461
+ }
462
+ if (endLine === -1) {
463
+ endLine = startLine;
464
+ }
465
+ }
466
+ else {
467
+ return undefined;
468
+ }
469
+ // console.log(definitionFile.indexName, startLine, endLine)
470
+ programListing = new MemberProgramListingDataModel(definitionFile.programListing, startLine, endLine);
471
+ // } else if (location.file !== undefined) {
472
+ // definitionFile = workspace.filesByPath.get(location.file)
473
+ // if (definitionFile === undefined) {
474
+ // console.log('no definition')
475
+ // return undefined
476
+ // }
477
+ // if (definitionFile.programListing === undefined) {
478
+ // console.log('no listing')
479
+ // return undefined
480
+ // }
481
+ // if (location.line !== undefined) {
482
+ // startLine = location.line.valueOf()
483
+ // endLine = startLine
484
+ // } else {
485
+ // return undefined
486
+ // }
487
+ }
488
+ if (definitionFile?.programListing !== undefined) {
489
+ // console.log(definitionFile.indexName, startLine, endLine)
490
+ programListing = new MemberProgramListingDataModel(definitionFile.programListing, startLine, endLine);
491
+ }
492
+ // console.log(programListing)
493
+ return programListing;
494
+ }
495
+ // --------------------------------------------------------------------------
496
+ renderIndexToLines() {
497
+ // console.log(util.inspect(this, { compact: false, depth: 999 }))
498
+ const lines = [];
499
+ const workspace = this.section.compound.collection.workspace;
500
+ const permalink = workspace.getPermalink({
501
+ refid: this.id,
502
+ kindref: 'member',
503
+ });
504
+ assert(permalink !== undefined && permalink.length > 1);
505
+ const name = workspace.renderString(this.name, 'html');
506
+ let itemTemplate = '';
507
+ let itemType = '';
508
+ let itemName = `<a href="${permalink}">${name}</a>`;
509
+ if (this.templateParameters !== undefined &&
510
+ this.templateParameters.length > 0) {
511
+ if (this.templateParameters.length < 64) {
512
+ itemTemplate = workspace.renderString(`template ${this.templateParameters}`, 'html');
513
+ }
514
+ else {
515
+ itemTemplate = workspace.renderString('template < ... >', 'html');
516
+ }
517
+ }
518
+ switch (this.kind) {
519
+ case 'typedef':
520
+ if (this.definition?.startsWith('typedef') ?? false) {
521
+ itemType = 'typedef';
522
+ assert(this.type !== undefined);
523
+ itemName = `${this.type} ${itemName}`;
524
+ if (this.argsstring !== undefined) {
525
+ itemName += this.argsstring;
526
+ }
527
+ }
528
+ else if (this.definition?.startsWith('using') ?? false) {
529
+ itemType = 'using';
530
+ if (this.type !== undefined) {
531
+ itemName += ' = ';
532
+ itemName += this.type;
533
+ }
534
+ }
535
+ else {
536
+ console.error('Unsupported typedef in member', this.definition);
537
+ }
538
+ break;
539
+ case 'function':
540
+ {
541
+ // WARNING: the rule to decide which type is trailing is not
542
+ // in the XMLs.
543
+ // https://github.com/doxygen/doxygen/discussions/11568
544
+ // TODO: improve.
545
+ const type = this.type ?? '';
546
+ if (this.isStatic) {
547
+ itemType += 'static ';
548
+ }
549
+ if (this.isConstexpr) {
550
+ itemType += 'constexpr ';
551
+ }
552
+ if (this.argsstring !== undefined) {
553
+ itemName += ' ';
554
+ itemName += workspace.renderString(this.argsstring, 'html');
555
+ }
556
+ if (this.isTrailingType) {
557
+ if (!itemType.includes('auto')) {
558
+ itemType += 'auto ';
559
+ }
560
+ // WARNING: Doxygen shows this, but the resulting line is too long.
561
+ itemName += workspace.renderString(' -> ', 'html');
562
+ itemName += type;
563
+ }
564
+ else {
565
+ itemType += type;
566
+ }
567
+ if (this.initializerHtmlLines !== undefined) {
568
+ // Show only short initializers in the index.
569
+ itemName += ' ';
570
+ if (this.initializerHtmlLines.length === 1) {
571
+ itemName += this.initializerHtmlLines[0];
572
+ }
573
+ else {
574
+ itemName += '= ...';
575
+ }
576
+ }
577
+ }
578
+ break;
579
+ case 'variable':
580
+ if (this.isStatic) {
581
+ itemType += 'static ';
582
+ }
583
+ if (this.isConstexpr) {
584
+ itemType += 'constexpr ';
585
+ }
586
+ assert(this.type !== undefined);
587
+ itemType += this.type;
588
+ if (this.definition?.startsWith('struct ') ?? false) {
589
+ itemType = workspace.renderString('struct { ... }', 'html');
590
+ }
591
+ else if (this.definition?.startsWith('class ') ?? false) {
592
+ itemType = workspace.renderString('class { ... }', 'html');
593
+ }
594
+ if (this.argsstring !== undefined) {
595
+ itemName += this.argsstring;
596
+ }
597
+ if (this.initializerHtmlLines !== undefined) {
598
+ // Show only short initializers in the index.
599
+ itemName += ' ';
600
+ if (this.initializerHtmlLines.length === 1) {
601
+ itemName += this.initializerHtmlLines[0];
602
+ }
603
+ else {
604
+ itemName += '= ...';
605
+ }
606
+ }
607
+ break;
608
+ case 'enum':
609
+ // console.log(this)
610
+ itemType = '';
611
+ if (this.name.length === 0) {
612
+ itemType += 'anonymous ';
613
+ }
614
+ itemType += 'enum';
615
+ if (this.isStrong) {
616
+ itemType += ' class';
617
+ }
618
+ itemName = this.name;
619
+ if (this.type !== undefined && this.type.length > 0) {
620
+ itemName += ` : ${this.type}`;
621
+ }
622
+ itemName += workspace.renderString(' { ', 'html');
623
+ itemName += `<a href="${permalink}">...</a>`;
624
+ itemName += workspace.renderString(' }', 'html');
625
+ break;
626
+ case 'friend':
627
+ // console.log(this)
628
+ itemType = this.type ?? 'class';
629
+ break;
630
+ case 'define':
631
+ // console.log(this)
632
+ itemType = '#define';
633
+ if (this.parametersHtmlString !== undefined) {
634
+ itemName += `(${this.parametersHtmlString})`;
635
+ }
636
+ if (this.initializerHtmlLines !== undefined) {
637
+ itemName += '&nbsp;&nbsp;&nbsp;';
638
+ if (this.initializerHtmlLines.length === 1) {
639
+ itemName += this.initializerHtmlLines[0];
640
+ }
641
+ else {
642
+ itemName += '...';
643
+ }
644
+ }
645
+ break;
646
+ default:
647
+ console.error('member kind', this.kind, 'not implemented yet in', this.constructor.name, 'renderIndexToLines');
648
+ }
649
+ lines.push('');
650
+ if (itemName.length === 0) {
651
+ if (this.section.compound.collection.workspace.options.debug) {
652
+ console.log(this);
653
+ }
654
+ console.warn('empty name in', this.id);
655
+ }
656
+ const childrenLines = [];
657
+ const { briefDescriptionHtmlString: briefDescriptionString } = this;
658
+ if (briefDescriptionString !== undefined &&
659
+ briefDescriptionString.length > 0) {
660
+ childrenLines.push(this.section.compound.renderBriefDescriptionToHtmlString({
661
+ briefDescriptionHtmlString: briefDescriptionString,
662
+ morePermalink: permalink, // No #details, it is already an anchor.
663
+ }));
664
+ }
665
+ lines.push(...workspace.renderMembersIndexItemToHtmlLines({
666
+ template: itemTemplate,
667
+ type: itemType,
668
+ name: itemName,
669
+ childrenLines,
670
+ }));
671
+ return lines;
672
+ }
673
+ // --------------------------------------------------------------------------
674
+ renderToLines() {
675
+ const lines = [];
676
+ const workspace = this.section.compound.collection.workspace;
677
+ const isFunction = this.section.kind.startsWith('func') ||
678
+ this.section.kind.endsWith('func') ||
679
+ this.section.kind.endsWith('constructorr') ||
680
+ this.section.kind.endsWith('destructor') ||
681
+ this.section.kind.endsWith('operator');
682
+ const id = getPermalinkAnchor(this.id);
683
+ const name = this.name + (isFunction ? '()' : '');
684
+ lines.push('');
685
+ if (this.kind !== 'enum') {
686
+ lines.push(`### ${workspace.renderString(name, 'markdown')} {#${id}}`);
687
+ }
688
+ let template = undefined;
689
+ let prototype = undefined;
690
+ const { labels } = this;
691
+ const childrenLines = [];
692
+ // console.log(memberDef.kind)
693
+ switch (this.kind) {
694
+ case 'function':
695
+ case 'typedef':
696
+ case 'variable':
697
+ // WARNING: the rule to decide which type is trailing is not in XMLs.
698
+ // TODO: improve.
699
+ assert(this.definition !== undefined);
700
+ prototype = workspace.renderString(this.definition, 'html');
701
+ if (this.isStatic) {
702
+ // The html pages show `static` only as a label; strip it.
703
+ prototype = prototype.replace(/^static /, '');
704
+ }
705
+ if (this.kind === 'function') {
706
+ prototype += ' (';
707
+ if (this.parametersHtmlString !== undefined) {
708
+ prototype += this.parametersHtmlString;
709
+ }
710
+ prototype += ')';
711
+ }
712
+ if (this.initializerHtmlLines !== undefined) {
713
+ if (this.initializerHtmlLines.length === 1) {
714
+ prototype += ` ${this.initializerHtmlLines[0]}`;
715
+ }
716
+ }
717
+ if (this.templateParameters !== undefined &&
718
+ this.templateParameters.length > 0) {
719
+ template = workspace.renderString(`template ${this.templateParameters}`, 'html');
720
+ }
721
+ if (this.briefDescriptionHtmlString !== undefined) {
722
+ childrenLines.push(this.section.compound.renderBriefDescriptionToHtmlString({
723
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
724
+ }));
725
+ }
726
+ if (this.initializerHtmlLines !== undefined &&
727
+ this.initializerHtmlLines.length > 1) {
728
+ childrenLines.push('');
729
+ childrenLines.push('<dl class="doxySectionUser">');
730
+ childrenLines.push('<dt>Initialiser</dt>');
731
+ childrenLines.push('<dd>');
732
+ if (this.initializerHtmlLines.length === 1) {
733
+ childrenLines.push(`<div class="doxyVerbatim">${this.initializerHtmlLines[0]}</div>`);
734
+ }
735
+ else {
736
+ childrenLines.push(`<div class="doxyVerbatim">${this.initializerHtmlLines[0]}`);
737
+ for (const initializerLine of this.initializerHtmlLines.slice(1)) {
738
+ if (initializerLine.trim().length > 0) {
739
+ childrenLines.push(initializerLine);
740
+ // } else {
741
+ // childrenLines.push('&nbsp;')
742
+ }
743
+ }
744
+ childrenLines.push('</div>');
745
+ }
746
+ childrenLines.push('</dd>');
747
+ childrenLines.push('</dl>');
748
+ }
749
+ if (this.detailedDescriptionHtmlLines !== undefined) {
750
+ childrenLines.push(...this.section.compound.renderDetailedDescriptionToHtmlLines({
751
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
752
+ detailedDescriptionHtmlLines: this.detailedDescriptionHtmlLines,
753
+ showHeader: false,
754
+ showBrief: false,
755
+ }));
756
+ }
757
+ break;
758
+ case 'enum':
759
+ prototype = '';
760
+ if (this.name.length === 0) {
761
+ prototype += 'anonymous ';
762
+ }
763
+ prototype += 'enum ';
764
+ if (this.isStrong) {
765
+ prototype += 'class ';
766
+ }
767
+ if (this.name.length > 0) {
768
+ lines.push(`### ${workspace.renderString(name, 'markdown')} {#${id}}`);
769
+ }
770
+ else {
771
+ lines.push(`### ${prototype} {#${id}}`);
772
+ }
773
+ if (this.briefDescriptionHtmlString !== undefined &&
774
+ this.briefDescriptionHtmlString.length > 0) {
775
+ childrenLines.push(this.section.compound.renderBriefDescriptionToHtmlString({
776
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
777
+ }));
778
+ }
779
+ if (this.enumHtmlLines !== undefined) {
780
+ childrenLines.push(...this.enumHtmlLines);
781
+ }
782
+ if (this.detailedDescriptionHtmlLines !== undefined) {
783
+ childrenLines.push(...this.section.compound.renderDetailedDescriptionToHtmlLines({
784
+ detailedDescriptionHtmlLines: this.detailedDescriptionHtmlLines,
785
+ showHeader: false,
786
+ showBrief: false,
787
+ }));
788
+ }
789
+ if (this.name.length > 0 && this.qualifiedName !== undefined) {
790
+ prototype += `${workspace.renderString(this.qualifiedName, 'html')} `;
791
+ }
792
+ else if (this.name.length > 0) {
793
+ prototype += `${workspace.renderString(this.name, 'html')} `;
794
+ }
795
+ if (this.type !== undefined && this.type.length > 0) {
796
+ prototype += `: ${this.type}`;
797
+ }
798
+ break;
799
+ case 'friend':
800
+ // console.log(this)
801
+ assert(this.type !== undefined);
802
+ prototype = `friend ${this.type}`;
803
+ if (this.parametersHtmlString !== undefined) {
804
+ prototype += ` ${this.parametersHtmlString}`;
805
+ }
806
+ if (this.detailedDescriptionHtmlLines !== undefined) {
807
+ childrenLines.push(...this.section.compound.renderDetailedDescriptionToHtmlLines({
808
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
809
+ detailedDescriptionHtmlLines: this.detailedDescriptionHtmlLines,
810
+ showHeader: false,
811
+ showBrief: true,
812
+ }));
813
+ }
814
+ break;
815
+ case 'define':
816
+ // console.log(this)
817
+ prototype = `#define ${name}`;
818
+ if (this.parametersHtmlString !== undefined) {
819
+ prototype += `(${this.parametersHtmlString})`;
820
+ }
821
+ if (this.initializerHtmlLines !== undefined) {
822
+ prototype += '&nbsp;&nbsp;&nbsp;';
823
+ if (this.initializerHtmlLines.length === 1) {
824
+ prototype += this.initializerHtmlLines[0];
825
+ }
826
+ else {
827
+ prototype += '...';
828
+ }
829
+ }
830
+ if (this.briefDescriptionHtmlString !== undefined) {
831
+ childrenLines.push(this.section.compound.renderBriefDescriptionToHtmlString({
832
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
833
+ }));
834
+ }
835
+ if (this.initializerHtmlLines !== undefined &&
836
+ this.initializerHtmlLines.length > 1) {
837
+ childrenLines.push('');
838
+ childrenLines.push('<dl class="doxySectionUser">');
839
+ childrenLines.push('<dt>Value</dt>');
840
+ childrenLines.push('<dd>');
841
+ if (this.initializerHtmlLines.length === 1) {
842
+ childrenLines.push(`<div class="doxyVerbatim">${this.initializerHtmlLines[0]}</div>`);
843
+ }
844
+ else {
845
+ childrenLines.push(`<div class="doxyVerbatim">${this.initializerHtmlLines[0]}`);
846
+ for (const initializerLine of this.initializerHtmlLines.slice(1)) {
847
+ if (initializerLine.trim().length > 0) {
848
+ childrenLines.push(initializerLine);
849
+ // } else {
850
+ // childrenLines.push('&nbsp;')
851
+ }
852
+ }
853
+ childrenLines.push('</div>');
854
+ }
855
+ childrenLines.push('</dd>');
856
+ childrenLines.push('</dl>');
857
+ }
858
+ childrenLines.push(...this.section.compound.renderDetailedDescriptionToHtmlLines({
859
+ briefDescriptionHtmlString: this.briefDescriptionHtmlString,
860
+ detailedDescriptionHtmlLines: this.detailedDescriptionHtmlLines,
861
+ showHeader: false,
862
+ showBrief: false,
863
+ }));
864
+ break;
865
+ default:
866
+ lines.push('');
867
+ console.warn('memberDef', this.kind, this.name, 'not implemented yet in', this.constructor.name, 'renderToLines');
868
+ }
869
+ if (this.locationMarkdownLines !== undefined) {
870
+ childrenLines.push(...this.locationMarkdownLines);
871
+ }
872
+ if (this.programListing !== undefined) {
873
+ childrenLines.push(...this.section.compound.collection.workspace.renderElementToLines(this.programListing, 'html'));
874
+ }
875
+ if (this.referencesMarkdownString !== undefined) {
876
+ childrenLines.push('');
877
+ childrenLines.push(this.referencesMarkdownString);
878
+ }
879
+ if (this.referencedByMarkdownString !== undefined) {
880
+ childrenLines.push('');
881
+ childrenLines.push(this.referencedByMarkdownString);
882
+ }
883
+ lines.push('');
884
+ if (prototype !== undefined) {
885
+ lines.push(...this.renderMemberDefinitionToLines({
886
+ template,
887
+ prototype,
888
+ labels,
889
+ childrenLines,
890
+ }));
891
+ }
892
+ return lines;
893
+ }
894
+ renderMemberDefinitionToLines({ template, prototype, labels, childrenLines, }) {
895
+ const lines = [];
896
+ lines.push('<div class="doxyMemberItem">');
897
+ lines.push('<div class="doxyMemberProto">');
898
+ if (template !== undefined && template.length > 0) {
899
+ lines.push(`<div class="doxyMemberTemplate">${template}</div>`);
900
+ }
901
+ lines.push('<table class="doxyMemberLabels">');
902
+ lines.push('<tr class="doxyMemberLabels">');
903
+ lines.push('<td class="doxyMemberLabelsLeft">');
904
+ lines.push('<table class="doxyMemberName">');
905
+ lines.push('<tr>');
906
+ lines.push(`<td class="doxyMemberName">${prototype}</td>`);
907
+ lines.push('</tr>');
908
+ lines.push('</table>');
909
+ lines.push('</td>');
910
+ if (labels.length > 0) {
911
+ lines.push('<td class="doxyMemberLabelsRight">');
912
+ lines.push('<span class="doxyMemberLabels">');
913
+ for (const label of labels) {
914
+ lines.push(`<span class="doxyMemberLabel ${label}">${label}</span>`);
915
+ }
916
+ lines.push('</span>');
917
+ lines.push('</td>');
918
+ }
919
+ lines.push('</tr>');
920
+ lines.push('</table>');
921
+ lines.push('</div>');
922
+ lines.push('<div class="doxyMemberDoc">');
923
+ lines.push(''); // Required to make the first line a separate paragraph.
924
+ lines.push(...childrenLines);
925
+ lines.push('</div>');
926
+ lines.push('</div>');
927
+ return lines;
928
+ }
929
+ // --------------------------------------------------------------------------
930
+ renderEnumToLines() {
931
+ const lines = [];
932
+ lines.push('');
933
+ lines.push('<dl class="doxyEnumList">');
934
+ lines.push('<dt class="doxyEnumTableTitle">Enumeration values</dt>');
935
+ lines.push('<dd>');
936
+ lines.push('<table class="doxyEnumTable">');
937
+ if (this.enumValues !== undefined) {
938
+ for (const enumValue of this.enumValues) {
939
+ const anchor = getPermalinkAnchor(enumValue.id);
940
+ let enumBriefDescriptionHtmlString = (enumValue.briefDescriptionHtmlString ?? '').replace(/[.]$/, '');
941
+ // console.log(`|${enumBriefDescription}|`)
942
+ const { initializerHtmlString: value } = enumValue;
943
+ if (value !== undefined && value.length > 0) {
944
+ enumBriefDescriptionHtmlString += ` (${value})`;
945
+ }
946
+ lines.push('');
947
+ // lines.push(`<a id="${anchor}"></a>`)
948
+ lines.push('<tr class="doxyEnumItem">');
949
+ lines.push(`<td class="doxyEnumItemName">${enumValue.name}` +
950
+ `<a id="${anchor}"></a></td>`);
951
+ // lines.push(`<td class="doxyEnumItemDescription">`+
952
+ // `<p>${enumBriefDescription}</p></td>`)
953
+ if (!enumBriefDescriptionHtmlString.includes('\n')) {
954
+ lines.push(`<td class="doxyEnumItemDescription">` +
955
+ `${enumBriefDescriptionHtmlString}</td>`);
956
+ }
957
+ else {
958
+ lines.push('<td class="doxyEnumItemDescription">');
959
+ lines.push(...enumBriefDescriptionHtmlString.split('\n'));
960
+ lines.push('</td>');
961
+ }
962
+ lines.push('</tr>');
963
+ }
964
+ }
965
+ lines.push('');
966
+ lines.push('</table>');
967
+ lines.push('</dd>');
968
+ lines.push('</dl>');
969
+ return lines;
970
+ }
971
+ }
972
+ // ----------------------------------------------------------------------------
973
+ export class MemberRef extends MemberBase {
974
+ // memberRef: MemberDataModel
975
+ refid;
976
+ constructor(section, memberRef) {
977
+ super(section, memberRef.name);
978
+ // this.memberRef = memberRef
979
+ const { refid } = memberRef;
980
+ this.refid = refid;
981
+ }
982
+ }
983
+ // ----------------------------------------------------------------------------
984
+ export class EnumValue {
985
+ name;
986
+ id;
987
+ briefDescriptionHtmlString;
988
+ initializerHtmlString;
989
+ member;
990
+ constructor(member, enumValue) {
991
+ this.member = member;
992
+ this.name = enumValue.name.trim();
993
+ const { id } = enumValue;
994
+ this.id = id;
995
+ const workspace = member.section.compound.collection.workspace;
996
+ if (enumValue.briefDescription !== undefined) {
997
+ assert(enumValue.briefDescription.children != null);
998
+ for (const child of enumValue.briefDescription.children) {
999
+ if (child instanceof ParaDataModel) {
1000
+ child.skipPara = true;
1001
+ }
1002
+ }
1003
+ }
1004
+ if (enumValue.briefDescription?.children !== undefined) {
1005
+ workspace.skipElementsPara(enumValue.briefDescription.children);
1006
+ this.briefDescriptionHtmlString = workspace
1007
+ .renderElementToString(enumValue.briefDescription, 'html')
1008
+ .trim();
1009
+ }
1010
+ if (enumValue.initializer !== undefined) {
1011
+ this.initializerHtmlString = workspace.renderElementToString(enumValue.initializer, 'html');
1012
+ }
1013
+ // console.log(this)
1014
+ }
1015
+ }
1016
+ // ----------------------------------------------------------------------------
1017
+ //# sourceMappingURL=members-vm.js.map