@grethel-labs/excaliplant 0.19.5 → 1.0.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 (556) hide show
  1. package/README.md +196 -1375
  2. package/SECURITY.md +20 -25
  3. package/bin/excaliplant.mjs +182 -210
  4. package/package.json +36 -65
  5. package/src/api.mjs +185 -0
  6. package/src/core/diagnostics.mjs +61 -0
  7. package/src/core/errors.mjs +53 -0
  8. package/src/core/hash.mjs +47 -0
  9. package/src/core/limits.mjs +72 -0
  10. package/src/core/pipeline.mjs +126 -0
  11. package/src/core/preprocess/builtins.mjs +142 -0
  12. package/src/core/preprocess/expression.mjs +424 -0
  13. package/src/core/preprocess/preprocessor.mjs +928 -0
  14. package/src/core/preprocess/stdlib.mjs +350 -0
  15. package/src/core/registry.mjs +121 -0
  16. package/src/core/source.mjs +150 -0
  17. package/src/diagrams/activity/index.mjs +295 -0
  18. package/src/diagrams/activity/layout.mjs +667 -11
  19. package/src/diagrams/activity/parse.mjs +304 -0
  20. package/src/diagrams/archimate/index.mjs +189 -0
  21. package/src/diagrams/chart/index.mjs +262 -0
  22. package/src/diagrams/chen/index.mjs +191 -0
  23. package/src/diagrams/chronology/index.mjs +248 -0
  24. package/src/diagrams/class/index.mjs +59 -0
  25. package/src/diagrams/component/index.mjs +41 -0
  26. package/src/diagrams/creole/index.mjs +36 -0
  27. package/src/diagrams/data/index.mjs +247 -0
  28. package/src/diagrams/data/yaml.mjs +204 -0
  29. package/src/diagrams/detect.mjs +30 -0
  30. package/src/diagrams/ditaa/index.mjs +335 -0
  31. package/src/diagrams/dot/index.mjs +291 -0
  32. package/src/diagrams/files/index.mjs +213 -0
  33. package/src/diagrams/gantt/index.mjs +601 -0
  34. package/src/diagrams/graph/draw.mjs +473 -0
  35. package/src/diagrams/graph/layout.mjs +427 -0
  36. package/src/diagrams/graph/module.mjs +44 -0
  37. package/src/diagrams/graph/parse.mjs +679 -0
  38. package/src/diagrams/index.mjs +58 -496
  39. package/src/diagrams/legacy-activity/index.mjs +152 -0
  40. package/src/diagrams/math/index.mjs +723 -0
  41. package/src/diagrams/nwdiag/index.mjs +324 -0
  42. package/src/diagrams/object/index.mjs +59 -0
  43. package/src/diagrams/railroad/index.mjs +673 -0
  44. package/src/diagrams/salt/index.mjs +457 -0
  45. package/src/diagrams/sequence/index.mjs +325 -0
  46. package/src/diagrams/sequence/layout.mjs +527 -15
  47. package/src/diagrams/sequence/parse.mjs +593 -0
  48. package/src/diagrams/state/index.mjs +376 -0
  49. package/src/diagrams/timing/index.mjs +510 -0
  50. package/src/diagrams/tree/index.mjs +258 -0
  51. package/src/diagrams/tree/parse.mjs +118 -0
  52. package/src/diagrams/usecase/index.mjs +29 -0
  53. package/src/draw/canvas.mjs +480 -0
  54. package/src/draw/frame.mjs +110 -0
  55. package/src/draw/shapes.mjs +518 -0
  56. package/src/draw/theme.mjs +315 -0
  57. package/src/index.mjs +21 -0
  58. package/src/layout/font_metrics.mjs +10 -0
  59. package/src/layout/measure.mjs +292 -0
  60. package/src/model/graph.mjs +214 -0
  61. package/src/render/excalidraw.mjs +73 -0
  62. package/src/render/font.mjs +30 -0
  63. package/src/render/png.mjs +42 -0
  64. package/src/render/svg.mjs +401 -0
  65. package/src/syntax/arrows.mjs +366 -0
  66. package/src/syntax/color.mjs +181 -0
  67. package/src/syntax/commons.mjs +197 -0
  68. package/src/syntax/creole.mjs +359 -0
  69. package/src/syntax/reader.mjs +115 -0
  70. package/src/syntax/skin.mjs +210 -0
  71. package/src/syntax/text.mjs +210 -0
  72. package/types/api.d.mts +114 -0
  73. package/types/core/diagnostics.d.mts +52 -0
  74. package/types/core/errors.d.mts +51 -0
  75. package/types/core/hash.d.mts +24 -0
  76. package/types/core/limits.d.mts +93 -0
  77. package/types/core/pipeline.d.mts +99 -0
  78. package/types/core/preprocess/builtins.d.mts +20 -0
  79. package/types/core/preprocess/expression.d.mts +85 -0
  80. package/types/core/preprocess/preprocessor.d.mts +92 -0
  81. package/types/core/preprocess/stdlib.d.mts +14 -0
  82. package/types/core/registry.d.mts +130 -0
  83. package/types/core/source.d.mts +52 -0
  84. package/types/diagrams/activity/index.d.mts +39 -0
  85. package/types/diagrams/activity/layout.d.mts +99 -0
  86. package/types/diagrams/activity/parse.d.mts +107 -0
  87. package/types/diagrams/archimate/index.d.mts +28 -0
  88. package/types/diagrams/chart/index.d.mts +50 -0
  89. package/types/diagrams/chen/index.d.mts +18 -0
  90. package/types/diagrams/chronology/index.d.mts +58 -0
  91. package/types/diagrams/class/index.d.mts +15 -0
  92. package/types/diagrams/component/index.d.mts +23 -0
  93. package/types/diagrams/creole/index.d.mts +19 -0
  94. package/types/diagrams/data/index.d.mts +83 -0
  95. package/types/diagrams/data/yaml.d.mts +13 -0
  96. package/types/diagrams/detect.d.mts +14 -0
  97. package/types/diagrams/ditaa/index.d.mts +101 -0
  98. package/types/diagrams/dot/index.d.mts +22 -0
  99. package/types/diagrams/files/index.d.mts +55 -0
  100. package/types/diagrams/gantt/index.d.mts +107 -0
  101. package/types/diagrams/graph/draw.d.mts +35 -0
  102. package/types/diagrams/graph/layout.d.mts +78 -0
  103. package/types/diagrams/graph/module.d.mts +43 -0
  104. package/types/diagrams/graph/parse.d.mts +190 -0
  105. package/types/diagrams/index.d.mts +7 -0
  106. package/types/diagrams/legacy-activity/index.d.mts +17 -0
  107. package/types/diagrams/math/index.d.mts +85 -0
  108. package/types/diagrams/nwdiag/index.d.mts +74 -0
  109. package/types/diagrams/object/index.d.mts +14 -0
  110. package/types/diagrams/railroad/index.d.mts +116 -0
  111. package/types/diagrams/salt/index.d.mts +49 -0
  112. package/types/diagrams/sequence/index.d.mts +20 -0
  113. package/types/diagrams/sequence/layout.d.mts +102 -0
  114. package/types/diagrams/sequence/parse.d.mts +141 -0
  115. package/types/diagrams/state/index.d.mts +18 -0
  116. package/types/diagrams/timing/index.d.mts +116 -0
  117. package/types/diagrams/tree/index.d.mts +57 -0
  118. package/types/diagrams/tree/parse.d.mts +36 -0
  119. package/types/diagrams/usecase/index.d.mts +14 -0
  120. package/types/draw/canvas.d.mts +267 -0
  121. package/types/draw/frame.d.mts +10 -0
  122. package/types/draw/shapes.d.mts +52 -0
  123. package/types/draw/theme.d.mts +83 -0
  124. package/types/index.d.mts +11 -0
  125. package/types/layout/font_metrics.d.mts +6 -0
  126. package/types/layout/measure.d.mts +108 -0
  127. package/types/model/graph.d.mts +203 -0
  128. package/types/render/excalidraw.d.mts +41 -0
  129. package/types/render/font.d.mts +11 -0
  130. package/types/render/png.d.mts +34 -0
  131. package/types/render/svg.d.mts +42 -0
  132. package/types/syntax/arrows.d.mts +69 -0
  133. package/types/syntax/color.d.mts +65 -0
  134. package/types/syntax/commons.d.mts +75 -0
  135. package/types/syntax/creole.d.mts +73 -0
  136. package/types/syntax/reader.d.mts +57 -0
  137. package/types/syntax/skin.d.mts +11 -0
  138. package/types/syntax/text.d.mts +86 -0
  139. package/CHANGELOG.md +0 -404
  140. package/assets/arrowheads/arrowheads.svg +0 -46
  141. package/assets/arrowheads/manifest.json +0 -17
  142. package/index.mjs +0 -548
  143. package/src/diagrams/activity/assets.mjs +0 -16
  144. package/src/diagrams/activity/docs.mjs +0 -20
  145. package/src/diagrams/activity/module.mjs +0 -80
  146. package/src/diagrams/activity/parser.mjs +0 -67
  147. package/src/diagrams/activity/plugins/syntax.mjs +0 -373
  148. package/src/diagrams/activity/render.mjs +0 -25
  149. package/src/diagrams/activity/security.mjs +0 -19
  150. package/src/diagrams/activity/tests/activity_components.test.mjs +0 -124
  151. package/src/diagrams/activity/tests.mjs +0 -20
  152. package/src/diagrams/archimate/assets.mjs +0 -10
  153. package/src/diagrams/archimate/docs/coverage_examples.mjs +0 -45
  154. package/src/diagrams/archimate/docs.mjs +0 -14
  155. package/src/diagrams/archimate/layout.mjs +0 -11
  156. package/src/diagrams/archimate/module.mjs +0 -45
  157. package/src/diagrams/archimate/parser.mjs +0 -96
  158. package/src/diagrams/archimate/render.mjs +0 -13
  159. package/src/diagrams/archimate/security.mjs +0 -10
  160. package/src/diagrams/archimate/tests/archimate_components.test.mjs +0 -19
  161. package/src/diagrams/archimate/tests.mjs +0 -14
  162. package/src/diagrams/base/artifacts.mjs +0 -35
  163. package/src/diagrams/base/assets.mjs +0 -23
  164. package/src/diagrams/base/dependencies.mjs +0 -25
  165. package/src/diagrams/base/docs.mjs +0 -37
  166. package/src/diagrams/base/index.mjs +0 -15
  167. package/src/diagrams/base/layout.mjs +0 -32
  168. package/src/diagrams/base/module.mjs +0 -210
  169. package/src/diagrams/base/parser.mjs +0 -50
  170. package/src/diagrams/base/renderer.mjs +0 -26
  171. package/src/diagrams/base/security.mjs +0 -23
  172. package/src/diagrams/base/tests.mjs +0 -37
  173. package/src/diagrams/chart/assets.mjs +0 -10
  174. package/src/diagrams/chart/docs/coverage_examples.mjs +0 -31
  175. package/src/diagrams/chart/docs.mjs +0 -14
  176. package/src/diagrams/chart/layout.mjs +0 -10
  177. package/src/diagrams/chart/module.mjs +0 -42
  178. package/src/diagrams/chart/parser.mjs +0 -78
  179. package/src/diagrams/chart/render.mjs +0 -9
  180. package/src/diagrams/chart/security.mjs +0 -10
  181. package/src/diagrams/chart/tests/chart_components.test.mjs +0 -17
  182. package/src/diagrams/chart/tests.mjs +0 -14
  183. package/src/diagrams/chen/assets.mjs +0 -10
  184. package/src/diagrams/chen/docs/coverage_examples.mjs +0 -68
  185. package/src/diagrams/chen/docs.mjs +0 -14
  186. package/src/diagrams/chen/layout.mjs +0 -11
  187. package/src/diagrams/chen/module.mjs +0 -40
  188. package/src/diagrams/chen/parser.mjs +0 -107
  189. package/src/diagrams/chen/render.mjs +0 -14
  190. package/src/diagrams/chen/security.mjs +0 -10
  191. package/src/diagrams/chen/tests/chen_components.test.mjs +0 -35
  192. package/src/diagrams/chen/tests.mjs +0 -14
  193. package/src/diagrams/chronology/assets.mjs +0 -11
  194. package/src/diagrams/chronology/docs/coverage_examples.mjs +0 -37
  195. package/src/diagrams/chronology/docs.mjs +0 -15
  196. package/src/diagrams/chronology/layout.mjs +0 -11
  197. package/src/diagrams/chronology/module.mjs +0 -46
  198. package/src/diagrams/chronology/parser.mjs +0 -107
  199. package/src/diagrams/chronology/render.mjs +0 -12
  200. package/src/diagrams/chronology/security.mjs +0 -11
  201. package/src/diagrams/chronology/tests/chronology_components.test.mjs +0 -16
  202. package/src/diagrams/chronology/tests.mjs +0 -15
  203. package/src/diagrams/class/assets.mjs +0 -22
  204. package/src/diagrams/class/docs/coverage_examples.mjs +0 -155
  205. package/src/diagrams/class/docs.mjs +0 -37
  206. package/src/diagrams/class/layout.mjs +0 -20
  207. package/src/diagrams/class/module.mjs +0 -101
  208. package/src/diagrams/class/parser.mjs +0 -120
  209. package/src/diagrams/class/plugins/syntax.mjs +0 -154
  210. package/src/diagrams/class/render.mjs +0 -20
  211. package/src/diagrams/class/security.mjs +0 -19
  212. package/src/diagrams/class/style.mjs +0 -15
  213. package/src/diagrams/class/tests/class_components.test.mjs +0 -180
  214. package/src/diagrams/class/tests/output/.gitignore +0 -2
  215. package/src/diagrams/class/tests/output.mjs +0 -17
  216. package/src/diagrams/class/tests.mjs +0 -20
  217. package/src/diagrams/component/assets.mjs +0 -22
  218. package/src/diagrams/component/docs/coverage_examples.mjs +0 -137
  219. package/src/diagrams/component/docs.mjs +0 -37
  220. package/src/diagrams/component/layout.mjs +0 -20
  221. package/src/diagrams/component/module.mjs +0 -105
  222. package/src/diagrams/component/parser.mjs +0 -130
  223. package/src/diagrams/component/plugins/syntax.mjs +0 -116
  224. package/src/diagrams/component/render.mjs +0 -20
  225. package/src/diagrams/component/security.mjs +0 -19
  226. package/src/diagrams/component/tests/component_components.test.mjs +0 -147
  227. package/src/diagrams/component/tests/output/.gitignore +0 -2
  228. package/src/diagrams/component/tests/output.mjs +0 -17
  229. package/src/diagrams/component/tests.mjs +0 -23
  230. package/src/diagrams/deployment/assets.mjs +0 -22
  231. package/src/diagrams/deployment/docs/coverage_examples.mjs +0 -137
  232. package/src/diagrams/deployment/docs.mjs +0 -31
  233. package/src/diagrams/deployment/layout.mjs +0 -20
  234. package/src/diagrams/deployment/module.mjs +0 -104
  235. package/src/diagrams/deployment/parser.mjs +0 -124
  236. package/src/diagrams/deployment/plugins/syntax.mjs +0 -51
  237. package/src/diagrams/deployment/render.mjs +0 -20
  238. package/src/diagrams/deployment/security.mjs +0 -19
  239. package/src/diagrams/deployment/tests/deployment_components.test.mjs +0 -128
  240. package/src/diagrams/deployment/tests/output/all-shapes.excalidraw.json +0 -969
  241. package/src/diagrams/deployment/tests/output/all-shapes.puml +0 -11
  242. package/src/diagrams/deployment/tests/output/all-shapes.svg +0 -34
  243. package/src/diagrams/deployment/tests/output/arrow-styles.excalidraw.json +0 -478
  244. package/src/diagrams/deployment/tests/output/arrow-styles.puml +0 -8
  245. package/src/diagrams/deployment/tests/output/arrow-styles.svg +0 -18
  246. package/src/diagrams/deployment/tests/output/basic-node.excalidraw.json +0 -107
  247. package/src/diagrams/deployment/tests/output/basic-node.puml +0 -3
  248. package/src/diagrams/deployment/tests/output/basic-node.svg +0 -8
  249. package/src/diagrams/deployment/tests/output/json-mixing.excalidraw.json +0 -322
  250. package/src/diagrams/deployment/tests/output/json-mixing.puml +0 -6
  251. package/src/diagrams/deployment/tests/output/json-mixing.svg +0 -14
  252. package/src/diagrams/deployment/tests/output/nested-containers.excalidraw.json +0 -302
  253. package/src/diagrams/deployment/tests/output/nested-containers.puml +0 -9
  254. package/src/diagrams/deployment/tests/output/nested-containers.svg +0 -14
  255. package/src/diagrams/deployment/tests/output/official-elements.excalidraw.json +0 -1294
  256. package/src/diagrams/deployment/tests/output/official-elements.puml +0 -16
  257. package/src/diagrams/deployment/tests/output/official-elements.svg +0 -44
  258. package/src/diagrams/deployment/tests/output/official-json.excalidraw.json +0 -302
  259. package/src/diagrams/deployment/tests/output/official-json.puml +0 -10
  260. package/src/diagrams/deployment/tests/output/official-json.svg +0 -13
  261. package/src/diagrams/deployment/tests/output/official-long-descriptions.excalidraw.json +0 -244
  262. package/src/diagrams/deployment/tests/output/official-long-descriptions.puml +0 -15
  263. package/src/diagrams/deployment/tests/output/official-long-descriptions.svg +0 -12
  264. package/src/diagrams/deployment/tests/output/ports.excalidraw.json +0 -286
  265. package/src/diagrams/deployment/tests/output/ports.puml +0 -5
  266. package/src/diagrams/deployment/tests/output/ports.svg +0 -13
  267. package/src/diagrams/deployment/tests/output.mjs +0 -22
  268. package/src/diagrams/deployment/tests.mjs +0 -20
  269. package/src/diagrams/ditaa/assets.mjs +0 -10
  270. package/src/diagrams/ditaa/docs/coverage_examples.mjs +0 -28
  271. package/src/diagrams/ditaa/docs.mjs +0 -14
  272. package/src/diagrams/ditaa/layout.mjs +0 -10
  273. package/src/diagrams/ditaa/module.mjs +0 -42
  274. package/src/diagrams/ditaa/parser.mjs +0 -47
  275. package/src/diagrams/ditaa/render.mjs +0 -9
  276. package/src/diagrams/ditaa/security.mjs +0 -10
  277. package/src/diagrams/ditaa/tests/ditaa_components.test.mjs +0 -15
  278. package/src/diagrams/ditaa/tests.mjs +0 -14
  279. package/src/diagrams/ebnf/assets.mjs +0 -6
  280. package/src/diagrams/ebnf/docs/coverage_examples.mjs +0 -38
  281. package/src/diagrams/ebnf/docs.mjs +0 -10
  282. package/src/diagrams/ebnf/layout.mjs +0 -11
  283. package/src/diagrams/ebnf/module.mjs +0 -39
  284. package/src/diagrams/ebnf/parser.mjs +0 -59
  285. package/src/diagrams/ebnf/render.mjs +0 -13
  286. package/src/diagrams/ebnf/security.mjs +0 -10
  287. package/src/diagrams/ebnf/tests/ebnf_components.test.mjs +0 -16
  288. package/src/diagrams/ebnf/tests.mjs +0 -10
  289. package/src/diagrams/files/assets.mjs +0 -10
  290. package/src/diagrams/files/docs/coverage_examples.mjs +0 -40
  291. package/src/diagrams/files/docs.mjs +0 -14
  292. package/src/diagrams/files/layout.mjs +0 -11
  293. package/src/diagrams/files/module.mjs +0 -42
  294. package/src/diagrams/files/parser.mjs +0 -38
  295. package/src/diagrams/files/render.mjs +0 -13
  296. package/src/diagrams/files/security.mjs +0 -10
  297. package/src/diagrams/files/tests/files_components.test.mjs +0 -17
  298. package/src/diagrams/files/tests.mjs +0 -14
  299. package/src/diagrams/gantt/assets.mjs +0 -10
  300. package/src/diagrams/gantt/docs/coverage_examples.mjs +0 -32
  301. package/src/diagrams/gantt/docs.mjs +0 -14
  302. package/src/diagrams/gantt/layout.mjs +0 -11
  303. package/src/diagrams/gantt/module.mjs +0 -42
  304. package/src/diagrams/gantt/parser.mjs +0 -76
  305. package/src/diagrams/gantt/render.mjs +0 -13
  306. package/src/diagrams/gantt/security.mjs +0 -10
  307. package/src/diagrams/gantt/tests/gantt_components.test.mjs +0 -15
  308. package/src/diagrams/gantt/tests.mjs +0 -14
  309. package/src/diagrams/ie/assets.mjs +0 -10
  310. package/src/diagrams/ie/docs/coverage_examples.mjs +0 -58
  311. package/src/diagrams/ie/docs.mjs +0 -14
  312. package/src/diagrams/ie/layout.mjs +0 -11
  313. package/src/diagrams/ie/module.mjs +0 -40
  314. package/src/diagrams/ie/parser.mjs +0 -98
  315. package/src/diagrams/ie/render.mjs +0 -14
  316. package/src/diagrams/ie/security.mjs +0 -10
  317. package/src/diagrams/ie/tests/ie_components.test.mjs +0 -39
  318. package/src/diagrams/ie/tests.mjs +0 -14
  319. package/src/diagrams/json/assets.mjs +0 -6
  320. package/src/diagrams/json/docs/coverage_examples.mjs +0 -54
  321. package/src/diagrams/json/docs.mjs +0 -10
  322. package/src/diagrams/json/layout.mjs +0 -11
  323. package/src/diagrams/json/module.mjs +0 -39
  324. package/src/diagrams/json/parser.mjs +0 -47
  325. package/src/diagrams/json/render.mjs +0 -13
  326. package/src/diagrams/json/security.mjs +0 -10
  327. package/src/diagrams/json/tests/json_components.test.mjs +0 -19
  328. package/src/diagrams/json/tests.mjs +0 -10
  329. package/src/diagrams/math/assets.mjs +0 -6
  330. package/src/diagrams/math/docs/coverage_examples.mjs +0 -28
  331. package/src/diagrams/math/docs.mjs +0 -10
  332. package/src/diagrams/math/layout.mjs +0 -11
  333. package/src/diagrams/math/module.mjs +0 -39
  334. package/src/diagrams/math/parser.mjs +0 -94
  335. package/src/diagrams/math/render.mjs +0 -13
  336. package/src/diagrams/math/security.mjs +0 -10
  337. package/src/diagrams/math/tests/math_components.test.mjs +0 -18
  338. package/src/diagrams/math/tests.mjs +0 -10
  339. package/src/diagrams/mindmap/assets.mjs +0 -10
  340. package/src/diagrams/mindmap/docs/coverage_examples.mjs +0 -44
  341. package/src/diagrams/mindmap/docs.mjs +0 -14
  342. package/src/diagrams/mindmap/layout.mjs +0 -11
  343. package/src/diagrams/mindmap/module.mjs +0 -42
  344. package/src/diagrams/mindmap/parser.mjs +0 -45
  345. package/src/diagrams/mindmap/render.mjs +0 -13
  346. package/src/diagrams/mindmap/security.mjs +0 -10
  347. package/src/diagrams/mindmap/tests/mindmap_components.test.mjs +0 -17
  348. package/src/diagrams/mindmap/tests.mjs +0 -14
  349. package/src/diagrams/nwdiag/assets.mjs +0 -10
  350. package/src/diagrams/nwdiag/docs/coverage_examples.mjs +0 -58
  351. package/src/diagrams/nwdiag/docs.mjs +0 -14
  352. package/src/diagrams/nwdiag/layout.mjs +0 -11
  353. package/src/diagrams/nwdiag/module.mjs +0 -42
  354. package/src/diagrams/nwdiag/parser.mjs +0 -149
  355. package/src/diagrams/nwdiag/render.mjs +0 -13
  356. package/src/diagrams/nwdiag/security.mjs +0 -10
  357. package/src/diagrams/nwdiag/tests/nwdiag_components.test.mjs +0 -31
  358. package/src/diagrams/nwdiag/tests.mjs +0 -14
  359. package/src/diagrams/object/assets.mjs +0 -22
  360. package/src/diagrams/object/docs/coverage_examples.mjs +0 -124
  361. package/src/diagrams/object/docs.mjs +0 -20
  362. package/src/diagrams/object/layout.mjs +0 -20
  363. package/src/diagrams/object/module.mjs +0 -99
  364. package/src/diagrams/object/parser.mjs +0 -82
  365. package/src/diagrams/object/plugins/syntax.mjs +0 -280
  366. package/src/diagrams/object/render.mjs +0 -20
  367. package/src/diagrams/object/security.mjs +0 -19
  368. package/src/diagrams/object/tests/object_components.test.mjs +0 -134
  369. package/src/diagrams/object/tests/output/.gitignore +0 -2
  370. package/src/diagrams/object/tests/output.mjs +0 -22
  371. package/src/diagrams/object/tests.mjs +0 -20
  372. package/src/diagrams/regex/assets.mjs +0 -6
  373. package/src/diagrams/regex/docs/coverage_examples.mjs +0 -28
  374. package/src/diagrams/regex/docs.mjs +0 -10
  375. package/src/diagrams/regex/layout.mjs +0 -17
  376. package/src/diagrams/regex/module.mjs +0 -48
  377. package/src/diagrams/regex/parser.mjs +0 -59
  378. package/src/diagrams/regex/render.mjs +0 -20
  379. package/src/diagrams/regex/security.mjs +0 -10
  380. package/src/diagrams/regex/tests/regex_components.test.mjs +0 -22
  381. package/src/diagrams/regex/tests.mjs +0 -10
  382. package/src/diagrams/salt/assets.mjs +0 -10
  383. package/src/diagrams/salt/docs/coverage_examples.mjs +0 -52
  384. package/src/diagrams/salt/docs.mjs +0 -14
  385. package/src/diagrams/salt/layout.mjs +0 -11
  386. package/src/diagrams/salt/module.mjs +0 -39
  387. package/src/diagrams/salt/parser.mjs +0 -108
  388. package/src/diagrams/salt/render.mjs +0 -13
  389. package/src/diagrams/salt/security.mjs +0 -10
  390. package/src/diagrams/salt/tests/salt_components.test.mjs +0 -23
  391. package/src/diagrams/salt/tests.mjs +0 -14
  392. package/src/diagrams/sequence/assets.mjs +0 -22
  393. package/src/diagrams/sequence/context.mjs +0 -550
  394. package/src/diagrams/sequence/docs/coverage_examples.mjs +0 -552
  395. package/src/diagrams/sequence/docs.mjs +0 -20
  396. package/src/diagrams/sequence/layout_engine.mjs +0 -1033
  397. package/src/diagrams/sequence/module.mjs +0 -97
  398. package/src/diagrams/sequence/parser.mjs +0 -95
  399. package/src/diagrams/sequence/plugins/advanced.mjs +0 -289
  400. package/src/diagrams/sequence/plugins/fragments.mjs +0 -67
  401. package/src/diagrams/sequence/plugins/messages.mjs +0 -461
  402. package/src/diagrams/sequence/plugins/notes.mjs +0 -220
  403. package/src/diagrams/sequence/plugins/participants.mjs +0 -94
  404. package/src/diagrams/sequence/plugins/preamble.mjs +0 -218
  405. package/src/diagrams/sequence/render.mjs +0 -29
  406. package/src/diagrams/sequence/render_excalidraw.mjs +0 -1458
  407. package/src/diagrams/sequence/security.mjs +0 -19
  408. package/src/diagrams/sequence/spacing.mjs +0 -106
  409. package/src/diagrams/sequence/tests/output/arrow-variants.excalidraw.json +0 -2443
  410. package/src/diagrams/sequence/tests/output/arrow-variants.puml +0 -22
  411. package/src/diagrams/sequence/tests/output/arrow-variants.svg +0 -61
  412. package/src/diagrams/sequence/tests/output/autonumber-title-footbox-skinparam.excalidraw.json +0 -1087
  413. package/src/diagrams/sequence/tests/output/autonumber-title-footbox-skinparam.puml +0 -35
  414. package/src/diagrams/sequence/tests/output/autonumber-title-footbox-skinparam.svg +0 -30
  415. package/src/diagrams/sequence/tests/output/basics.excalidraw.json +0 -765
  416. package/src/diagrams/sequence/tests/output/basics.puml +0 -8
  417. package/src/diagrams/sequence/tests/output/basics.svg +0 -22
  418. package/src/diagrams/sequence/tests/output/combination-errors.excalidraw.json +0 -2612
  419. package/src/diagrams/sequence/tests/output/combination-errors.puml +0 -23
  420. package/src/diagrams/sequence/tests/output/combination-errors.svg +0 -64
  421. package/src/diagrams/sequence/tests/output/combination-flow.excalidraw.json +0 -2769
  422. package/src/diagrams/sequence/tests/output/combination-flow.puml +0 -25
  423. package/src/diagrams/sequence/tests/output/combination-flow.svg +0 -69
  424. package/src/diagrams/sequence/tests/output/feedback-loops-assets.excalidraw.json +0 -3487
  425. package/src/diagrams/sequence/tests/output/feedback-loops-assets.puml +0 -21
  426. package/src/diagrams/sequence/tests/output/feedback-loops-assets.svg +0 -86
  427. package/src/diagrams/sequence/tests/output/fragments.excalidraw.json +0 -3347
  428. package/src/diagrams/sequence/tests/output/fragments.puml +0 -36
  429. package/src/diagrams/sequence/tests/output/fragments.svg +0 -82
  430. package/src/diagrams/sequence/tests/output/global-presentation.excalidraw.json +0 -938
  431. package/src/diagrams/sequence/tests/output/global-presentation.puml +0 -23
  432. package/src/diagrams/sequence/tests/output/global-presentation.svg +0 -27
  433. package/src/diagrams/sequence/tests/output/label-wrapping.excalidraw.json +0 -985
  434. package/src/diagrams/sequence/tests/output/label-wrapping.puml +0 -9
  435. package/src/diagrams/sequence/tests/output/label-wrapping.svg +0 -27
  436. package/src/diagrams/sequence/tests/output/lifecycle.excalidraw.json +0 -1771
  437. package/src/diagrams/sequence/tests/output/lifecycle.puml +0 -14
  438. package/src/diagrams/sequence/tests/output/lifecycle.svg +0 -43
  439. package/src/diagrams/sequence/tests/output/notes.excalidraw.json +0 -1213
  440. package/src/diagrams/sequence/tests/output/notes.puml +0 -16
  441. package/src/diagrams/sequence/tests/output/notes.svg +0 -35
  442. package/src/diagrams/sequence/tests/output/participant-boxes.excalidraw.json +0 -1342
  443. package/src/diagrams/sequence/tests/output/participant-boxes.puml +0 -14
  444. package/src/diagrams/sequence/tests/output/participant-boxes.svg +0 -35
  445. package/src/diagrams/sequence/tests/output/participants.excalidraw.json +0 -4146
  446. package/src/diagrams/sequence/tests/output/participants.puml +0 -26
  447. package/src/diagrams/sequence/tests/output/participants.svg +0 -102
  448. package/src/diagrams/sequence/tests/output/timeline-decorations.excalidraw.json +0 -1480
  449. package/src/diagrams/sequence/tests/output/timeline-decorations.puml +0 -18
  450. package/src/diagrams/sequence/tests/output/timeline-decorations.svg +0 -40
  451. package/src/diagrams/sequence/tests/output.mjs +0 -17
  452. package/src/diagrams/sequence/tests/sequence_components.test.mjs +0 -860
  453. package/src/diagrams/sequence/tests.mjs +0 -20
  454. package/src/diagrams/shared/common_plugins/title.mjs +0 -21
  455. package/src/diagrams/shared/data_runtime.mjs +0 -269
  456. package/src/diagrams/shared/er_runtime.mjs +0 -105
  457. package/src/diagrams/shared/graph_context.mjs +0 -476
  458. package/src/diagrams/shared/graph_parser.mjs +0 -59
  459. package/src/diagrams/shared/graph_plugins/association_class.mjs +0 -47
  460. package/src/diagrams/shared/graph_plugins/class_block.mjs +0 -405
  461. package/src/diagrams/shared/graph_plugins/connections.mjs +0 -83
  462. package/src/diagrams/shared/graph_plugins/containers.mjs +0 -58
  463. package/src/diagrams/shared/graph_plugins/filters.mjs +0 -25
  464. package/src/diagrams/shared/graph_plugins/notes.mjs +0 -139
  465. package/src/diagrams/shared/graph_plugins/ports.mjs +0 -63
  466. package/src/diagrams/shared/graph_plugins/preamble.mjs +0 -280
  467. package/src/diagrams/shared/graph_plugins/shapes.mjs +0 -193
  468. package/src/diagrams/shared/graph_runtime.mjs +0 -28
  469. package/src/diagrams/shared/planning_runtime.mjs +0 -86
  470. package/src/diagrams/shared/railroad_runtime.mjs +0 -348
  471. package/src/diagrams/shared/special_runtime.mjs +0 -79
  472. package/src/diagrams/shared/tree_runtime.mjs +0 -97
  473. package/src/diagrams/state/assets.mjs +0 -22
  474. package/src/diagrams/state/docs/coverage_examples.mjs +0 -91
  475. package/src/diagrams/state/docs.mjs +0 -27
  476. package/src/diagrams/state/layout.mjs +0 -30
  477. package/src/diagrams/state/module.mjs +0 -99
  478. package/src/diagrams/state/parser.mjs +0 -84
  479. package/src/diagrams/state/plugins/syntax.mjs +0 -367
  480. package/src/diagrams/state/render.mjs +0 -22
  481. package/src/diagrams/state/security.mjs +0 -18
  482. package/src/diagrams/state/tests/output.mjs +0 -24
  483. package/src/diagrams/state/tests/state_components.test.mjs +0 -111
  484. package/src/diagrams/state/tests.mjs +0 -20
  485. package/src/diagrams/timing/assets.mjs +0 -16
  486. package/src/diagrams/timing/docs/coverage_examples.mjs +0 -78
  487. package/src/diagrams/timing/docs.mjs +0 -25
  488. package/src/diagrams/timing/layout.mjs +0 -157
  489. package/src/diagrams/timing/module.mjs +0 -74
  490. package/src/diagrams/timing/parser.mjs +0 -32
  491. package/src/diagrams/timing/plugins/syntax.mjs +0 -395
  492. package/src/diagrams/timing/render.mjs +0 -28
  493. package/src/diagrams/timing/render_excalidraw.mjs +0 -483
  494. package/src/diagrams/timing/security.mjs +0 -18
  495. package/src/diagrams/timing/tests/timing_components.test.mjs +0 -129
  496. package/src/diagrams/timing/tests.mjs +0 -20
  497. package/src/diagrams/use-case/assets.mjs +0 -16
  498. package/src/diagrams/use-case/docs.mjs +0 -20
  499. package/src/diagrams/use-case/layout.mjs +0 -20
  500. package/src/diagrams/use-case/module.mjs +0 -61
  501. package/src/diagrams/use-case/parser.mjs +0 -218
  502. package/src/diagrams/use-case/plugins/actors.mjs +0 -151
  503. package/src/diagrams/use-case/plugins/containers.mjs +0 -54
  504. package/src/diagrams/use-case/plugins/notes.mjs +0 -71
  505. package/src/diagrams/use-case/plugins/relationships.mjs +0 -183
  506. package/src/diagrams/use-case/plugins/usecases.mjs +0 -132
  507. package/src/diagrams/use-case/render.mjs +0 -18
  508. package/src/diagrams/use-case/security.mjs +0 -16
  509. package/src/diagrams/use-case/tests/usecase_components.test.mjs +0 -110
  510. package/src/diagrams/use-case/tests.mjs +0 -20
  511. package/src/diagrams/wbs/assets.mjs +0 -10
  512. package/src/diagrams/wbs/docs/coverage_examples.mjs +0 -42
  513. package/src/diagrams/wbs/docs.mjs +0 -14
  514. package/src/diagrams/wbs/layout.mjs +0 -11
  515. package/src/diagrams/wbs/module.mjs +0 -39
  516. package/src/diagrams/wbs/parser.mjs +0 -44
  517. package/src/diagrams/wbs/render.mjs +0 -13
  518. package/src/diagrams/wbs/security.mjs +0 -10
  519. package/src/diagrams/wbs/tests/wbs_components.test.mjs +0 -16
  520. package/src/diagrams/wbs/tests.mjs +0 -14
  521. package/src/diagrams/yaml/assets.mjs +0 -6
  522. package/src/diagrams/yaml/docs/coverage_examples.mjs +0 -50
  523. package/src/diagrams/yaml/docs.mjs +0 -10
  524. package/src/diagrams/yaml/layout.mjs +0 -11
  525. package/src/diagrams/yaml/module.mjs +0 -39
  526. package/src/diagrams/yaml/parser.mjs +0 -46
  527. package/src/diagrams/yaml/render.mjs +0 -13
  528. package/src/diagrams/yaml/security.mjs +0 -10
  529. package/src/diagrams/yaml/tests/yaml_components.test.mjs +0 -18
  530. package/src/diagrams/yaml/tests.mjs +0 -10
  531. package/src/general/layout/elk_layout.mjs +0 -711
  532. package/src/general/layout/sizing.mjs +0 -383
  533. package/src/general/model/diagram.mjs +0 -1470
  534. package/src/general/platform/asset_base.mjs +0 -58
  535. package/src/general/platform/diagnostics.mjs +0 -76
  536. package/src/general/platform/security_base.mjs +0 -441
  537. package/src/general/platform/services.mjs +0 -192
  538. package/src/general/render/canvas_svg.mjs +0 -104
  539. package/src/general/render/excalidraw.mjs +0 -2749
  540. package/src/general/render/png.mjs +0 -46
  541. package/src/general/render/rng.mjs +0 -52
  542. package/src/general/render/schema.mjs +0 -35
  543. package/src/general/render/svg.mjs +0 -601
  544. package/src/general/style/colors.mjs +0 -136
  545. package/src/general/style/font.mjs +0 -83
  546. package/src/general/style/style.mjs +0 -320
  547. package/src/general/style/text.mjs +0 -334
  548. package/src/main/builtin.mjs +0 -280
  549. package/src/main/dependencies.mjs +0 -96
  550. package/src/main/introspection.mjs +0 -52
  551. package/src/main/metadata.mjs +0 -47
  552. package/src/main/parser.mjs +0 -343
  553. package/src/main/pipeline.mjs +0 -85
  554. package/src/main/registry.mjs +0 -148
  555. package/src/util/parser_engine.mjs +0 -113
  556. package/src/util/plantuml_utils.mjs +0 -735
