@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,788 @@
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
+ import * as fs from 'node:fs/promises'
18
+
19
+ import { Workspace } from './workspace.js'
20
+ import { CliOptions, maxParallelPromises } from './cli-options.js'
21
+ import type { SidebarCategory, FrontMatter, NavbarItem } from './types.js'
22
+ import { folderExists } from './utils.js'
23
+ import { Page } from './view-model/pages-vm.js'
24
+ import type { Pages } from './view-model/pages-vm.js'
25
+ import type { Groups } from './view-model/groups-vm.js'
26
+ import type { CompoundBase } from './view-model/compound-base-vm.js'
27
+ // import type { File } from '../view-model/files-and-folders-vm.js'
28
+
29
+ // ----------------------------------------------------------------------------
30
+
31
+ /**
32
+ * Generates Docusaurus-compatible Markdown files and configuration from
33
+ * Doxygen XML output.
34
+ *
35
+ * @remarks
36
+ * This class orchestrates the conversion process, creating documentation pages,
37
+ * navigation structures, and associated assets for integration with Docusaurus
38
+ * websites. It handles parallel processing for performance optimisation and
39
+ * manages the complete workflow from XML parsing to final site generation.
40
+ *
41
+ * @public
42
+ */
43
+ export class DocusaurusGenerator {
44
+ /** The workspace containing the data model and configuration options. */
45
+ workspace: Workspace
46
+
47
+ /** CLI options that control the generation process. */
48
+ options: CliOptions
49
+
50
+ // --------------------------------------------------------------------------
51
+
52
+ /**
53
+ * Constructs a new Docusaurus generator instance.
54
+ *
55
+ * @remarks
56
+ * Initialises the generator with the provided workspace, which contains
57
+ * the parsed Doxygen data model and configuration options required for
58
+ * the generation process.
59
+ *
60
+ * @param workspace - The workspace containing the data model and
61
+ * configuration.
62
+ */
63
+ constructor(workspace: Workspace) {
64
+ this.workspace = workspace
65
+
66
+ this.options = workspace.options
67
+ }
68
+
69
+ // --------------------------------------------------------------------------
70
+
71
+ /**
72
+ * Executes the complete generation process.
73
+ *
74
+ * @remarks
75
+ * Orchestrates the creation of all Docusaurus assets including Markdown
76
+ * files, navigation structures, redirect files, and static assets. The
77
+ * process follows a specific sequence to ensure proper dependencies and
78
+ * optimal performance through parallel processing where appropriate.
79
+ *
80
+ * @returns A promise that resolves to the exit code (0 for success).
81
+ */
82
+ async run(): Promise<number> {
83
+ console.log()
84
+
85
+ await this.prepareOutputFolder()
86
+ // No longer used with CommonMarkdown output.
87
+ // await this.generateConfigurationFile()
88
+
89
+ console.log()
90
+ if (this.options.verbose) {
91
+ console.log('Writing Docusaurus .md pages (object -> url)...')
92
+ } else {
93
+ console.log('Writing Docusaurus .md pages...')
94
+ }
95
+ await this.generateMdFiles()
96
+
97
+ if (this.options.verbose) {
98
+ console.log()
99
+ }
100
+ await this.generateTopIndexDotMdFile()
101
+ await this.generateCollectionsIndexDotMdFiles()
102
+ await this.generatePerInitialsIndexDotMdFiles()
103
+ console.log(this.workspace.writtenMdFilesCounter, '.md files written')
104
+
105
+ console.log()
106
+ const sidebarCategory = this.generateSidebarCategory()
107
+ await this.writeSidebarFile(sidebarCategory)
108
+
109
+ // await this.generateSidebarFile()
110
+
111
+ if (this.options.navbarDropdownFilePath.trim().length > 0) {
112
+ const navbarItem = this.generateNavbarItem()
113
+ await this.writeNavbarFile(navbarItem)
114
+ }
115
+
116
+ // await this.generateMenuFile()
117
+
118
+ // await this.generateManualRedirectFiles()
119
+ await this.generateCompatibilityRedirectFiles()
120
+
121
+ await this.copyFiles()
122
+ await this.copyImageFiles()
123
+
124
+ return 0
125
+ }
126
+
127
+ // --------------------------------------------------------------------------
128
+
129
+ /**
130
+ * Prepares the output folder for generated content.
131
+ *
132
+ * @remarks
133
+ * Removes any existing output folder and creates a new empty directory
134
+ * structure for the generated Docusaurus files. This ensures a clean
135
+ * starting state for each generation run and prevents conflicts with
136
+ * previous builds.
137
+ */
138
+ // https://nodejs.org/en/learn/manipulating-files/working-with-folders-in-nodejs
139
+ async prepareOutputFolder(): Promise<void> {
140
+ const { outputFolderPath } = this.workspace
141
+ try {
142
+ await fs.access(outputFolderPath)
143
+ // Remove the folder if it exist.
144
+ console.log(`Removing existing folder '${outputFolderPath}'...`)
145
+ await fs.rm(outputFolderPath, { recursive: true, force: true })
146
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
147
+ } catch (err) {
148
+ // The folder does not exist, nothing to remove.
149
+ }
150
+ // Create the folder as empty.
151
+ await fs.mkdir(outputFolderPath, { recursive: true })
152
+ }
153
+
154
+ // --------------------------------------------------------------------------
155
+
156
+ /**
157
+ * Generates the sidebar category structure for Docusaurus navigation.
158
+ *
159
+ * @remarks
160
+ * Creates a hierarchical category structure that organises all generated
161
+ * documentation pages into a logical navigation tree. The structure includes
162
+ * top-level pages and follows the configured collection ordering to maintain
163
+ * consistent navigation patterns.
164
+ *
165
+ * @returns The complete sidebar category configuration object.
166
+ */
167
+ generateSidebarCategory(): SidebarCategory {
168
+ const sidebarTopCategory: SidebarCategory = {
169
+ type: 'category',
170
+ label: this.options.sidebarCategoryLabel,
171
+ link: {
172
+ type: 'doc',
173
+ id: `${this.workspace.sidebarBaseId}index`,
174
+ },
175
+ collapsed: false,
176
+ items: [],
177
+ }
178
+
179
+ const pages = this.workspace.viewModel.collections.get('pages') as Pages
180
+ pages.createTopPagesSidebarItems(sidebarTopCategory)
181
+
182
+ // The order in sidebarCollectionNames also gives the the order
183
+ // of items in the sidebar.
184
+ for (const collectionName of this.workspace.sidebarCollectionNames) {
185
+ // console.log(collectionName)
186
+ const collection =
187
+ this.workspace.viewModel.collections.get(collectionName)
188
+ if (collection?.isVisibleInSidebar() === true) {
189
+ collection.addSidebarItems(sidebarTopCategory)
190
+ }
191
+ }
192
+ return sidebarTopCategory
193
+ }
194
+
195
+ // --------------------------------------------------------------------------
196
+
197
+ /**
198
+ * Writes the sidebar configuration to a JSON file.
199
+ *
200
+ * @remarks
201
+ * Serialises the sidebar category structure and writes it to the configured
202
+ * output path for integration with Docusaurus. The resulting JSON file
203
+ * provides the complete navigation structure for the documentation site.
204
+ *
205
+ * @param sidebarCategory - The sidebar configuration to write.
206
+ */
207
+ async writeSidebarFile(sidebarCategory: SidebarCategory): Promise<void> {
208
+ // console.log(util.inspect(sidebar, { compact: false, depth: 999 }));
209
+ // Write the sidebar to file.
210
+
211
+ const sidebarFilePath = this.workspace.options.sidebarCategoryFilePath
212
+ console.log(`Writing sidebar file '${sidebarFilePath}'...`)
213
+ const sidebarJson = JSON.stringify(sidebarCategory, null, 2)
214
+ await fs.writeFile(sidebarFilePath, sidebarJson)
215
+ }
216
+
217
+ // --------------------------------------------------------------------------
218
+
219
+ /**
220
+ * Generates the navbar dropdown configuration for the top navigation.
221
+ *
222
+ * @remarks
223
+ * Creates a navigation menu structure that provides quick access to
224
+ * different sections of the generated documentation. When no items are
225
+ * available, falls back to a simple link format for consistency.
226
+ *
227
+ * @returns The navbar item configuration for Docusaurus.
228
+ */
229
+ generateNavbarItem(): NavbarItem {
230
+ let navbarEntry: NavbarItem = {
231
+ type: 'dropdown',
232
+ label: this.options.navbarDropdownLabel,
233
+ to: this.workspace.menuBaseUrl,
234
+ position: this.options.navbarDropdownPosition,
235
+ items: [],
236
+ }
237
+
238
+ let hasItems = false
239
+ // This is the order of items in the sidebar.
240
+ for (const collectionName of this.workspace.sidebarCollectionNames) {
241
+ // console.log(collectionName)
242
+ const collection =
243
+ this.workspace.viewModel.collections.get(collectionName)
244
+ if (collection?.isVisibleInSidebar() === true) {
245
+ assert(navbarEntry.items !== undefined)
246
+ const items = collection.createNavbarItems()
247
+ if (items.length > 0) {
248
+ navbarEntry.items.push(...collection.createNavbarItems())
249
+ hasItems = true
250
+ }
251
+ }
252
+ }
253
+
254
+ if (!hasItems) {
255
+ navbarEntry = {
256
+ label: this.options.navbarDropdownLabel,
257
+ to: this.workspace.menuBaseUrl,
258
+ position: this.options.navbarDropdownPosition,
259
+ }
260
+ }
261
+
262
+ return navbarEntry
263
+ }
264
+
265
+ /**
266
+ * Writes the navbar configuration to a JSON file.
267
+ *
268
+ * @remarks
269
+ * Serialises the navbar item structure and writes it to the configured
270
+ * output path for integration with Docusaurus navigation. The resulting
271
+ * JSON file provides the top-level navigation menu configuration.
272
+ *
273
+ * @param navbarItem - The navbar configuration to write.
274
+ */
275
+ async writeNavbarFile(navbarItem: NavbarItem): Promise<void> {
276
+ // console.log(util.inspect(navbarItem, { compact: false, depth: 999 }));
277
+ // Write the sidebar to file.
278
+
279
+ const navbarFilePath = this.workspace.options.navbarDropdownFilePath
280
+ console.log(`Writing navbar file '${navbarFilePath}'...`)
281
+
282
+ const navbarJson = JSON.stringify(navbarItem, null, 2)
283
+ await fs.writeFile(navbarFilePath, navbarJson)
284
+ }
285
+
286
+ // --------------------------------------------------------------------------
287
+
288
+ /**
289
+ * Generates index Markdown files for all collections.
290
+ *
291
+ * @remarks
292
+ * Creates overview pages for each documentation collection (classes, files,
293
+ * namespaces, etc.) that provide organised access to the content. These
294
+ * index files serve as entry points for navigating large documentation
295
+ * collections efficiently.
296
+ */
297
+ async generateCollectionsIndexDotMdFiles(): Promise<void> {
298
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
299
+ for (const [collectionName, collection] of this.workspace.viewModel
300
+ .collections) {
301
+ // console.log(collectionName)
302
+ await collection.generateIndexDotMdFile()
303
+ }
304
+ // TODO: parallelize
305
+ }
306
+
307
+ // --------------------------------------------------------------------------
308
+
309
+ /**
310
+ * Generates the main index Markdown file for the API documentation.
311
+ *
312
+ * @remarks
313
+ * Creates the landing page that serves as the entry point to the generated
314
+ * documentation, including topics overview and main page content. This
315
+ * combines the Doxygen @mainpage content with a structured topics table
316
+ * for comprehensive navigation.
317
+ */
318
+ async generateTopIndexDotMdFile(): Promise<void> {
319
+ const { outputFolderPath } = this.workspace
320
+ const filePath = `${outputFolderPath}index.md`
321
+
322
+ const projectBrief =
323
+ this.workspace.doxygenOptions.getOptionCdataValue('PROJECT_BRIEF')
324
+ const title =
325
+ this.options.mainPageTitle.length > 0
326
+ ? this.options.mainPageTitle
327
+ : `${projectBrief} API Reference`
328
+ const permalink = '' // The root of the API sub-site.
329
+
330
+ // This is the top index.md file (@mainpage)
331
+ const frontMatter: FrontMatter = {
332
+ title,
333
+ slug: `${this.workspace.slugBaseUrl}${permalink}`,
334
+ description: 'The main page of the API documentation',
335
+ custom_edit_url: null,
336
+ keywords: ['doxygen', 'reference'],
337
+ }
338
+
339
+ const lines: string[] = []
340
+
341
+ const groups = this.workspace.viewModel.collections.get('groups') as Groups
342
+
343
+ const topicsLines = groups.generateTopicsTable()
344
+ lines.push(...topicsLines)
345
+
346
+ const { mainPage } = this.workspace
347
+
348
+ if (mainPage !== undefined) {
349
+ if (topicsLines.length > 0) {
350
+ lines.push('')
351
+ lines.push('## Description')
352
+ }
353
+
354
+ const { detailedDescriptionHtmlLines, briefDescriptionHtmlString } =
355
+ mainPage
356
+
357
+ if (
358
+ detailedDescriptionHtmlLines !== undefined &&
359
+ detailedDescriptionHtmlLines.length > 0
360
+ ) {
361
+ lines.push('')
362
+ lines.push(
363
+ ...mainPage.renderDetailedDescriptionToHtmlLines({
364
+ briefDescriptionHtmlString,
365
+ detailedDescriptionHtmlLines,
366
+ showHeader: false,
367
+ showBrief: false,
368
+ })
369
+ )
370
+ }
371
+ }
372
+
373
+ if (this.options.originalPagesNote.length > 0) {
374
+ lines.push('')
375
+ lines.push(':::note')
376
+ lines.push(this.options.originalPagesNote)
377
+ lines.push(':::')
378
+ }
379
+
380
+ if (this.options.verbose) {
381
+ console.log(`Writing top index file '${filePath}'...`)
382
+ }
383
+
384
+ await this.workspace.writeOutputMdFile({
385
+ filePath,
386
+ frontMatter,
387
+ bodyLines: lines,
388
+ })
389
+ }
390
+
391
+ // --------------------------------------------------------------------------
392
+
393
+ /**
394
+ * Generates alphabetical index files organised by initial letters.
395
+ *
396
+ * @remarks
397
+ * Creates index pages that group documentation items by their first letter,
398
+ * facilitating alphabetical navigation through large sets of documentation.
399
+ * This approach improves usability when dealing with extensive API
400
+ * documentation containing numerous items.
401
+ */
402
+ async generatePerInitialsIndexDotMdFiles(): Promise<void> {
403
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
404
+ for (const [collectionName, collection] of this.workspace.viewModel
405
+ .collections) {
406
+ // console.log(collectionName)
407
+ await collection.generatePerInitialsIndexMdFiles()
408
+ }
409
+ // TODO: parallelize
410
+ }
411
+
412
+ // --------------------------------------------------------------------------
413
+
414
+ /**
415
+ * Generates all individual Markdown files for documentation compounds.
416
+ *
417
+ * @remarks
418
+ * Processes all compounds (classes, files, namespaces, etc.) from the
419
+ * Doxygen XML and converts them into Docusaurus-compatible Markdown pages.
420
+ * Supports parallel processing for improved performance whilst maintaining
421
+ * proper error handling and resource management.
422
+ */
423
+ async generateMdFiles(): Promise<void> {
424
+ const promises: Promise<void>[] = []
425
+
426
+ for (const [, compound] of this.workspace.viewModel.compoundsById) {
427
+ if (compound instanceof Page) {
428
+ if (compound.id === 'indexpage') {
429
+ // This is the @mainpage. We diverge from Doxygen and generate
430
+ // the API main page differently, with the list of topics and
431
+ // this page detailed description. Therefore it is not generated
432
+ // as a regular page and must be skipped at this stage.
433
+ continue
434
+ }
435
+ }
436
+
437
+ const permalink: string | undefined = compound.relativePermalink
438
+ const { sidebarId } = compound
439
+ if (permalink === undefined || sidebarId === undefined) {
440
+ if (this.options.verbose) {
441
+ console.warn('Skip', compound.id, 'no permalink')
442
+ }
443
+ continue
444
+ }
445
+ // assert(permalink !== undefined)
446
+
447
+ if (this.options.verbose) {
448
+ console.log(
449
+ `${compound.kind}: ${compound.compoundName.replaceAll(/[ ]*/g, '')}`,
450
+ '->',
451
+ `${this.workspace.absoluteBaseUrl}${permalink}...`
452
+ )
453
+ }
454
+
455
+ if (this.options.debug) {
456
+ await this.generatePage(compound)
457
+ } else {
458
+ if (promises.length > maxParallelPromises) {
459
+ await Promise.all(promises)
460
+ promises.length = 0
461
+ }
462
+ promises.push(this.generatePage(compound))
463
+ }
464
+ }
465
+ if (promises.length > 0) {
466
+ await Promise.all(promises)
467
+ }
468
+ }
469
+
470
+ /**
471
+ * Generates a single Markdown page for a documentation compound.
472
+ *
473
+ * @remarks
474
+ * Converts an individual compound (class, file, namespace, etc.) into a
475
+ * properly formatted Docusaurus Markdown file with appropriate front matter
476
+ * and content. The method handles permalink generation, metadata creation,
477
+ * and content rendering for optimal integration with Docusaurus.
478
+ *
479
+ * @param compound - The compound to generate a page for.
480
+ */
481
+ async generatePage(compound: CompoundBase): Promise<void> {
482
+ const { sidebarId } = compound
483
+ assert(sidebarId !== undefined)
484
+ const fileName = `${sidebarId}.md`
485
+ // console.log('fileName:', fileName)
486
+ const filePath = `${this.workspace.outputFolderPath}${fileName}`
487
+ const permalink: string | undefined = compound.relativePermalink
488
+ assert(permalink !== undefined)
489
+ const slug = `${this.workspace.slugBaseUrl}${permalink}`
490
+
491
+ const frontMatter: FrontMatter = {
492
+ // title: `${dataObject.pageTitle ?? compound.compoundName}`,
493
+ slug,
494
+ // description: '...', // TODO
495
+ custom_edit_url: null,
496
+ toc_max_heading_level: 4,
497
+ keywords: ['doxygen', 'reference', compound.kind],
498
+ }
499
+
500
+ const bodyLines = compound.renderToLines(frontMatter)
501
+ assert(compound.relativePermalink !== undefined)
502
+ const pagePermalink =
503
+ this.workspace.pageBaseUrl + compound.relativePermalink
504
+
505
+ await this.workspace.writeOutputMdFile({
506
+ filePath,
507
+ frontMatter,
508
+ bodyLines,
509
+ title: compound.pageTitle,
510
+ pagePermalink,
511
+ })
512
+ }
513
+ // --------------------------------------------------------------------------
514
+
515
+ /**
516
+ * Generates HTML redirect files for backwards compatibility.
517
+ *
518
+ * @remarks
519
+ * Creates redirect files that map original Doxygen URLs to the new
520
+ * Docusaurus URLs, maintaining compatibility with existing bookmarks
521
+ * and external links. This ensures a smooth transition when migrating
522
+ * from Doxygen-generated documentation to Docusaurus.
523
+ */
524
+ async generateCompatibilityRedirectFiles(): Promise<void> {
525
+ const redirectsOutputFolderPath = (
526
+ this.options.compatibilityRedirectsOutputFolderPath ?? ''
527
+ ).trim()
528
+ if (redirectsOutputFolderPath === '') {
529
+ return
530
+ }
531
+
532
+ console.log(
533
+ `Removing existing folder 'static/${redirectsOutputFolderPath}'...`
534
+ )
535
+ await fs.rm(`static/${redirectsOutputFolderPath}`, {
536
+ recursive: true,
537
+ force: true,
538
+ })
539
+
540
+ console.log('Writing redirect files...')
541
+ const compoundIds: string[] = Array.from(
542
+ this.workspace.viewModel.compoundsById.keys()
543
+ ).sort()
544
+ for (const compoundId of compoundIds) {
545
+ const compound = this.workspace.viewModel.compoundsById.get(compoundId)
546
+ assert(compound !== undefined)
547
+
548
+ const filePathBase = `static/${redirectsOutputFolderPath}/${compoundId}`
549
+ const filePath = `${filePathBase}.html`
550
+
551
+ if (compound.relativePermalink === undefined) {
552
+ continue
553
+ }
554
+
555
+ const { absoluteBaseUrl } = this.workspace
556
+ const permalink = `${absoluteBaseUrl}${compound.relativePermalink}/`
557
+
558
+ await this.generateRedirectFile({
559
+ filePath,
560
+ permalink,
561
+ })
562
+
563
+ if (compound.kind === 'file') {
564
+ const filePath = `${filePathBase}_source.html`
565
+ await this.generateRedirectFile({
566
+ filePath,
567
+ permalink,
568
+ })
569
+ } else if (compound.kind === 'class' || compound.kind === 'struct') {
570
+ const filePath = `${filePathBase}-members.html`
571
+ await this.generateRedirectFile({
572
+ filePath,
573
+ permalink,
574
+ })
575
+ }
576
+ }
577
+
578
+ const indexFilesMap = new Map<string, string>()
579
+ indexFilesMap.set('classes.html', 'classes')
580
+ indexFilesMap.set('concepts.html', 'concepts')
581
+ indexFilesMap.set('files.html', 'files')
582
+ indexFilesMap.set('index.html', '')
583
+ indexFilesMap.set('namespaces.html', 'namespaces')
584
+ indexFilesMap.set('pages.html', 'pages')
585
+ indexFilesMap.set('topics.html', 'groups')
586
+
587
+ // Not redirectd:
588
+ // annotated
589
+ // doxygen_crawl
590
+ // functions, _[a-z~], _func, _type, _vars
591
+ // hierarchy
592
+ // namespacemembers, _enum, _func, type, _vars
593
+
594
+ for (const [from, to] of indexFilesMap) {
595
+ const filePath = path.join('static', redirectsOutputFolderPath, from)
596
+ const permalink = `${this.workspace.absoluteBaseUrl}${to}/`
597
+
598
+ await this.generateRedirectFile({
599
+ filePath,
600
+ permalink,
601
+ })
602
+ }
603
+
604
+ if (this.options.verbose) {
605
+ console.log(this.workspace.writtenHtmlFilesCounter, 'html files written')
606
+ }
607
+ }
608
+
609
+ // async generateManualRedirectFiles(): Promise<void> {
610
+ // if (this.workspace.pluginOptions.redirects === undefined) {
611
+ // return
612
+ // }
613
+
614
+ // const redirectsOutputFolderPath = path.join('static')
615
+
616
+ // for (const entry of this.workspace.pluginOptions.redirects) {
617
+ // const fromArray = Array.isArray(entry.from) ? entry.from : [entry.from]
618
+ // for (const from of fromArray) {
619
+ // const filePath = path.join(redirectsOutputFolderPath, from)
620
+ // const permalink = `${this.workspace.siteConfig.baseUrl}${entry.to}/`
621
+
622
+ // await this.generateRedirectFile({
623
+ // filePath,
624
+ // permalink
625
+ // })
626
+ // }
627
+ // }
628
+ // }
629
+
630
+ // --------------------------------------------------------------------------
631
+
632
+ /**
633
+ * Generates an HTML redirect file for URL redirection.
634
+ *
635
+ * @remarks
636
+ * Creates a client-side redirect page that automatically forwards visitors
637
+ * from old Doxygen URLs to the corresponding Docusaurus pages. The redirect
638
+ * preserves query parameters and hash fragments to maintain deep linking
639
+ * functionality across the migration.
640
+ *
641
+ * @param filePath - The path where the redirect file should be created.
642
+ * @param permalink - The target URL to redirect to.
643
+ */
644
+ // If `trailingSlash` is true, Docusaurus redirects do not generate
645
+ // .html files, therefore we have to do it manually.
646
+ private async generateRedirectFile({
647
+ filePath,
648
+ permalink,
649
+ }: {
650
+ filePath: string
651
+ permalink: string
652
+ }): Promise<void> {
653
+ // console.log(filePath)
654
+
655
+ const lines: string[] = []
656
+
657
+ lines.push('<!DOCTYPE html>')
658
+ lines.push('<html>')
659
+ lines.push(' <head>')
660
+ lines.push(' <meta charset="UTF-8">')
661
+ lines.push(` <meta http-equiv="refresh" content="0; url=${permalink}">`)
662
+ lines.push(` <link rel="canonical" href="${permalink}" />`)
663
+ lines.push(' </head>')
664
+ lines.push(' <script>')
665
+ lines.push(
666
+ ` window.location.href = '${permalink}'` +
667
+ ' + window.location.search + window.location.hash;'
668
+ )
669
+ lines.push(' </script>')
670
+ lines.push('</html>')
671
+ lines.push('')
672
+
673
+ await fs.mkdir(path.dirname(filePath), { recursive: true })
674
+ const fileHandle = await fs.open(filePath, 'w')
675
+
676
+ await fileHandle.write(lines.join('\n'))
677
+
678
+ await fileHandle.close()
679
+
680
+ this.workspace.writtenHtmlFilesCounter += 1
681
+ }
682
+
683
+ // --------------------------------------------------------------------------
684
+
685
+ /**
686
+ * Copies required static files to the output directory.
687
+ *
688
+ * @remarks
689
+ * Transfers essential template files including SVG icons and CSS
690
+ * stylesheets to the appropriate locations in the static directory
691
+ * for use by the generated documentation. These assets provide the
692
+ * visual styling and iconography for the documentation site.
693
+ */
694
+ async copyFiles(): Promise<void> {
695
+ const destImgFolderPath = path.join('static', 'img', 'doxygen2docusaurus')
696
+ await fs.mkdir(destImgFolderPath, { recursive: true })
697
+
698
+ let fromFilePath = path.join(
699
+ this.workspace.projectPath,
700
+ 'templates',
701
+ 'img',
702
+ 'document-svgrepo-com.svg'
703
+ )
704
+ let toFilePath = path.join(destImgFolderPath, 'document-svgrepo-com.svg')
705
+ console.log(`Copying image file '${toFilePath}'...`)
706
+ await fs.copyFile(fromFilePath, toFilePath)
707
+
708
+ fromFilePath = path.join(
709
+ this.workspace.projectPath,
710
+ 'templates',
711
+ 'img',
712
+ 'folder-svgrepo-com.svg'
713
+ )
714
+ toFilePath = path.join(destImgFolderPath, 'folder-svgrepo-com.svg')
715
+ console.log(`Copying image file '${toFilePath}'...`)
716
+ await fs.copyFile(fromFilePath, toFilePath)
717
+
718
+ fromFilePath = path.join(
719
+ this.workspace.projectPath,
720
+ 'templates',
721
+ 'css',
722
+ 'custom.css'
723
+ )
724
+
725
+ toFilePath = this.options.customCssFilePath
726
+ if (!(await folderExists(path.dirname(toFilePath)))) {
727
+ await fs.mkdir(path.dirname(toFilePath), { recursive: true })
728
+ }
729
+ console.log(`Copying css file '${toFilePath}'...`)
730
+ await fs.copyFile(fromFilePath, toFilePath)
731
+ }
732
+
733
+ // --------------------------------------------------------------------------
734
+
735
+ /**
736
+ * Copies image files referenced in the documentation.
737
+ *
738
+ * @remarks
739
+ * Transfers all image files that are referenced within the Doxygen
740
+ * documentation to the appropriate static directory, ensuring they
741
+ * remain accessible in the generated Docusaurus site. Duplicate
742
+ * image names are automatically deduplicated for efficiency.
743
+ */
744
+ async copyImageFiles(): Promise<void> {
745
+ if (this.workspace.dataModel.xml.images.length > 0) {
746
+ return
747
+ }
748
+
749
+ if (!this.options.verbose) {
750
+ if (this.workspace.dataModel.xml.images.length > 0) {
751
+ console.log(
752
+ 'Copying',
753
+ this.workspace.dataModel.xml.images.length,
754
+ 'image files...'
755
+ )
756
+ }
757
+ }
758
+
759
+ const destImgFolderPath = path.join(
760
+ 'static',
761
+ ...this.options.imagesFolderPath.split('/')
762
+ )
763
+ await fs.mkdir(destImgFolderPath, { recursive: true })
764
+
765
+ const images = new Set<string>()
766
+ for (const image of this.workspace.dataModel.xml.images) {
767
+ if (image.name !== undefined && image.name.length > 0) {
768
+ images.add(image.name)
769
+ }
770
+ }
771
+
772
+ const uniqueNames = Array.from(images).sort()
773
+
774
+ let fromFilePath = ''
775
+ let toFilePath = ''
776
+
777
+ for (const name of uniqueNames) {
778
+ fromFilePath = path.join(this.options.doxygenXmlInputFolderPath, name)
779
+ toFilePath = path.join(destImgFolderPath, name)
780
+ if (this.options.verbose) {
781
+ console.log(`Copying image file '${toFilePath}'...`)
782
+ }
783
+ await fs.copyFile(fromFilePath, toFilePath)
784
+ }
785
+ }
786
+ }
787
+
788
+ // ----------------------------------------------------------------------------