package/README.md CHANGED
@@ -1,1418 +1,239 @@
1
+ <!-- This README is generated by `npm run docs` from docs/README.template.md. Edit the template, not this file. -->
1
2
 
2
- # excaliplant
3
+ <h1 align="center">excaliplant</h1>
3
4
 
4
- [![npm](https://img.shields.io/npm/v/@grethel-labs/excaliplant.svg?label=latest)](https://www.npmjs.com/package/@grethel-labs/excaliplant)
5
- [![downloads](https://img.shields.io/npm/dm/@grethel-labs/excaliplant.svg)](https://www.npmjs.com/package/@grethel-labs/excaliplant)
6
- [![ci](https://github.com/grethel-labs/excaliplant/actions/workflows/ci.yml/badge.svg)](https://github.com/grethel-labs/excaliplant/actions/workflows/ci.yml)
7
- [![node](https://img.shields.io/node/v/@grethel-labs/excaliplant.svg)](https://nodejs.org)
8
- [![license](https://img.shields.io/npm/l/@grethel-labs/excaliplant.svg)](./LICENSE)
5
+ <p align="center">
6
+ <b>PlantUML in, hand-drawn diagrams out.</b><br />
7
+ Render PlantUML as editable <a href="https://excalidraw.com">Excalidraw</a> scenes, SVG and PNG — 29 diagram types, zero Java, zero network.
8
+ </p>
9
9
 
10
- > PlantUML → ELK layout → Excalidraw renderer with a plugin-based parser. &nbsp;·&nbsp; **v0.19.5** &nbsp;·&nbsp; 265 tests &nbsp;·&nbsp; MIT
11
-
12
- `@grethel-labs/excaliplant` takes PlantUML source, runs it through a plugin-based
13
- parser, lays it out with [ELK](https://github.com/kieler/elkjs), and
14
- emits a `.excalidraw` JSON document — opening cleanly in any
15
- Excalidraw front-end. Optional helpers convert the result to SVG or
16
- PNG so the same pipeline can also produce static documentation
17
- artefacts.
10
+ <p align="center">
11
+ <a href="https://www.npmjs.com/package/@grethel-labs/excaliplant"><img src="https://img.shields.io/npm/v/@grethel-labs/excaliplant.svg?label=npm" alt="npm version" /></a>
12
+ <a href="https://www.npmjs.com/package/@grethel-labs/excaliplant"><img src="https://img.shields.io/npm/dm/@grethel-labs/excaliplant.svg" alt="downloads" /></a>
13
+ <a href="https://github.com/grethel-labs/excaliplant/actions/workflows/ci.yml"><img src="https://github.com/grethel-labs/excaliplant/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
14
+ <img src="https://img.shields.io/node/v/@grethel-labs/excaliplant.svg" alt="node" />
15
+ <a href="./LICENSE"><img src="https://img.shields.io/npm/l/@grethel-labs/excaliplant.svg" alt="MIT license" /></a>
16
+ </p>
18
17
 
19
18
  <table>
20
19
  <tr>
21
- <td align="center" width="50%">
22
- <a href="docs/ressources/generated/svg/modules.svg"><img src="docs/ressources/generated/svg/modules.svg" alt="Module structure" width="380"/></a><br/>
23
- <sub><b>Module structure</b> — rendered by excaliplant itself</sub>
24
- </td>
25
- <td align="center" width="50%">
26
- <a href="docs/ressources/generated/svg/sequence.svg"><img src="docs/ressources/generated/svg/sequence.svg" alt="renderPlantUml flow" width="380"/></a><br/>
27
- <sub><b>renderPlantUml flow</b> — rendered by excaliplant itself</sub>
28
- </td>
20
+ <td width="50%"><img src="docs/assets/sequence-checkout-flow.png" alt="Sequence diagram" /></td>
21
+ <td width="50%"><img src="docs/assets/class-shop-domain.png" alt="Class diagram" /></td>
22
+ </tr>
23
+ <tr>
24
+ <td><img src="docs/assets/activity-order-processing.png" alt="Activity diagram" /></td>
25
+ <td><img src="docs/assets/component-c4-container.png" alt="C4 container diagram" /></td>
26
+ </tr>
27
+ <tr>
28
+ <td><img src="docs/assets/state-order-lifecycle.png" alt="State diagram" /></td>
29
+ <td><img src="docs/assets/mindmap-excaliplant.png" alt="Mind map" /><br /><br /><img src="docs/assets/json-api-response.png" alt="JSON diagram" /></td>
29
30
  </tr>
30
31
  </table>
31
32
 
32
- > ⚠️ This README is generated. Edit
33
- > [`docs/README.template.md.njk`](./docs/README.template.md.njk) and
34
- > run `npm run build:docs`.
35
-
36
- > **AI-generated project notice:** This repository, including source code,
37
- > documentation, comments, and generated artefacts, was created almost entirely
38
- > with AI assistance. The maintainer does not adopt every generated sentence,
39
- > implementation detail, or artefact as a personal statement, endorsement, or
40
- > guarantee. Review everything carefully and use the code at your own risk; the
41
- > MIT License warranty disclaimer applies.
33
+ <p align="center"><sub>Every image above is generated by excaliplant from the files in <a href="examples/"><code>examples/</code></a>. Browse all 35 in the <a href="docs/gallery.md"><b>gallery</b></a>.</sub></p>
42
34
 
43
- ---
35
+ ## Why excaliplant?
44
36
 
45
- ## How to use
37
+ - **Looks like a whiteboard, stays a diagram.** Output is a real Excalidraw scene: open it in Excalidraw, move boxes, arrows stay bound.
38
+ - **Broad PlantUML coverage.** Sequence, class, activity, state, component, C4, Gantt, mind maps, JSON, regex, math — see the [full list](#supported-diagrams).
39
+ - **The PlantUML language, not just diagrams.** Preprocessor (`!procedure`, `!function`, loops, JSON variables, `!include`), Creole markup, `skinparam`, `<style>`, themes, colours and bundled C4/ArchiMate libraries.
40
+ - **Pure JavaScript.** No Java, no Graphviz, no PlantUML server. Layout runs on [ELK](https://github.com/kieler/elkjs) and purpose-built engines.
41
+ - **Deterministic.** Same input, same bytes — ideal for docs in git.
42
+ - **Safe for untrusted input.** Resource limits, escaped output, no file or network access unless you opt in.
46
43
 
47
- ### Install
44
+ ## Quick start
48
45
 
49
46
  ```sh
50
47
  npm install @grethel-labs/excaliplant
51
48
  ```
52
49
 
53
- `@resvg/resvg-js` is pulled in as a runtime dependency so the SVG and
54
- PNG export paths work out of the box.
55
-
56
- ### Render PlantUML to an Excalidraw document
57
-
58
- ```js
59
- import { renderPlantUml } from "@grethel-labs/excaliplant";
60
-
61
- const excalidraw = await renderPlantUml(plantumlText, { sourceLabel: "demo" });
62
- // → write `excalidraw` to disk as <name>.excalidraw, or hand it to an
63
- // Excalidraw embed.
64
- ```
65
-
66
- ### Render to SVG / PNG
67
-
68
- The result of `renderPlantUml(...)` is a thenable — you can `await` it
69
- to get the Excalidraw JSON, or chain `.toSvg()` / `.toPng()` on it to
70
- get the rasterised diagram in a single line. Both outputs keep the
71
- hand-drawn Excalidraw look (strokes are produced via `roughjs`, the
72
- same library Excalidraw uses internally).
73
-
74
- ```js
75
- import { renderPlantUml } from "@grethel-labs/excaliplant";
50
+ ### Command line
76
51
 
77
- const svg = await renderPlantUml(plantumlText).toSvg();
78
- const png = await renderPlantUml(plantumlText).toPng({ width: 4800 });
52
+ ```sh
53
+ npx excaliplant diagram.puml -o diagram.svg # hand-drawn SVG
54
+ npx excaliplant diagram.puml -o diagram.png --width 1600
55
+ npx excaliplant diagram.puml -o diagram.excalidraw # open in excalidraw.com
56
+ cat diagram.puml | npx excaliplant -f svg --theme dark > diagram.svg
79
57
  ```
80
58
 
81
- The lower-level helpers are still exported if you need them:
59
+ ### JavaScript
82
60
 
83
61
  ```js
84
- import {
85
- renderPlantUml,
86
- excalidrawJsonToCanvasSvg,
87
- svgToPng,
88
- } from "@grethel-labs/excaliplant";
89
-
90
- const doc = await renderPlantUml(plantumlText);
91
- const svg = excalidrawJsonToCanvasSvg(doc, { width: 1200 });
92
- const png = svgToPng(svg, { width: 4800 }); // 4× SVG width
62
+ import { render } from "@grethel-labs/excaliplant";
63
+
64
+ const result = await render(`
65
+ @startuml
66
+ Alice -> Bob : hello
67
+ Bob --> Alice : hi!
68
+ @enduml
69
+ `);
70
+
71
+ result.kind; // "sequence"
72
+ result.excalidraw; // Excalidraw scene (JSON)
73
+ await result.toSvg(); // standalone SVG with embedded Excalifont
74
+ await result.toPng({ width: 1200 }); // PNG Buffer
75
+ result.diagnostics; // warnings with line numbers
93
76
  ```
94
77
 
95
- Lower-level entry points are also exported:
96
-
97
- | Export | Purpose |
98
- | ------------------------------- | ------------------------------------------------ |
99
- | `parsePlantUml(text)` | PlantUML → `Diagram` model |
100
- | `layoutDiagram(diagram)` | Sizing + ELK layout + edge routing |
101
- | `exportDiagram(diagram)` | Diagram → Excalidraw JSON |
102
- | `excalidrawToSvg(doc)` | Excalidraw JSON → tightly-cropped SVG |
103
- | `excalidrawJsonToCanvasSvg(…)` | …same, letter-boxed onto a fixed-aspect canvas |
104
- | `svgToPng(svg)` | Rasterise SVG to PNG (`@resvg/resvg-js`) |
105
-
106
- The complete list of exported symbols, with parameter tables and
107
- return types, lives in [`docs/API.md`](./docs/API.md). It is
108
- regenerated from JSDoc on every `npm run build:docs` run.
109
-
110
- ### Sequence diagram coverage
111
-
112
- Sequence diagrams support participants (`participant`, `actor`,
113
- `boundary`, `control`, `entity`, `database`, `collections`, `queue`),
114
- quoted aliases in both `Name as Alias` and `Alias as "Name"` forms,
115
- message arrows including async/reply/reverse/bidirectional variants,
116
- notes, participant `box ... end box` groups, `ref over` references,
117
- dividers (`== label ==`), delays (`... label ...`), spacers (`|||` /
118
- `||45||`), `autonumber` start/stop/resume, lifecycle controls (`create`, `activate`,
119
- `deactivate`, `destroy`) and inline message lifecycle suffixes
120
- (`++`, `--`, `**`, `!!`). Combined fragments render for `opt`,
121
- `loop`, `alt`/`else`, `par`/`and`, `break`, `critical`/`option`, and
122
- `group`/`option` blocks. A small sequence `skinparam` subset maps
123
- directly to output colours in block or compact form: `ArrowColor`,
124
- `ParticipantBackgroundColor`, `ParticipantBorderColor`, and
125
- `LifeLineBorderColor`; supported CSS-like `<style>` blocks safely map
126
- participant, arrow, note, group, lifeline, divider, and activation-bar
127
- colour properties. Graph diagrams also support a sanitized colour subset
128
- for common `skinparam` keys and CSS-like `<style>` selectors covering
129
- backgrounds, component-style boxes, arrows, edge labels, notes, and
130
- containers. Shared PlantUML presentation commands such as
131
- `title`, `caption`, `header`, `footer`, `legend`, and `mainframe`
132
- are preserved in parsed models and rendered where supported; PlantUML
133
- links in graph labels and sequence message labels are kept as safe
134
- Excalidraw link metadata. Creole and legacy HTML-like label markup
135
- degrades to readable plain text across supported diagram families,
136
- including emphasis, headings, lists, tables, Unicode notation, and
137
- icon placeholders.
138
-
139
- See the full [Sequence Diagram Component Coverage](./docs/sequence-components.md) for detailed examples and support matrix.
140
-
141
- See the generated [Diagram Module Coverage Gallery](./docs/module-coverage.md) for rendered small and complex examples across diagram modules. The gallery includes SVG artefacts for edge cases, overlap-prone layouts, functional decisions, deliberate design choices, wild feature combinations, and repo-derived examples where the diagram type naturally maps to the source tree.
142
-
143
- ### UML graph diagram coverage
144
-
145
- Class diagrams support the common PlantUML class-family declarations
146
- (`class`, `abstract`, `interface`, `enum`, `annotation`, `entity`,
147
- `protocol`, `struct`, `record`, `dataclass`, and related aliases),
148
- generic headers, `extends` / `implements`, class body members and
149
- separators, colon member rows, implicit relationship endpoints,
150
- inheritance, realization, composition, aggregation, dependency and
151
- association arrows, multiplicities, member-qualified arrows,
152
- association classes, qualified associations, packages/namespaces, notes
153
- on classes, members and links, JSON/object display blocks, hide/show/
154
- remove/restore filters, and sanitized graph colours/styles.
155
-
156
- Object diagrams support object declarations, quoted aliases, field rows,
157
- body fields, class-style relationships with implicit object endpoints,
158
- association-object diamonds, map/associative-array tables, row anchors
159
- via `Map::key`, row-to-object links, PERT-style map nodes, JSON display
160
- blocks, shared graph notes/styles/presentation, and underlined object
161
- titles in generated Excalidraw output.
162
-
163
- Activity diagrams support the practical PlantUML activity core: beta
164
- `:action;` flows with multiline text, start/stop/end/kill/detach,
165
- if/else/switch/while/repeat/fork/split controls, swimlanes, partitions,
166
- notes, connectors, goto/label, simple `-`/`*` action lists,
167
- SDL-style stereotypes, and legacy `(*) --> "Activity"` arrows with
168
- labels. Activity output uses the shared graph layout/rendering pipeline
169
- for deterministic Excalidraw, SVG, and PNG artefacts.
170
-
171
- Component diagrams support bracket and keyword component declarations,
172
- aliases, multiline labels, optional interface endpoints, lollipop
173
- interfaces, packages/nodes/folders/frames/clouds/databases, direction
174
- hints, styled arrows, notes including note-on-link, presentation
175
- metadata, hidden edges, `port` / `portin` / `portout` declarations,
176
- `Component::port` anchors, JSON display blocks, and shared
177
- hide/remove/restore and style handling.
178
-
179
- Deployment diagrams support official deployment elements such as
180
- `node`, `artifact`, `folder`, `frame`, `cloud`, `database`, `queue`,
181
- `card`, `package`, `stack`, `storage`, `agent`, `file`, `process`,
182
- and `action`; nested containers; aliases; bracketed long descriptions;
183
- JSON display blocks; styled arrows; implicit node endpoints; and shared
184
- graph notes, presentation, filters, and style handling.
185
-
186
- State diagrams support simple and composite states, aliases, start/end,
187
- choice, fork, join, history and deep-history pseudostates, state
188
- descriptions, nested state blocks, orthogonal region separators, labelled
189
- transitions, direction hints, inline colours, notes, JSON display blocks,
190
- scale/layout controls, hide-empty-description commands, and shared graph
191
- presentation/style handling.
192
-
193
- Timing diagrams support PlantUML `robust`, `concise`, `binary`, `clock`,
194
- `analog`, and `rectangle` participant declarations, aliases, participant
195
- state lists, absolute and relative time markers, anchored times, state
196
- changes, binary and clock waveforms, analog polylines, cross-participant
197
- messages, duration constraints, highlights, top/bottom notes, scale and
198
- hidden-axis controls, footbox/resource hiding directives, separators, and
199
- safe text/colour handling on a deterministic shared time axis.
200
-
201
- ### Data, Grammar, and Math Diagram Coverage
202
-
203
- Regex diagrams support `@startregex` sources with literal text, shorthand and
204
- range character classes, escaped and unicode categories, groups, lookaround-like
205
- assertion groups, anchors, alternatives, and repetition operators. They render as
206
- bounded railroad-style graph diagrams.
207
-
208
- EBNF diagrams support `@startebnf` rules with terminals, non-terminals,
209
- sequences, alternatives, optional blocks, repetition blocks, grouping, special
210
- sequences, comments/notes, and documented style/pragma lines tolerated by the
211
- parser. They share the railroad-style graph output used by regex diagrams.
212
-
213
- JSON diagrams support `@startjson` objects, arrays, strings, numbers, booleans,
214
- `null`, empty objects/arrays, unicode and escape sequences through the platform
215
- JSON parser, plus PlantUML `#highlight` paths. YAML diagrams support the
216
- documented safe subset for mappings, sequences, scalars, symbol/unicode keys,
217
- and `#highlight` paths. Both render nested data as deterministic graph trees.
218
-
219
- Math support covers standalone `@startmath` / `@startlatex` formula diagrams and
220
- inline `<math>` / `<latex>` tags in existing labels. The renderer intentionally
221
- uses a safe readable text fallback instead of pulling in external formula
222
- rendering dependencies.
223
-
224
- ### Network, UI, and Architecture Coverage
225
-
226
- Network diagrams support `@startnwdiag` with `nwdiag` network lanes, address
227
- metadata, groups, devices, multi-homed device declarations, and peer
228
- connections. Devices render through the shared graph pipeline so labels are
229
- measured and routed deterministically.
230
-
231
- Salt diagrams support `@startsalt` wireframes with low-fidelity labels,
232
- buttons, radio buttons, checkboxes, text fields, dropdowns, tabs, grid/table
233
- rows, and textarea-style blocks. Unsupported Salt decoration degrades to safe
234
- readable labels instead of raw markup.
235
-
236
- Archimate diagrams support `archimate` element declarations with categories,
237
- aliases, stereotypes, junction declarations, simple rectangle states, and
238
- directed relationships. External sprites and stdlib-specific icons use safe
239
- text/type fallbacks.
240
-
241
- ### Planning, Hierarchy, and Files Coverage
242
-
243
- Gantt diagrams support `@startgantt` task declarations with durations, explicit
244
- starts and ends, milestones, project starts, separators, and simple task
245
- dependencies. The parser records scheduling details on deterministic task boxes
246
- and routes dependencies through the shared graph pipeline.
247
-
248
- Mindmap and WBS diagrams support PlantUML OrgMode-style markers, Markdown-style
249
- heading/list input, side/direction directives, mixed `*` / `+` hierarchy
250
- markers, and safe text handling. Files diagrams support `@startfiles` path trees
251
- with shared folder merging and file/folder stereotypes.
252
-
253
- Chronology diagrams support dated milestones, labelled timestamp entries, simple
254
- ranges, start/end directives, and dependencies between events. Unsupported
255
- calendar-specific presentation lines are tolerated so useful chronology content
256
- still renders as safe readable timeline graphs.
257
-
258
- ### Entity Relationship Coverage
259
-
260
- Information Engineering diagrams support PlantUML `entity` declarations with
261
- attribute rows plus crow-foot relationship operators such as `}|..||`,
262
- `}o..o|`, `||--o{`, and `|o--||`. Cardinality and optionality markers are kept
263
- as endpoint labels so exported diagrams remain deterministic and reviewable.
264
-
265
- Chen ER diagrams support `@startchen` entity, relationship, attribute,
266
- derived-attribute, multi-valued-attribute, and key declarations, including
267
- empty or member-bearing blocks, simple orientation directives, aliases, and
268
- cardinality-labelled connections such as `Person -N- Birthplace`.
269
-
270
- ### Special Rendering Coverage
271
-
272
- Ditaa diagrams support `@startditaa` blocks and inline `ditaa(...)` sources.
273
- The parser preserves bounded ASCII canvas lines, consumes common rendering
274
- options such as no-separator, no-shadow, and scale hints, and emits a safe
275
- deterministic Excalidraw graph representation instead of executing an external
276
- Ditaa renderer.
277
-
278
- Chart diagrams support `@startchart` sources with horizontal and vertical axes,
279
- bar, line, area, and scatter series, labels, colours, legends, orientation, and
280
- stacking options. Series and option rows render as reviewable graph-backed
281
- chart metadata with the same SVG escaping and layout bounds as other diagram
282
- families.
283
-
284
- Use-case diagrams support actor and usecase declarations in keyword,
285
- colon, parenthesized, quoted-alias, reverse-description, stereotype, and
286
- business `/` forms; nested `package` / `rectangle` system boundaries;
287
- include, extend, generalization, directional, labelled, and inline-styled
288
- relationships; notes attached to aliases or usecases; and shared graph
289
- presentation, link, text-markup, skinparam, and `<style>` handling.
290
-
291
- ### Run the tests
292
-
293
- ```sh
294
- npm test
295
- ```
296
-
297
- Ships with **265 tests** across functional, edge-case,
298
- security (XSS / ReDoS / prototype-pollution), and self-introspection
299
- suites.
300
-
301
- ---
302
-
303
- ## Self-rendered architecture diagrams
304
-
305
- The diagrams below are produced **by excaliplant itself** at build
306
- time from PlantUML sources that describe this very repository. The
307
- text under each image is extracted from the source via `@diagram`
308
- JSDoc tags.
78
+ ## How it works
79
+
80
+ <img src="docs/assets/pipeline.png" alt="excaliplant pipeline" />
81
+
82
+ Each diagram type is a small module with four hooks — `detect`, `parse`, `layout`, `draw` — on top of a shared core (preprocessor, PlantUML syntax helpers, text measurement with real font metrics, a drawing canvas and the renderers). Modules never touch Excalidraw or SVG directly; they draw shapes on a canvas, which keeps the three output formats in sync. See [`docs/architecture.md`](docs/architecture.md).
83
+
84
+ ## Supported diagrams
85
+
86
+ | Diagram | Start | Highlights |
87
+ | --- | --- | --- |
88
+ | [Activity diagram](docs/gallery.md#activity) | `@startuml` `@startactivity` | New syntax with if/switch/while/repeat/fork/split, partitions, notes and swimlanes. |
89
+ | [Activity diagram (legacy syntax)](docs/gallery.md#legacy-activity) | `@startuml` | The classic `(*) --> "Activity"` syntax with sync bars and branches. |
90
+ | [ArchiMate diagram](docs/gallery.md#archimate) | `@startuml` | ArchiMate elements by layer with icons, junctions and `Rel_*` macros. |
91
+ | [AsciiMath formula](docs/gallery.md#math) | `@startmath` | AsciiMath formulas. |
92
+ | [Chart](docs/gallery.md#chart) | `@startchart` | Bar, line, area and scatter charts. |
93
+ | [Chen ER diagram](docs/gallery.md#chen) | `@startchen` | Chen ER diagrams: entities, weak entities, relationships, attributes, cardinalities. |
94
+ | [Chronology](docs/gallery.md#chronology) | `@startchronology` | Events and spans on a time line with links. |
95
+ | [Class / IE diagram](docs/gallery.md#class) | `@startuml` | Classes, interfaces, enums, generics, members, packages, all UML relations, IE crow's feet. |
96
+ | [Component diagram](docs/gallery.md#component) | `@startuml` | Components, interfaces, ports, packages, nodes — and C4 via `!include <C4/...>`. |
97
+ | [Creole text](docs/gallery.md#creole) | `@startcreole` | Rich text with headings, lists, tables and links. |
98
+ | [Deployment diagram](docs/gallery.md#deployment) | `@startuml` | Nodes, clouds, databases, queues, artifacts and nested deployment targets. |
99
+ | [Ditaa ASCII art](docs/gallery.md#ditaa) | `@startditaa` `@startuml` | ASCII art boxes, lines, arrows and colour tags. |
100
+ | [EBNF railroad](docs/gallery.md#ebnf) | `@startebnf` | EBNF grammars as railroad diagrams. |
101
+ | [File tree](docs/gallery.md#files) | `@startfiles` | File trees from path lists with notes. |
102
+ | [Gantt chart](docs/gallery.md#gantt) | `@startgantt` `@startuml` | Tasks, dependencies, milestones, progress, resources, closed days, today marker. |
103
+ | [Graphviz DOT](docs/gallery.md#dot) | `@startdot` | Graphviz DOT graphs laid out with ELK. |
104
+ | [JSON data](docs/gallery.md#json) | `@startjson` | JSON documents as linked tables with highlights. |
105
+ | [LaTeX formula](docs/gallery.md#latex) | `@startlatex` | LaTeX formulas. |
106
+ | [MindMap](docs/gallery.md#mindmap) | `@startmindmap` | OrgMode/Markdown outlines on both sides, colours, boxless nodes. |
107
+ | [Network diagram](docs/gallery.md#nwdiag) | `@startnwdiag` `@startuml` | Networks, addresses, multi-homed nodes, groups and peer links. |
108
+ | [Object diagram](docs/gallery.md#object) | `@startuml` | Objects with fields, maps (`key => value`) and links. |
109
+ | [Regex railroad](docs/gallery.md#regex) | `@startregex` | Regular expressions as railroad diagrams. |
110
+ | [Salt wireframe](docs/gallery.md#salt) | `@startsalt` `@startuml` | Wireframes: grids, buttons, inputs, check boxes, trees, tabs, group boxes. |
111
+ | [Sequence diagram](docs/gallery.md#sequence) | `@startuml` `@startsequence` | Participants, all arrow styles, activations, notes, fragments, dividers, autonumber, boxes. |
112
+ | [State diagram](docs/gallery.md#state) | `@startuml` | Composite states, concurrent regions, choice, fork/join, history, entry/exit actions. |
113
+ | [Timing diagram](docs/gallery.md#timing) | `@startuml` `@starttiming` | Robust, concise, clock, binary and analog signals with messages and constraints. |
114
+ | [Use case diagram](docs/gallery.md#usecase) | `@startuml` | Actors, use cases, system boundaries, include/extend. |
115
+ | [Work breakdown structure](docs/gallery.md#wbs) | `@startwbs` | Work breakdown structures as org charts. |
116
+ | [YAML data](docs/gallery.md#yaml) | `@startyaml` | YAML documents as linked tables. |
117
+
118
+ ## PlantUML language support
119
+
120
+ | Feature | Notes |
121
+ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
122
+ | Preprocessor | `!$var`, `!define`/`!definelong`, `!if`/`!elseif`/`!else`, `!ifdef`, `!while`, `!foreach`, `!procedure`, `!function`/`!return`, default and keyword arguments, JSON variables, builtins (`%strlen`, `%upper`, `%date`, `%lighten`, …), `!include`/`!includesub` via resolver, `!theme`, `!pragma`, `!log`, `!assert` |
123
+ | Standard library | Bundled, offline implementations of `<C4/C4_Context>`, `<C4/C4_Container>`, `<C4/C4_Component>`, … and `<archimate/Archimate>` |
124
+ | Creole | `**bold**`, `//italic//`, `""mono""`, `--strike--`, `__underline__`, `~~wave~~`, headings, bullet and numbered lists, tables, separators, `<b>`, `<i>`, `<color>`, `<size>`, `<back>`, `<sub>`, `<sup>`, `[[links]]`, `<U+XXXX>` |
125
+ | Styling | `skinparam` (single line and blocks), `<style>` sheets, inline colours `#back;line:red;line.dashed;text:blue`, all HTML colour names, gradients (first colour) |
126
+ | Commons | `title`, `caption`, `header`, `footer`, `legend`, `mainframe`, `hide`/`show`, `left to right direction`, `newpage`, multiple `@start…@end` blocks |
127
+
128
+ ## Themes
129
+
130
+ Pick a theme with `--theme` / `{ theme }`, or let PlantUML's `!theme` choose the closest match. Available: `sketch`, `plain`, `hachure`, `mono`, `dark`, `blueprint`. Add `--clean` / `{ sketch: false }` for straight lines.
309
131
 
310
- ### Module structure
311
-
312
- ![Module structure](docs/ressources/generated/svg/modules.svg)
313
-
314
- _Sources: [PlantUML](docs/ressources/generated/puml/modules.puml) · [SVG](docs/ressources/generated/svg/modules.svg)_
315
-
316
- The module graph reflects how the source is laid out under
317
- [`src/`](./src/). Diagram-type behavior is collected in first-class
318
- module folders under `src/diagrams/`, orchestration lives under
319
- `src/main/`, and host capabilities live under `src/general/platform/`.
320
-
321
- ### renderPlantUml flow
322
-
323
- ![renderPlantUml flow](docs/ressources/generated/svg/sequence.svg)
324
-
325
- _Sources: [PlantUML](docs/ressources/generated/puml/sequence.puml) · [SVG](docs/ressources/generated/svg/sequence.svg)_
326
-
327
- The call graph for `renderPlantUml(text)` walks three subsystems:
328
-
329
- 1. **parser** turns PlantUML text into a model (`Diagram` /
330
- `SequenceDiagram`). The parser is plugin-driven; see the next
331
- diagram for the plugin breakdown.
332
- 2. **layout** decides positions. Component diagrams go through ELK
333
- (layered + orthogonal routing); sequence diagrams use a small
334
- deterministic tabular layout.
335
- 3. **renderer** walks the laid-out model and emits Excalidraw JSON.
336
- The same model can also be exported to SVG via
337
- [`src/general/render/svg.mjs`](./src/general/render/svg.mjs) — used by the
338
- documentation pipeline.
339
-
340
- ### Parser plugins
341
-
342
- ![Parser plugins](docs/ressources/generated/svg/plugins.svg)
343
-
344
- _Sources: [PlantUML](docs/ressources/generated/puml/plugins.puml) · [SVG](docs/ressources/generated/svg/plugins.svg)_
345
-
346
- Each parser plugin is a tiny self-contained file that handles ONE
347
- PlantUML construct. The engine offers each input line to plugins
348
- in registration order; the first plugin that returns `true` wins.
349
-
350
- To add support for a new PlantUML keyword, drop a new file in the
351
- owning diagram module folder and append it to that module's parser
352
- contract. No engine change required.
353
-
354
- ### Model classes
355
-
356
- ![Model classes](docs/ressources/generated/svg/model.svg)
357
-
358
- _Sources: [PlantUML](docs/ressources/generated/puml/model.puml) · [SVG](docs/ressources/generated/svg/model.svg)_
359
-
360
- The model diagram is generated dynamically from exported classes in
361
- [`src/general/model/diagram.mjs`](./src/general/model/diagram.mjs). It shows how the
362
- reusable arrow classes sit underneath both component connections and
363
- sequence messages, so future model classes appear in the README without
364
- hand-maintained PlantUML.
365
-
366
- ## Pipeline
367
-
368
- ```text
369
- PlantUML text
370
- │ parsePlantUml()
371
- ▼
372
- Diagram (planes, subplanes, boxes, connections)
373
- │ layoutDiagram() (sizing → ELK layered + orthogonal routing → chamfer)
374
- ▼
375
- Diagram with absolute positions and edge paths
376
- │ exportDiagram()
377
- ▼
378
- Excalidraw JSON
379
- │ excalidrawJsonToCanvasSvg() (optional)
380
- ▼
381
- SVG ── svgToPng() ──▶ PNG (both optional, no headless browser)
382
- ```
132
+ <table>
133
+ <tr>
134
+ <td align="center"><img src="docs/assets/theme-sketch.png" width="250" alt="sketch theme" /><br /><code>sketch</code></td>
135
+ <td align="center"><img src="docs/assets/theme-plain.png" width="250" alt="plain theme" /><br /><code>plain</code></td>
136
+ <td align="center"><img src="docs/assets/theme-hachure.png" width="250" alt="hachure theme" /><br /><code>hachure</code></td>
137
+ </tr>
138
+ <tr>
139
+ <td align="center"><img src="docs/assets/theme-mono.png" width="250" alt="mono theme" /><br /><code>mono</code></td>
140
+ <td align="center"><img src="docs/assets/theme-dark.png" width="250" alt="dark theme" /><br /><code>dark</code></td>
141
+ <td align="center"><img src="docs/assets/theme-blueprint.png" width="250" alt="blueprint theme" /><br /><code>blueprint</code></td>
142
+ </tr>
143
+ </table>
383
144
 
384
- ## Repository layout
145
+ ## API
146
+
147
+ | Export | Description |
148
+ | ----------------------------------------- | ----------------------------------------------------------------- |
149
+ | `render(source, options?)` | Render the first (or `options.block`) diagram → `RenderResult` |
150
+ | `renderAll(source, options?)` | Render every `@start…@end` block |
151
+ | `parse(source, options?)` | Parse without layout → `{ kind, model, diagnostics }` |
152
+ | `detectKind(source)` | Detected diagram kind |
153
+ | `listDiagramTypes()` | Supported kinds and their start keywords |
154
+ | `renderPlantUml(source)` | 0.x-compatible: `await` → Excalidraw JSON, `.toSvg()`, `.toPng()` |
155
+ | `preprocessText(source, options?)` | Run only the preprocessor |
156
+ | `DiagramRegistry`, `defineDiagram` | Register your own diagram modules |
157
+ | `THEMES`, `THEME_NAMES`, `DEFAULT_LIMITS` | Built-in themes and resource limits |
158
+
159
+ `RenderResult` has `kind`, `name`, `excalidraw`, `diagnostics`, `pages`, `model`, `toJSON()`, `toSvg({ padding, background, embedFont })` and `toPng({ width, scale, background })`.
160
+
161
+ <details>
162
+ <summary><b>Render options</b></summary>
163
+
164
+ | Option | Default | Description |
165
+ | ---------- | ---------------- | ------------------------------------------------------------------------- |
166
+ | `theme` | `"sketch"` | Theme name or theme object |
167
+ | `sketch` | theme default | `false` for clean strokes |
168
+ | `seed` | `"excaliplant"` | Seed for ids and stroke wobble |
169
+ | `block` | `0` | Block index or `@startuml name` |
170
+ | `page` | `0` | Page of a `newpage` document |
171
+ | `strict` | `false` | Throw on unrecognised lines instead of warning |
172
+ | `include` | — | `(target, { from, kind }) => string \| null` resolver for `!include` |
173
+ | `defines` | — | Predefined preprocessor variables |
174
+ | `date` | `null` | Date returned by `%date()` (empty by default for reproducible output) |
175
+ | `limits` | `DEFAULT_LIMITS` | Input size, lines, nodes, edges, elements, preprocessor budget, PNG width |
176
+ | `kind` | auto | Force a diagram module |
177
+ | `registry` | built-in | Custom `DiagramRegistry` |
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><b>CLI options</b></summary>
385
183
 
386
184
  ```text
387
- excaliplant
388
- ├── assets
389
- │ ├── arrowheads
390
- │ │ ├── arrowheads.svg
391
- │ │ └── manifest.json
392
- │ └── fonts
393
- │ ├── Excalifont-Regular.ttf
394
- │ ├── Excalifont-Regular.woff2
395
- │ └── LICENSE.txt
396
- ├── bin
397
- │ └── excaliplant.mjs
398
- ├── docs
399
- │ ├── ressources
400
- │ │ ├── module-coverage
401
- │ │ │ ├── archimate
402
- │ │ │ ├── chart
403
- │ │ │ ├── chen
404
- │ │ │ ├── chronology
405
- │ │ │ ├── class
406
- │ │ │ ├── component
407
- │ │ │ ├── deployment
408
- │ │ │ ├── ditaa
409
- │ │ │ ├── ebnf
410
- │ │ │ ├── files
411
- │ │ │ ├── gantt
412
- │ │ │ ├── ie
413
- │ │ │ ├── json
414
- │ │ │ ├── math
415
- │ │ │ ├── mindmap
416
- │ │ │ ├── nwdiag
417
- │ │ │ ├── object
418
- │ │ │ ├── regex
419
- │ │ │ ├── salt
420
- │ │ │ ├── sequence
421
- │ │ │ ├── state
422
- │ │ │ ├── timing
423
- │ │ │ ├── wbs
424
- │ │ │ └── yaml
425
- │ │ └── sequence
426
- │ │ ├── puml
427
- │ │ └── svg
428
- │ ├── scripts
429
- │ │ ├── build-docs.mjs
430
- │ │ ├── build-module-coverage.mjs
431
- │ │ ├── build-sequence-coverage.mjs
432
- │ │ ├── check-build-manifest.mjs
433
- │ │ ├── config.mjs
434
- │ │ ├── extract-api.mjs
435
- │ │ ├── extract-docs.mjs
436
- │ │ ├── file-tree.mjs
437
- │ │ ├── module-coverage-sources.mjs
438
- │ │ └── self-diagrams.mjs
439
- │ ├── API.md
440
- │ ├── API.template.md.njk
441
- │ ├── README.template.md.njk
442
- │ ├── module-coverage.md
443
- │ ├── module-coverage.template.md.njk
444
- │ ├── sequence-components.md
445
- │ ├── sequence-components.template.md.njk
446
- │ └── src-structure-refactor-plan.md
447
- ├── scripts
448
- │ ├── auto-patch-deps.mjs
449
- │ ├── bump-release-version.mjs
450
- │ ├── clean-test-output.mjs
451
- │ ├── merge-driver-prefer-higher-version.mjs
452
- │ ├── prepublish-guard.mjs
453
- │ ├── setup-merge-drivers.mjs
454
- │ └── smoke.mjs
455
- ├── src
456
- │ ├── diagrams
457
- │ │ ├── activity
458
- │ │ │ ├── plugins
459
- │ │ │ ├── tests
460
- │ │ │ ├── assets.mjs
461
- │ │ │ ├── docs.mjs
462
- │ │ │ ├── layout.mjs
463
- │ │ │ ├── module.mjs
464
- │ │ │ ├── parser.mjs
465
- │ │ │ ├── render.mjs
466
- │ │ │ ├── security.mjs
467
- │ │ │ └── tests.mjs
468
- │ │ ├── archimate
469
- │ │ │ ├── docs
470
- │ │ │ ├── tests
471
- │ │ │ ├── assets.mjs
472
- │ │ │ ├── docs.mjs
473
- │ │ │ ├── layout.mjs
474
- │ │ │ ├── module.mjs
475
- │ │ │ ├── parser.mjs
476
- │ │ │ ├── render.mjs
477
- │ │ │ ├── security.mjs
478
- │ │ │ └── tests.mjs
479
- │ │ ├── base
480
- │ │ │ ├── artifacts.mjs
481
- │ │ │ ├── assets.mjs
482
- │ │ │ ├── dependencies.mjs
483
- │ │ │ ├── docs.mjs
484
- │ │ │ ├── index.mjs
485
- │ │ │ ├── layout.mjs
486
- │ │ │ ├── module.mjs
487
- │ │ │ ├── parser.mjs
488
- │ │ │ ├── renderer.mjs
489
- │ │ │ ├── security.mjs
490
- │ │ │ └── tests.mjs
491
- │ │ ├── chart
492
- │ │ │ ├── docs
493
- │ │ │ ├── tests
494
- │ │ │ ├── assets.mjs
495
- │ │ │ ├── docs.mjs
496
- │ │ │ ├── layout.mjs
497
- │ │ │ ├── module.mjs
498
- │ │ │ ├── parser.mjs
499
- │ │ │ ├── render.mjs
500
- │ │ │ ├── security.mjs
501
- │ │ │ └── tests.mjs
502
- │ │ ├── chen
503
- │ │ │ ├── docs
504
- │ │ │ ├── tests
505
- │ │ │ ├── assets.mjs
506
- │ │ │ ├── docs.mjs
507
- │ │ │ ├── layout.mjs
508
- │ │ │ ├── module.mjs
509
- │ │ │ ├── parser.mjs
510
- │ │ │ ├── render.mjs
511
- │ │ │ ├── security.mjs
512
- │ │ │ └── tests.mjs
513
- │ │ ├── chronology
514
- │ │ │ ├── docs
515
- │ │ │ ├── tests
516
- │ │ │ ├── assets.mjs
517
- │ │ │ ├── docs.mjs
518
- │ │ │ ├── layout.mjs
519
- │ │ │ ├── module.mjs
520
- │ │ │ ├── parser.mjs
521
- │ │ │ ├── render.mjs
522
- │ │ │ ├── security.mjs
523
- │ │ │ └── tests.mjs
524
- │ │ ├── class
525
- │ │ │ ├── docs
526
- │ │ │ ├── plugins
527
- │ │ │ ├── tests
528
- │ │ │ ├── assets.mjs
529
- │ │ │ ├── docs.mjs
530
- │ │ │ ├── layout.mjs
531
- │ │ │ ├── module.mjs
532
- │ │ │ ├── parser.mjs
533
- │ │ │ ├── render.mjs
534
- │ │ │ ├── security.mjs
535
- │ │ │ ├── style.mjs
536
- │ │ │ └── tests.mjs
537
- │ │ ├── component
538
- │ │ │ ├── docs
539
- │ │ │ ├── plugins
540
- │ │ │ ├── tests
541
- │ │ │ ├── assets.mjs
542
- │ │ │ ├── docs.mjs
543
- │ │ │ ├── layout.mjs
544
- │ │ │ ├── module.mjs
545
- │ │ │ ├── parser.mjs
546
- │ │ │ ├── render.mjs
547
- │ │ │ ├── security.mjs
548
- │ │ │ └── tests.mjs
549
- │ │ ├── deployment
550
- │ │ │ ├── docs
551
- │ │ │ ├── plugins
552
- │ │ │ ├── tests
553
- │ │ │ ├── assets.mjs
554
- │ │ │ ├── docs.mjs
555
- │ │ │ ├── layout.mjs
556
- │ │ │ ├── module.mjs
557
- │ │ │ ├── parser.mjs
558
- │ │ │ ├── render.mjs
559
- │ │ │ ├── security.mjs
560
- │ │ │ └── tests.mjs
561
- │ │ ├── ditaa
562
- │ │ │ ├── docs
563
- │ │ │ ├── tests
564
- │ │ │ ├── assets.mjs
565
- │ │ │ ├── docs.mjs
566
- │ │ │ ├── layout.mjs
567
- │ │ │ ├── module.mjs
568
- │ │ │ ├── parser.mjs
569
- │ │ │ ├── render.mjs
570
- │ │ │ ├── security.mjs
571
- │ │ │ └── tests.mjs
572
- │ │ ├── ebnf
573
- │ │ │ ├── docs
574
- │ │ │ ├── tests
575
- │ │ │ ├── assets.mjs
576
- │ │ │ ├── docs.mjs
577
- │ │ │ ├── layout.mjs
578
- │ │ │ ├── module.mjs
579
- │ │ │ ├── parser.mjs
580
- │ │ │ ├── render.mjs
581
- │ │ │ ├── security.mjs
582
- │ │ │ └── tests.mjs
583
- │ │ ├── files
584
- │ │ │ ├── docs
585
- │ │ │ ├── tests
586
- │ │ │ ├── assets.mjs
587
- │ │ │ ├── docs.mjs
588
- │ │ │ ├── layout.mjs
589
- │ │ │ ├── module.mjs
590
- │ │ │ ├── parser.mjs
591
- │ │ │ ├── render.mjs
592
- │ │ │ ├── security.mjs
593
- │ │ │ └── tests.mjs
594
- │ │ ├── gantt
595
- │ │ │ ├── docs
596
- │ │ │ ├── tests
597
- │ │ │ ├── assets.mjs
598
- │ │ │ ├── docs.mjs
599
- │ │ │ ├── layout.mjs
600
- │ │ │ ├── module.mjs
601
- │ │ │ ├── parser.mjs
602
- │ │ │ ├── render.mjs
603
- │ │ │ ├── security.mjs
604
- │ │ │ └── tests.mjs
605
- │ │ ├── ie
606
- │ │ │ ├── docs
607
- │ │ │ ├── tests
608
- │ │ │ ├── assets.mjs
609
- │ │ │ ├── docs.mjs
610
- │ │ │ ├── layout.mjs
611
- │ │ │ ├── module.mjs
612
- │ │ │ ├── parser.mjs
613
- │ │ │ ├── render.mjs
614
- │ │ │ ├── security.mjs
615
- │ │ │ └── tests.mjs
616
- │ │ ├── json
617
- │ │ │ ├── docs
618
- │ │ │ ├── tests
619
- │ │ │ ├── assets.mjs
620
- │ │ │ ├── docs.mjs
621
- │ │ │ ├── layout.mjs
622
- │ │ │ ├── module.mjs
623
- │ │ │ ├── parser.mjs
624
- │ │ │ ├── render.mjs
625
- │ │ │ ├── security.mjs
626
- │ │ │ └── tests.mjs
627
- │ │ ├── math
628
- │ │ │ ├── docs
629
- │ │ │ ├── tests
630
- │ │ │ ├── assets.mjs
631
- │ │ │ ├── docs.mjs
632
- │ │ │ ├── layout.mjs
633
- │ │ │ ├── module.mjs
634
- │ │ │ ├── parser.mjs
635
- │ │ │ ├── render.mjs
636
- │ │ │ ├── security.mjs
637
- │ │ │ └── tests.mjs
638
- │ │ ├── mindmap
639
- │ │ │ ├── docs
640
- │ │ │ ├── tests
641
- │ │ │ ├── assets.mjs
642
- │ │ │ ├── docs.mjs
643
- │ │ │ ├── layout.mjs
644
- │ │ │ ├── module.mjs
645
- │ │ │ ├── parser.mjs
646
- │ │ │ ├── render.mjs
647
- │ │ │ ├── security.mjs
648
- │ │ │ └── tests.mjs
649
- │ │ ├── nwdiag
650
- │ │ │ ├── docs
651
- │ │ │ ├── tests
652
- │ │ │ ├── assets.mjs
653
- │ │ │ ├── docs.mjs
654
- │ │ │ ├── layout.mjs
655
- │ │ │ ├── module.mjs
656
- │ │ │ ├── parser.mjs
657
- │ │ │ ├── render.mjs
658
- │ │ │ ├── security.mjs
659
- │ │ │ └── tests.mjs
660
- │ │ ├── object
661
- │ │ │ ├── docs
662
- │ │ │ ├── plugins
663
- │ │ │ ├── tests
664
- │ │ │ ├── assets.mjs
665
- │ │ │ ├── docs.mjs
666
- │ │ │ ├── layout.mjs
667
- │ │ │ ├── module.mjs
668
- │ │ │ ├── parser.mjs
669
- │ │ │ ├── render.mjs
670
- │ │ │ ├── security.mjs
671
- │ │ │ └── tests.mjs
672
- │ │ ├── regex
673
- │ │ │ ├── docs
674
- │ │ │ ├── tests
675
- │ │ │ ├── assets.mjs
676
- │ │ │ ├── docs.mjs
677
- │ │ │ ├── layout.mjs
678
- │ │ │ ├── module.mjs
679
- │ │ │ ├── parser.mjs
680
- │ │ │ ├── render.mjs
681
- │ │ │ ├── security.mjs
682
- │ │ │ └── tests.mjs
683
- │ │ ├── salt
684
- │ │ │ ├── docs
685
- │ │ │ ├── tests
686
- │ │ │ ├── assets.mjs
687
- │ │ │ ├── docs.mjs
688
- │ │ │ ├── layout.mjs
689
- │ │ │ ├── module.mjs
690
- │ │ │ ├── parser.mjs
691
- │ │ │ ├── render.mjs
692
- │ │ │ ├── security.mjs
693
- │ │ │ └── tests.mjs
694
- │ │ ├── sequence
695
- │ │ │ ├── docs
696
- │ │ │ ├── plugins
697
- │ │ │ ├── tests
698
- │ │ │ ├── assets.mjs
699
- │ │ │ ├── context.mjs
700
- │ │ │ ├── docs.mjs
701
- │ │ │ ├── layout.mjs
702
- │ │ │ ├── layout_engine.mjs
703
- │ │ │ ├── module.mjs
704
- │ │ │ ├── parser.mjs
705
- │ │ │ ├── render.mjs
706
- │ │ │ ├── render_excalidraw.mjs
707
- │ │ │ ├── security.mjs
708
- │ │ │ ├── spacing.mjs
709
- │ │ │ └── tests.mjs
710
- │ │ ├── shared
711
- │ │ │ ├── common_plugins
712
- │ │ │ ├── graph_plugins
713
- │ │ │ ├── data_runtime.mjs
714
- │ │ │ ├── er_runtime.mjs
715
- │ │ │ ├── graph_context.mjs
716
- │ │ │ ├── graph_parser.mjs
717
- │ │ │ ├── graph_runtime.mjs
718
- │ │ │ ├── planning_runtime.mjs
719
- │ │ │ ├── railroad_runtime.mjs
720
- │ │ │ ├── special_runtime.mjs
721
- │ │ │ └── tree_runtime.mjs
722
- │ │ ├── state
723
- │ │ │ ├── docs
724
- │ │ │ ├── plugins
725
- │ │ │ ├── tests
726
- │ │ │ ├── assets.mjs
727
- │ │ │ ├── docs.mjs
728
- │ │ │ ├── layout.mjs
729
- │ │ │ ├── module.mjs
730
- │ │ │ ├── parser.mjs
731
- │ │ │ ├── render.mjs
732
- │ │ │ ├── security.mjs
733
- │ │ │ └── tests.mjs
734
- │ │ ├── timing
735
- │ │ │ ├── docs
736
- │ │ │ ├── plugins
737
- │ │ │ ├── tests
738
- │ │ │ ├── assets.mjs
739
- │ │ │ ├── docs.mjs
740
- │ │ │ ├── layout.mjs
741
- │ │ │ ├── module.mjs
742
- │ │ │ ├── parser.mjs
743
- │ │ │ ├── render.mjs
744
- │ │ │ ├── render_excalidraw.mjs
745
- │ │ │ ├── security.mjs
746
- │ │ │ └── tests.mjs
747
- │ │ ├── use-case
748
- │ │ │ ├── plugins
749
- │ │ │ ├── tests
750
- │ │ │ ├── assets.mjs
751
- │ │ │ ├── docs.mjs
752
- │ │ │ ├── layout.mjs
753
- │ │ │ ├── module.mjs
754
- │ │ │ ├── parser.mjs
755
- │ │ │ ├── render.mjs
756
- │ │ │ ├── security.mjs
757
- │ │ │ └── tests.mjs
758
- │ │ ├── wbs
759
- │ │ │ ├── docs
760
- │ │ │ ├── tests
761
- │ │ │ ├── assets.mjs
762
- │ │ │ ├── docs.mjs
763
- │ │ │ ├── layout.mjs
764
- │ │ │ ├── module.mjs
765
- │ │ │ ├── parser.mjs
766
- │ │ │ ├── render.mjs
767
- │ │ │ ├── security.mjs
768
- │ │ │ └── tests.mjs
769
- │ │ ├── yaml
770
- │ │ │ ├── docs
771
- │ │ │ ├── tests
772
- │ │ │ ├── assets.mjs
773
- │ │ │ ├── docs.mjs
774
- │ │ │ ├── layout.mjs
775
- │ │ │ ├── module.mjs
776
- │ │ │ ├── parser.mjs
777
- │ │ │ ├── render.mjs
778
- │ │ │ ├── security.mjs
779
- │ │ │ └── tests.mjs
780
- │ │ └── index.mjs
781
- │ ├── general
782
- │ │ ├── layout
783
- │ │ │ ├── elk_layout.mjs
784
- │ │ │ └── sizing.mjs
785
- │ │ ├── model
786
- │ │ │ └── diagram.mjs
787
- │ │ ├── platform
788
- │ │ │ ├── asset_base.mjs
789
- │ │ │ ├── diagnostics.mjs
790
- │ │ │ ├── security_base.mjs
791
- │ │ │ └── services.mjs
792
- │ │ ├── render
793
- │ │ │ ├── canvas_svg.mjs
794
- │ │ │ ├── excalidraw.mjs
795
- │ │ │ ├── png.mjs
796
- │ │ │ ├── rng.mjs
797
- │ │ │ ├── schema.mjs
798
- │ │ │ └── svg.mjs
799
- │ │ └── style
800
- │ │ ├── colors.mjs
801
- │ │ ├── font.mjs
802
- │ │ ├── style.mjs
803
- │ │ └── text.mjs
804
- │ ├── main
805
- │ │ ├── builtin.mjs
806
- │ │ ├── dependencies.mjs
807
- │ │ ├── introspection.mjs
808
- │ │ ├── metadata.mjs
809
- │ │ ├── parser.mjs
810
- │ │ ├── pipeline.mjs
811
- │ │ └── registry.mjs
812
- │ └── util
813
- │ ├── parser_engine.mjs
814
- │ └── plantuml_utils.mjs
815
- ├── tests
816
- │ ├── helpers
817
- │ │ └── output.mjs
818
- │ ├── activity_components.test.mjs
819
- │ ├── class_components.test.mjs
820
- │ ├── component_components.test.mjs
821
- │ ├── deployment_components.test.mjs
822
- │ ├── edge_cases.test.mjs
823
- │ ├── functional_more.test.mjs
824
- │ ├── merge_driver.test.mjs
825
- │ ├── modular_architecture.test.mjs
826
- │ ├── module_coverage.test.mjs
827
- │ ├── object_components.test.mjs
828
- │ ├── plantuml.test.mjs
829
- │ ├── security.test.mjs
830
- │ ├── self_introspection.test.mjs
831
- │ ├── sequence_components.test.mjs
832
- │ ├── state_components.test.mjs
833
- │ ├── style.test.mjs
834
- │ └── usecase_components.test.mjs
835
- ├── AGENTS.md
836
- ├── CHANGELOG.md
837
- ├── CLAUDE.md
838
- ├── CONTRIBUTING.md
839
- ├── GEMINI.md
840
- ├── LICENSE
841
- ├── README.md
842
- ├── SECURITY.md
843
- ├── THIRD_PARTY_NOTICES.md
844
- ├── index.mjs
845
- ├── lifecycle-test.svg
846
- ├── package.json
847
- ├── style.example.json
848
- ├── style.example.yaml
849
- └── tsconfig.json
185
+ excaliplant [input.puml] [-o output] [options]
186
+
187
+ -o, --output <file> Output file (format from extension unless -f is given)
188
+ -f, --format <fmt> excalidraw | svg | png
189
+ -t, --theme <name> sketch | plain | hachure | mono | dark | blueprint
190
+ --clean Clean strokes instead of the hand-drawn look
191
+ --width <px> PNG width (16–16000)
192
+ --scale <n> PNG scale relative to the SVG size (default 2)
193
+ --background <color> Background colour for SVG/PNG
194
+ --seed <value> Seed for stroke wobble and element ids
195
+ --page <n> Page of a newpage document
196
+ --all Render every block ("{n}" in -o is the block number)
197
+ --include-dir <dir> Allow !include of files below <dir>
198
+ -D, --define NAME=value Predefine a preprocessor variable
199
+ --strict Fail on unrecognised lines
200
+ --list-types List supported diagram types
850
201
  ```
851
202
 
852
- Generated artefacts (`docs/ressources/generated/`) live in
853
- `.gitignore` — they are rebuilt by `npm run build:docs`. The
854
- single-page API reference at [`docs/API.md`](./docs/API.md) is
855
- generated by the same command from JSDoc.
856
-
857
- ## Module documentation
858
-
859
- ### diagrams
860
-
861
-
862
-
863
- ### diagrams/activity/assets
864
-
865
-
866
-
867
- ### diagrams/activity/docs
868
-
869
-
870
-
871
- ### diagrams/activity/layout
872
-
873
-
874
-
875
- ### diagrams/activity/module
876
-
877
-
878
-
879
- ### diagrams/activity/parser
880
-
881
-
882
-
883
- ### diagrams/activity/plugins/syntax
884
-
885
-
886
-
887
- ### diagrams/activity/render
888
-
889
-
890
-
891
- ### diagrams/activity/security
892
-
893
-
894
-
895
- ### diagrams/activity/tests
896
-
897
-
898
-
899
- ### diagrams/activity/tests/activity_components
900
-
901
-
902
-
903
- ### diagrams/base
904
-
905
-
906
-
907
- ### diagrams/base/artifacts
908
-
909
-
910
-
911
- ### diagrams/base/assets
912
-
913
-
914
-
915
- ### diagrams/base/dependencies
916
-
917
-
918
-
919
- ### diagrams/base/docs
920
-
921
-
922
-
923
- ### diagrams/base/layout
924
-
925
-
926
-
927
- ### diagrams/base/module
928
-
929
-
930
-
931
- ### diagrams/base/parser
932
-
933
-
934
-
935
- ### diagrams/base/renderer
936
-
937
-
938
-
939
- ### diagrams/base/security
940
-
941
-
942
-
943
- ### diagrams/base/tests
944
-
945
-
946
-
947
- ### diagrams/class/assets
948
-
949
-
950
-
951
- ### diagrams/class/docs
952
-
953
-
954
-
955
- ### diagrams/class/docs/coverage_examples
956
-
957
-
958
-
959
- ### diagrams/class/layout
960
-
961
-
962
-
963
- ### diagrams/class/module
964
-
965
-
966
-
967
- ### diagrams/class/parser
968
-
969
-
970
-
971
- ### diagrams/class/plugins/syntax
972
-
973
-
974
-
975
- ### diagrams/class/render
976
-
977
-
978
-
979
- ### diagrams/class/security
980
-
981
-
982
-
983
- ### diagrams/class/style
984
-
985
-
986
-
987
- ### diagrams/class/tests
988
-
989
-
990
-
991
- ### diagrams/component/assets
992
-
993
-
994
-
995
- ### diagrams/component/docs
996
-
997
-
998
-
999
- ### diagrams/component/docs/coverage_examples
1000
-
1001
-
1002
-
1003
- ### diagrams/component/layout
1004
-
1005
-
1006
-
1007
- ### diagrams/component/module
1008
-
1009
-
1010
-
1011
- ### diagrams/component/parser
1012
-
1013
-
1014
-
1015
- ### diagrams/component/plugins/syntax
1016
-
1017
-
1018
-
1019
- ### diagrams/component/render
1020
-
1021
-
1022
-
1023
- ### diagrams/component/security
1024
-
1025
-
1026
-
1027
- ### diagrams/component/tests
1028
-
1029
-
1030
-
1031
- ### diagrams/deployment/assets
1032
-
1033
-
1034
-
1035
- ### diagrams/deployment/docs
1036
-
1037
-
1038
-
1039
- ### diagrams/deployment/layout
1040
-
1041
-
1042
-
1043
- ### diagrams/deployment/module
1044
-
1045
-
1046
-
1047
- ### diagrams/deployment/parser
1048
-
1049
-
1050
-
1051
- ### diagrams/deployment/plugins/syntax
1052
-
1053
-
1054
-
1055
- ### diagrams/deployment/render
1056
-
203
+ </details>
1057
204
 
205
+ ## Security
1058
206
 
1059
- ### diagrams/deployment/security
207
+ excaliplant is built to render untrusted PlantUML:
1060
208
 
209
+ - No file-system or network access while rendering. `!include` only works through a resolver you pass in (the CLI's `--include-dir` restricts includes to one directory tree); `!includeurl` and `!import` are refused.
210
+ - Every text and attribute in SVG output is escaped; colours are validated; links are limited to `http(s)` and `mailto`.
211
+ - Budgets for input size, lines, preprocessor steps/recursion/loop iterations, nodes, edges, drawing elements and PNG size (see `DEFAULT_LIMITS`).
212
+ - Parsers are scanner-based or use bounded regular expressions; hostile inputs are covered by [`test/security.test.mjs`](test/security.test.mjs).
1061
213
 
214
+ Please report vulnerabilities as described in [SECURITY.md](SECURITY.md).
1062
215
 
1063
- ### diagrams/deployment/tests
216
+ ## Compatibility notes
1064
217
 
218
+ excaliplant re-implements PlantUML in JavaScript, so diagrams look different from PlantUML's output — that is the point. Layout decisions differ (ELK instead of Graphviz), sprites and `<&icons>` render as placeholder glyphs, and the bundled standard library covers C4 and ArchiMate only. Unknown lines are reported as warnings (or errors with `strict`), never silently dropped.
1065
219
 
220
+ ## Development
1066
221
 
1067
- ### diagrams/ebnf/parser
1068
-
1069
-
1070
-
1071
- ### diagrams/object/assets
1072
-
1073
-
1074
-
1075
- ### diagrams/object/docs
1076
-
1077
-
1078
-
1079
- ### diagrams/object/docs/coverage_examples
1080
-
1081
-
1082
-
1083
- ### diagrams/object/layout
1084
-
1085
-
1086
-
1087
- ### diagrams/object/module
1088
-
1089
-
1090
-
1091
- ### diagrams/object/parser
1092
-
1093
-
1094
-
1095
- ### diagrams/object/plugins/syntax
1096
-
1097
-
1098
-
1099
- ### diagrams/object/render
1100
-
1101
-
1102
-
1103
- ### diagrams/object/security
1104
-
1105
-
1106
-
1107
- ### diagrams/object/tests
1108
-
1109
-
1110
-
1111
- ### diagrams/regex/layout
1112
-
1113
-
1114
-
1115
- ### diagrams/regex/module
1116
-
1117
-
1118
-
1119
- ### diagrams/regex/parser
1120
-
1121
-
1122
-
1123
- ### diagrams/regex/render
1124
-
1125
-
1126
-
1127
- ### diagrams/sequence/assets
1128
-
1129
-
1130
-
1131
- ### diagrams/sequence/docs
1132
-
1133
-
1134
-
1135
- ### diagrams/sequence/layout
1136
-
1137
-
1138
-
1139
- ### diagrams/sequence/module
1140
-
1141
-
1142
-
1143
- ### diagrams/sequence/parser
1144
-
1145
-
1146
-
1147
- ### diagrams/sequence/render
1148
-
1149
-
1150
-
1151
- ### diagrams/sequence/security
1152
-
1153
-
1154
-
1155
- ### diagrams/sequence/tests
1156
-
1157
-
1158
-
1159
- ### diagrams/shared/data_runtime
1160
-
1161
-
1162
-
1163
- ### diagrams/shared/graph_parser
1164
-
1165
-
1166
-
1167
- ### diagrams/shared/graph_runtime
1168
-
1169
-
1170
-
1171
- ### diagrams/shared/railroad_runtime
1172
-
1173
-
1174
-
1175
- ### diagrams/state/assets
1176
-
1177
-
1178
-
1179
- ### diagrams/state/docs
1180
-
1181
-
1182
-
1183
- ### diagrams/state/docs/coverage_examples
1184
-
1185
-
1186
-
1187
- ### diagrams/state/layout
1188
-
1189
-
1190
-
1191
- ### diagrams/state/module
1192
-
1193
-
1194
-
1195
- ### diagrams/state/parser
1196
-
1197
-
1198
-
1199
- ### diagrams/state/plugins/syntax
1200
-
1201
-
1202
-
1203
- ### diagrams/state/render
1204
-
1205
-
1206
-
1207
- ### diagrams/state/security
1208
-
1209
-
1210
-
1211
- ### diagrams/state/tests
1212
-
1213
-
1214
-
1215
- ### diagrams/state/tests/output
1216
-
1217
-
1218
-
1219
- ### diagrams/state/tests/state_components
1220
-
1221
-
1222
-
1223
- ### diagrams/timing/assets
1224
-
1225
-
1226
-
1227
- ### diagrams/timing/docs
1228
-
1229
-
1230
-
1231
- ### diagrams/timing/docs/coverage_examples
1232
-
1233
-
1234
-
1235
- ### diagrams/timing/layout
1236
-
1237
-
1238
-
1239
- ### diagrams/timing/module
1240
-
1241
-
1242
-
1243
- ### diagrams/timing/parser
1244
-
1245
-
1246
-
1247
- ### diagrams/timing/plugins/syntax
1248
-
1249
-
1250
-
1251
- ### diagrams/timing/render
1252
-
1253
-
1254
-
1255
- ### diagrams/timing/render_excalidraw
1256
-
1257
-
1258
-
1259
- ### diagrams/timing/security
1260
-
1261
-
1262
-
1263
- ### diagrams/timing/tests
1264
-
1265
-
1266
-
1267
- ### diagrams/timing/tests/timing_components
1268
-
1269
-
1270
-
1271
- ### diagrams/use-case/assets
1272
-
1273
-
1274
-
1275
- ### diagrams/use-case/docs
1276
-
1277
-
1278
-
1279
- ### diagrams/use-case/layout
1280
-
1281
-
1282
-
1283
- ### diagrams/use-case/module
1284
-
1285
-
1286
-
1287
- ### diagrams/use-case/parser
1288
-
1289
-
1290
-
1291
- ### diagrams/use-case/plugins/actors
1292
-
1293
-
1294
-
1295
- ### diagrams/use-case/plugins/containers
1296
-
1297
-
1298
-
1299
- ### diagrams/use-case/plugins/notes
1300
-
1301
-
1302
-
1303
- ### diagrams/use-case/plugins/relationships
1304
-
1305
-
1306
-
1307
- ### diagrams/use-case/plugins/usecases
1308
-
1309
-
1310
-
1311
- ### diagrams/use-case/render
1312
-
1313
-
1314
-
1315
- ### diagrams/use-case/security
1316
-
1317
-
1318
-
1319
- ### diagrams/use-case/tests
1320
-
1321
-
1322
-
1323
- ### layout
1324
-
1325
- Layout chooses positions for every shape and routes every edge.
1326
- Component / use-case / deployment diagrams flow through ELK
1327
- (`elkjs`) using the `layered` algorithm with orthogonal edge
1328
- routing. After ELK returns we chamfer 90° corners so the result
1329
- matches Excalidraw's diagonal-corner aesthetic.
1330
-
1331
- Sequence diagrams skip ELK entirely — their layout is strictly
1332
- tabular (lifelines on the X axis, time on the Y axis), so a
1333
- deterministic ~90-line algorithm produces better, more compact
1334
- results than a force-directed solver could.
1335
-
1336
- ### main/builtin
1337
-
1338
-
1339
-
1340
- ### model
1341
-
1342
- Input-agnostic diagram model. Two top-level kinds:
1343
-
1344
- - **`Diagram`** — component / deployment / use-case style
1345
- (planes, subplanes, boxes, connections).
1346
- - **`SequenceDiagram`** — lifelines + messages + notes.
1347
-
1348
- Layout and renderer dispatch on the model class. Anything that
1349
- can be expressed as one of these two shapes flows through the
1350
- pipeline; the parser is just one possible source. Callers can
1351
- also build a `Diagram` programmatically and feed it to
1352
- `renderDiagram()`.
1353
-
1354
- ### modules/dependencies
1355
-
1356
-
1357
-
1358
- ### modules/introspection
1359
-
1360
-
1361
-
1362
- ### modules/metadata
1363
-
1364
-
1365
-
1366
- ### modules/pipeline
1367
-
1368
-
1369
-
1370
- ### modules/registry
1371
-
1372
-
1373
-
1374
- ### parser/engine
1375
-
1376
- A ~50-line line-walker. The engine itself knows nothing about
1377
- PlantUML syntax; that lives entirely in plugins. Block plugins
1378
- (multi-line notes, class bodies) take exclusive ownership of
1379
- subsequent lines until they release.
1380
-
1381
- ### platform/asset-base
1382
-
1383
-
1384
-
1385
- ### platform/diagnostics
1386
-
1387
-
1388
-
1389
- ### platform/security-base
1390
-
1391
-
1392
-
1393
- ### platform/services
1394
-
1395
-
1396
-
1397
- ### render
1398
-
1399
- Emits Excalidraw JSON. Each model shape is dispatched to a
1400
- dedicated `renderXxx()` function that produces one or more
1401
- Excalidraw primitive elements (rectangle, ellipse, line, arrow,
1402
- text). The output document is a stand-alone `.excalidraw` file
1403
- that any Excalidraw front-end can open. The companion module
1404
- `src/general/render/svg.mjs` converts the same JSON to SVG for the
1405
- build-time documentation pipeline.
1406
-
1407
- ### sequence-spacing
222
+ ```sh
223
+ npm ci
224
+ npm test # node:test suite (examples, syntax, security, CLI)
225
+ npm run typecheck # tsc --checkJs
226
+ npm run format # prettier
227
+ npm run docs # regenerate gallery, screenshots and this README
228
+ npm run check # everything CI checks
229
+ ```
1408
230
 
1409
- Central spacing contract for sequence diagrams.
231
+ Add a diagram example by dropping a `.puml` file into `examples/<kind>/` — it becomes a test case and a gallery entry. Contribution guidelines live in [CONTRIBUTING.md](CONTRIBUTING.md).
1410
232
 
1411
- Sequence layout has many visual item types (messages, notes, refs,
1412
- dividers, fragments, lifecycle bars). They all reserve vertical space
1413
- through this module so adding a new timeline item does not introduce a
1414
- one-off top/bottom rhythm.
233
+ Releases are fully automated: every pull request carries one `release:major|minor|patch|none` label, and merging publishes the next version to npm with provenance (see [`docs/releasing.md`](docs/releasing.md)).
1415
234
 
1416
235
  ## License
1417
236
 
1418
- MIT © grethel-labs
237
+ [MIT](LICENSE). Excalifont is licensed under the SIL Open Font License; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
238
+
239
+ > **AI-generated project notice:** this repository was created almost entirely with AI assistance. Review the code before relying on it; the MIT warranty disclaimer applies.