apex-ruby 1.0.30 → 1.0.31

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 (490) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -8
  3. data/apex-ruby.gemspec +14 -3
  4. data/ext/apex_ext/apex_src/include/apex/apex.h +11 -2
  5. data/ext/apex_ext/apex_src/src/apex.c +64 -5
  6. data/ext/apex_ext/apex_src/src/ast_terminal.c +2 -4
  7. data/ext/apex_ext/apex_src/src/extensions/callouts.c +103 -63
  8. data/ext/apex_ext/apex_src/src/extensions/callouts.h +3 -2
  9. data/ext/apex_ext/apex_src/src/extensions/citations.c +15 -2
  10. data/ext/apex_ext/apex_src/src/extensions/emoji.c +73 -7
  11. data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +25 -4
  12. data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +4 -1
  13. data/ext/apex_ext/apex_src/src/extensions/insert.c +49 -0
  14. data/ext/apex_ext/apex_src/src/extensions/metadata.c +275 -55
  15. data/ext/apex_ext/apex_src/src/extensions/metadata.h +9 -0
  16. data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +172 -254
  17. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +36 -127
  18. data/ext/apex_ext/apex_src/src/html_renderer.c +99 -157
  19. data/ext/apex_ext/extconf.rb +31 -79
  20. data/lib/apex/version.rb +1 -1
  21. metadata +1 -470
  22. data/ext/apex_ext/apex_src/AGENTS.md +0 -41
  23. data/ext/apex_ext/apex_src/BENCHMARK.md +0 -32
  24. data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +0 -67
  25. data/ext/apex_ext/apex_src/CHANGELOG.md +0 -3373
  26. data/ext/apex_ext/apex_src/CMakeLists.txt +0 -481
  27. data/ext/apex_ext/apex_src/Dockerfile.linux-build +0 -15
  28. data/ext/apex_ext/apex_src/Formula/apex.rb +0 -43
  29. data/ext/apex_ext/apex_src/Info.plist.in +0 -27
  30. data/ext/apex_ext/apex_src/Package.swift +0 -192
  31. data/ext/apex_ext/apex_src/PackageSupport/README.md +0 -17
  32. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +0 -4
  33. data/ext/apex_ext/apex_src/README.md +0 -536
  34. data/ext/apex_ext/apex_src/ROADMAP.md +0 -5
  35. data/ext/apex_ext/apex_src/VERSION +0 -1
  36. data/ext/apex_ext/apex_src/apex-debug.log +0 -4
  37. data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
  38. data/ext/apex_ext/apex_src/apex-plugins.json.example +0 -20
  39. data/ext/apex_ext/apex_src/apex.code-workspace +0 -38
  40. data/ext/apex_ext/apex_src/apex.pc.in +0 -11
  41. data/ext/apex_ext/apex_src/apex.taskpaper +0 -12
  42. data/ext/apex_ext/apex_src/apex_deflist_debug.log +0 -25
  43. data/ext/apex_ext/apex_src/buildnotes.md +0 -1435
  44. data/ext/apex_ext/apex_src/cli/main.c +0 -4588
  45. data/ext/apex_ext/apex_src/debug.log +0 -7
  46. data/ext/apex_ext/apex_src/debug_test.sh +0 -22
  47. data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +0 -451
  48. data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +0 -166
  49. data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +0 -274
  50. data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +0 -749
  51. data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +0 -744
  52. data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +0 -220
  53. data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +0 -501
  54. data/ext/apex_ext/apex_src/docs/DEBUGGING.md +0 -73
  55. data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +0 -391
  56. data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +0 -237
  57. data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +0 -210
  58. data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +0 -344
  59. data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +0 -382
  60. data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +0 -144
  61. data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +0 -278
  62. data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +0 -321
  63. data/ext/apex_ext/apex_src/docs/PROGRESS.md +0 -167
  64. data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +0 -174
  65. data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +0 -243
  66. data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +0 -316
  67. data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +0 -803
  68. data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +0 -91
  69. data/ext/apex_ext/apex_src/docs/index.md +0 -459
  70. data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +0 -351
  71. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +0 -745
  72. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +0 -829
  73. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +0 -1148
  74. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +0 -161
  75. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +0 -184
  76. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +0 -211
  77. data/ext/apex_ext/apex_src/documentation/README.md +0 -160
  78. data/ext/apex_ext/apex_src/documentation/app-settings-table.md +0 -67
  79. data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +0 -340
  80. data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +0 -11
  81. data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +0 -234
  82. data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +0 -516
  83. data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +0 -461
  84. data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +0 -193
  85. data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +0 -201
  86. data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +0 -678
  87. data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +0 -1367
  88. data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +0 -371
  89. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +0 -24
  90. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +0 -2211
  91. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +0 -1194
  92. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +0 -1620
  93. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +0 -6024
  94. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +0 -1877
  95. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +0 -1040
  96. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +0 -1402
  97. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +0 -1656
  98. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +0 -1226
  99. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +0 -1148
  100. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +0 -1478
  101. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +0 -1225
  102. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +0 -2327
  103. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +0 -2041
  104. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +0 -1314
  105. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +0 -1868
  106. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +0 -1731
  107. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +0 -2242
  108. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +0 -1533
  109. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +0 -1362
  110. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +0 -1338
  111. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +0 -3188
  112. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +0 -1405
  113. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +0 -1902
  114. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +0 -4222
  115. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +0 -1781
  116. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +0 -1629
  117. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +0 -1394
  118. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +0 -1132
  119. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +0 -1754
  120. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +0 -2562
  121. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
  122. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  123. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +0 -22
  124. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
  125. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
  126. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
  127. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
  128. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
  129. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
  130. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
  131. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
  132. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +0 -914
  133. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +0 -399
  134. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
  135. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  136. data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +0 -772
  137. data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +0 -678
  138. data/ext/apex_ext/apex_src/documentation/generate_docset.rb +0 -873
  139. data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +0 -733
  140. data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +0 -8746
  141. data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +0 -17073
  142. data/ext/apex_ext/apex_src/documentation/shared_scripts.js +0 -64
  143. data/ext/apex_ext/apex_src/documentation/shared_styles.css +0 -651
  144. data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +0 -260
  145. data/ext/apex_ext/apex_src/documentation/transform_for_app.md +0 -55
  146. data/ext/apex_ext/apex_src/escaping-repro.md +0 -103
  147. data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +0 -119
  148. data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +0 -11
  149. data/ext/apex_ext/apex_src/examples/example.html +0 -53
  150. data/ext/apex_ext/apex_src/examples/example.md +0 -85
  151. data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +0 -158
  152. data/ext/apex_ext/apex_src/examples/kbd.md +0 -8
  153. data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +0 -250
  154. data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +0 -9
  155. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +0 -8
  156. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
  157. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +0 -547
  158. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
  159. data/ext/apex_ext/apex_src/examples/quick-actions/README.md +0 -33
  160. data/ext/apex_ext/apex_src/ial.html +0 -24
  161. data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
  162. data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
  163. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
  164. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
  165. data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
  166. data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
  167. data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
  168. data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
  169. data/ext/apex_ext/apex_src/man/apex-config.5 +0 -455
  170. data/ext/apex_ext/apex_src/man/apex-config.5.md +0 -262
  171. data/ext/apex_ext/apex_src/man/apex-plugins.7 +0 -541
  172. data/ext/apex_ext/apex_src/man/apex-plugins.7.md +0 -365
  173. data/ext/apex_ext/apex_src/man/apex.1 +0 -583
  174. data/ext/apex_ext/apex_src/man/apex.1.html +0 -703
  175. data/ext/apex_ext/apex_src/man/apex.1.md +0 -803
  176. data/ext/apex_ext/apex_src/man/apex.1.new +0 -338
  177. data/ext/apex_ext/apex_src/objc/Apex.swift +0 -316
  178. data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +0 -79
  179. data/ext/apex_ext/apex_src/objc/NSString+Apex.h +0 -207
  180. data/ext/apex_ext/apex_src/objc/NSString+Apex.m +0 -584
  181. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +0 -76
  182. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +0 -169
  183. data/ext/apex_ext/apex_src/output.html +0 -87
  184. data/ext/apex_ext/apex_src/pages/index.md +0 -459
  185. data/ext/apex_ext/apex_src/plans/quarto-mode.md +0 -442
  186. data/ext/apex_ext/apex_src/src/_README.md +0 -413
  187. data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +0 -869
  188. data/ext/apex_ext/apex_src/test-linux-build.sh +0 -20
  189. data/ext/apex_ext/apex_src/test.html +0 -103
  190. data/ext/apex_ext/apex_src/test_coverage.sh +0 -121
  191. data/ext/apex_ext/apex_src/test_ial_fenced.md +0 -6
  192. data/ext/apex_ext/apex_src/test_math_norm.py +0 -79
  193. data/ext/apex_ext/apex_src/test_pandoc_output.html +0 -48
  194. data/ext/apex_ext/apex_src/test_spm.sh +0 -107
  195. data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +0 -50
  196. data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +0 -229
  197. data/ext/apex_ext/apex_src/tests/CMakeLists.txt +0 -25
  198. data/ext/apex_ext/apex_src/tests/README.md +0 -152
  199. data/ext/apex_ext/apex_src/tests/benchmark.sh +0 -113
  200. data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +0 -166
  201. data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +0 -31
  202. data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +0 -25
  203. data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +0 -24
  204. data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +0 -33
  205. data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +0 -26
  206. data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +0 -260
  207. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +0 -6
  208. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +0 -7
  209. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +0 -9
  210. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +0 -5
  211. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +0 -5
  212. data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +0 -652
  213. data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +0 -3
  214. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +0 -11
  215. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +0 -177
  216. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +0 -94
  217. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +0 -3
  218. data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +0 -3
  219. data/ext/apex_ext/apex_src/tests/fixtures/filters/filter_output_with_rawblock.json +0 -1
  220. data/ext/apex_ext/apex_src/tests/fixtures/filters/unwrap.md +0 -7
  221. data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +0 -74
  222. data/ext/apex_ext/apex_src/tests/fixtures/images/auto-wildcard.md +0 -8
  223. data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +0 -10
  224. data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +0 -27
  225. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.avif +0 -0
  226. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.jpg +0 -0
  227. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.webp +0 -0
  228. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.avif +0 -0
  229. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.jpg +0 -0
  230. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.webp +0 -0
  231. data/ext/apex_ext/apex_src/tests/fixtures/images/media_formats_test.md +0 -63
  232. data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +0 -60
  233. data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +0 -27
  234. data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +0 -94
  235. data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +0 -16
  236. data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +0 -4
  237. data/ext/apex_ext/apex_src/tests/fixtures/includes/data-semi.csv +0 -3
  238. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +0 -5
  239. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +0 -5
  240. data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +0 -2
  241. data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +0 -11
  242. data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +0 -8
  243. data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +0 -4
  244. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +0 -19
  245. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +0 -11
  246. data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +0 -7
  247. data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
  248. data/ext/apex_ext/apex_src/tests/fixtures/includes/with space.txt +0 -1
  249. data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +0 -1094
  250. data/ext/apex_ext/apex_src/tests/fixtures/metadata/mmd-metadata.md +0 -5
  251. data/ext/apex_ext/apex_src/tests/fixtures/metadata/pandoc-meta.md +0 -4
  252. data/ext/apex_ext/apex_src/tests/fixtures/metadata/yaml-frontmatter.md +0 -6
  253. data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +0 -11
  254. data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +0 -2
  255. data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +0 -46
  256. data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +0 -96
  257. data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +0 -43
  258. data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +0 -12
  259. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +0 -53
  260. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +0 -37
  261. data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +0 -5
  262. data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +0 -47
  263. data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +0 -3
  264. data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +0 -3
  265. data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +0 -8
  266. data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +0 -19
  267. data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +0 -5
  268. data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +0 -7
  269. data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +0 -81
  270. data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +0 -5
  271. data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +0 -47
  272. data/ext/apex_ext/apex_src/tests/fixtures/speed.md +0 -192
  273. data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +0 -93
  274. data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +0 -37
  275. data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +0 -41
  276. data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +0 -12
  277. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +0 -15
  278. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +0 -15
  279. data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +0 -105
  280. data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +0 -143
  281. data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +0 -96
  282. data/ext/apex_ext/apex_src/tests/gh_api_test.md +0 -6
  283. data/ext/apex_ext/apex_src/tests/ial_demo.html +0 -186
  284. data/ext/apex_ext/apex_src/tests/include_code.py +0 -19
  285. data/ext/apex_ext/apex_src/tests/include_snippet.md +0 -15
  286. data/ext/apex_ext/apex_src/tests/metadata_cli_test.sh +0 -119
  287. data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +0 -64
  288. data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +0 -80
  289. data/ext/apex_ext/apex_src/tests/sample_data.csv +0 -7
  290. data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +0 -4
  291. data/ext/apex_ext/apex_src/tests/terminal_width_test.sh +0 -29
  292. data/ext/apex_ext/apex_src/tests/test-swift-package.sh +0 -14
  293. data/ext/apex_ext/apex_src/tests/test_basic.c +0 -74
  294. data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +0 -301
  295. data/ext/apex_ext/apex_src/tests/test_cmark_callback.c +0 -189
  296. data/ext/apex_ext/apex_src/tests/test_concordance.tsv +0 -4
  297. data/ext/apex_ext/apex_src/tests/test_custom_plugins.c +0 -78
  298. data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +0 -82
  299. data/ext/apex_ext/apex_src/tests/test_extensions.c +0 -3337
  300. data/ext/apex_ext/apex_src/tests/test_helpers.c +0 -183
  301. data/ext/apex_ext/apex_src/tests/test_helpers.h +0 -91
  302. data/ext/apex_ext/apex_src/tests/test_ial.c +0 -289
  303. data/ext/apex_ext/apex_src/tests/test_links.c +0 -418
  304. data/ext/apex_ext/apex_src/tests/test_marked_integration.c +0 -290
  305. data/ext/apex_ext/apex_src/tests/test_metadata.c +0 -1147
  306. data/ext/apex_ext/apex_src/tests/test_output.c +0 -2056
  307. data/ext/apex_ext/apex_src/tests/test_plugins.c +0 -219
  308. data/ext/apex_ext/apex_src/tests/test_refs.bib +0 -31
  309. data/ext/apex_ext/apex_src/tests/test_runner.c +0 -268
  310. data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +0 -198
  311. data/ext/apex_ext/apex_src/tests/test_tables.c +0 -1298
  312. data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +0 -9
  313. data/ext/apex_ext/apex_src/tests/yaml_test.md +0 -13
  314. data/ext/apex_ext/apex_src/tests.rb +0 -39
  315. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +0 -48
  316. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +0 -14
  317. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +0 -43
  318. data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +0 -74
  319. data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +0 -38
  320. data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +0 -206
  321. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +0 -30
  322. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +0 -15
  323. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +0 -16
  324. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +0 -111
  325. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +0 -35
  326. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +0 -1169
  327. data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +0 -21
  328. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +0 -16
  329. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +0 -13
  330. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +0 -11
  331. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +0 -14
  332. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +0 -9
  333. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +0 -10
  334. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +0 -32
  335. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +0 -8
  336. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +0 -67
  337. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +0 -36
  338. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +0 -15
  339. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +0 -17
  340. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +0 -14
  341. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +0 -3
  342. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +0 -5
  343. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +0 -5
  344. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +0 -5
  345. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +0 -11
  346. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +0 -15
  347. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +0 -44
  348. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +0 -23
  349. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +0 -13
  350. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +0 -24
  351. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +0 -13
  352. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +0 -18
  353. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +0 -595
  354. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +0 -19
  355. data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +0 -33
  356. data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +0 -1245
  357. data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +0 -1495
  358. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +0 -119
  359. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +0 -92
  360. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +0 -22
  361. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +0 -12
  362. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +0 -91
  363. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +0 -110
  364. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +0 -28
  365. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +0 -10
  366. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +0 -133
  367. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +0 -78
  368. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +0 -1041
  369. data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +0 -1
  370. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +0 -230
  371. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +0 -7
  372. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +0 -38
  373. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +0 -76
  374. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +0 -10
  375. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +0 -365
  376. data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +0 -10
  377. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +0 -114
  378. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
  379. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
  380. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +0 -49
  381. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +0 -58
  382. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +0 -105
  383. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +0 -67
  384. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
  385. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +0 -38
  386. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +0 -989
  387. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +0 -67
  388. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +0 -194
  389. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +0 -160
  390. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +0 -375
  391. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +0 -50
  392. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +0 -4
  393. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +0 -177
  394. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +0 -10212
  395. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +0 -152
  396. data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +0 -17
  397. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +0 -41
  398. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +0 -13
  399. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +0 -32
  400. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +0 -22
  401. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +0 -319
  402. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +0 -80
  403. data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +0 -104
  404. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +0 -6
  405. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +0 -37
  406. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +0 -15
  407. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +0 -208
  408. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +0 -109
  409. data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +0 -160
  410. data/ext/apex_ext/apex_src/vendor/libyaml/Changes +0 -372
  411. data/ext/apex_ext/apex_src/vendor/libyaml/License +0 -20
  412. data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +0 -51
  413. data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +0 -46
  414. data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +0 -89
  415. data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +0 -3
  416. data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +0 -4
  417. data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +0 -73
  418. data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +0 -222
  419. data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +0 -17
  420. data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +0 -26
  421. data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +0 -26
  422. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +0 -29
  423. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +0 -24
  424. data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +0 -10
  425. data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +0 -2
  426. data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +0 -14
  427. data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +0 -1
  428. data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +0 -2
  429. data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +0 -1
  430. data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +0 -7
  431. data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +0 -7
  432. data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +0 -3
  433. data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +0 -17
  434. data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +0 -1999
  435. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +0 -77
  436. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +0 -32
  437. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +0 -1
  438. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +0 -23
  439. data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +0 -1
  440. data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +0 -4
  441. data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +0 -1393
  442. data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +0 -394
  443. data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +0 -2358
  444. data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +0 -544
  445. data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +0 -1416
  446. data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +0 -469
  447. data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +0 -3598
  448. data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +0 -141
  449. data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +0 -684
  450. data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +0 -27
  451. data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +0 -9
  452. data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +0 -63
  453. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +0 -800
  454. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +0 -1127
  455. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +0 -217
  456. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +0 -202
  457. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +0 -29
  458. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +0 -314
  459. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +0 -290
  460. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +0 -327
  461. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +0 -63
  462. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +0 -196
  463. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +0 -88
  464. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +0 -63
  465. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +0 -354
  466. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +0 -29
  467. data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +0 -10
  468. data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +0 -16
  469. data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +0 -74
  470. data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +0 -22
  471. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
  472. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +0 -44
  473. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +0 -128
  474. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +0 -5118
  475. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
  476. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  477. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +0 -8
  478. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +0 -99
  479. data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +0 -452
  480. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +0 -52
  481. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +0 -55
  482. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +0 -2455
  483. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
  484. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +0 -171
  485. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +0 -55
  486. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +0 -220
  487. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +0 -43
  488. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +0 -7
  489. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +0 -76
  490. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +0 -10
@@ -1,3188 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
-
6
- <meta charset="UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <meta name="generator" content="Apex 1.1.12">
9
- <title>Document</title>
10
- <style>
11
- /* GitHub-style syntax highlighting for Pygments and Skylighting */
12
- /* Don't apply background to wrapper when code highlighting is enabled - let default styles handle it */
13
- .code-highlighted .highlight, .code-highlighted .sourceCode { background: inherit; border-radius: 6px; padding: 16px; overflow-x: auto; }
14
- .highlight pre, .sourceCode pre { margin: 0; padding: 0; background: transparent; }
15
- .highlight code, .sourceCode code { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 12px; line-height: 1.45; }
16
- /* Pygments classes */
17
- .highlight .k { color: #d73a49; font-weight: 600; } /* Keyword */
18
- .highlight .kt { color: #d73a49; } /* Keyword.Type */
19
- .highlight .kd { color: #d73a49; font-weight: 600; } /* Keyword.Declaration */
20
- .highlight .kn { color: #d73a49; } /* Keyword.Namespace */
21
- .highlight .kp { color: #d73a49; } /* Keyword.Pseudo */
22
- .highlight .kr { color: #d73a49; font-weight: 600; } /* Keyword.Reserved */
23
- .highlight .n { color: #6f42c1; } /* Name */
24
- .highlight .na { color: #6f42c1; } /* Name.Attribute */
25
- .highlight .nc { color: #6f42c1; font-weight: 600; } /* Name.Class */
26
- .highlight .no { color: #005cc5; } /* Name.Constant */
27
- .highlight .nd { color: #6f42c1; font-weight: 600; } /* Name.Decorator */
28
- .highlight .ni { color: #800080; } /* Name.Entity */
29
- .highlight .ne { color: #990000; font-weight: 600; } /* Name.Exception */
30
- .highlight .nf { color: #6f42c1; font-weight: 600; } /* Name.Function */
31
- .highlight .nl { color: #6f42c1; } /* Name.Label */
32
- .highlight .nn { color: #555; } /* Name.Namespace */
33
- .highlight .nt { color: #22863a; } /* Name.Tag */
34
- .highlight .nv { color: #e36209; } /* Name.Variable */
35
- .highlight .s { color: #032f62; } /* String */
36
- .highlight .sb { color: #032f62; } /* String.Backtick */
37
- .highlight .sc { color: #032f62; } /* String.Char */
38
- .highlight .sd { color: #032f62; } /* String.Doc */
39
- .highlight .s2 { color: #032f62; } /* String.Double */
40
- .highlight .se { color: #032f62; } /* String.Escape */
41
- .highlight .sh { color: #032f62; } /* String.Heredoc */
42
- .highlight .si { color: #032f62; } /* String.Interpol */
43
- .highlight .sx { color: #032f62; } /* String.Other */
44
- .highlight .sr { color: #032f62; } /* String.Regex */
45
- .highlight .s1 { color: #032f62; } /* String.Single */
46
- .highlight .ss { color: #032f62; } /* String.Symbol */
47
- .highlight .c { color: #6a737d; font-style: italic; } /* Comment */
48
- .highlight .c1 { color: #6a737d; font-style: italic; } /* Comment.Single */
49
- .highlight .cm { color: #6a737d; font-style: italic; } /* Comment.Multiline */
50
- .highlight .cp { color: #6a737d; font-weight: 600; } /* Comment.Preproc */
51
- .highlight .cs { color: #6a737d; font-weight: 600; font-style: italic; } /* Comment.Special */
52
- .highlight .m { color: #005cc5; } /* Literal.Number */
53
- .highlight .mb { color: #005cc5; } /* Literal.Number.Bin */
54
- .highlight .mf { color: #005cc5; } /* Literal.Number.Float */
55
- .highlight .mh { color: #005cc5; } /* Literal.Number.Hex */
56
- .highlight .mi { color: #005cc5; } /* Literal.Number.Integer */
57
- .highlight .il { color: #005cc5; } /* Literal.Number.Integer.Long */
58
- .highlight .mo { color: #005cc5; } /* Literal.Number.Oct */
59
- .highlight .o { color: #d73a49; } /* Operator */
60
- .highlight .ow { color: #d73a49; } /* Operator.Word */
61
- .highlight .p { color: #24292e; } /* Punctuation */
62
- .highlight .w { color: #e1e4e8; } /* Text.Whitespace */
63
- /* Skylighting classes */
64
- .sourceCode .kw { color: #d73a49; font-weight: 600; } /* Keyword */
65
- .sourceCode .dt { color: #6f42c1; } /* DataType */
66
- .sourceCode .dv { color: #005cc5; } /* DecVal */
67
- .sourceCode .bn { color: #005cc5; } /* BaseN */
68
- .sourceCode .fl { color: #005cc5; } /* Float */
69
- .sourceCode .ch { color: #032f62; } /* Char */
70
- .sourceCode .st { color: #032f62; } /* String */
71
- .sourceCode .co { color: #6a737d; font-style: italic; } /* Comment */
72
- .sourceCode .ot { color: #22863a; } /* Other */
73
- .sourceCode .al { color: #e36209; font-weight: 600; } /* Alert */
74
- .sourceCode .fu { color: #6f42c1; font-weight: 600; } /* Function */
75
- .sourceCode .re { color: #032f62; } /* RegionMarker */
76
- .sourceCode .er { color: #d73a49; font-weight: 600; } /* Error */
77
- .sourceCode .cf { color: #d73a49; font-weight: 600; } /* ControlFlow */
78
- .sourceCode .op { color: #d73a49; } /* Operator */
79
- .sourceCode .pp { color: #6a737d; } /* Preprocessor */
80
- .sourceCode .at { color: #005cc5; } /* Attribute */
81
- .sourceCode .do { color: #6a737d; font-style: italic; } /* Documentation */
82
- .sourceCode .an { color: #6a737d; font-weight: 600; } /* Annotation */
83
- .sourceCode .cv { color: #6a737d; font-weight: 600; font-style: italic; } /* CommentVar */
84
- .sourceCode .in { color: #6a737d; } /* Information */
85
- .sourceCode .wa { color: #e36209; font-weight: 600; } /* Warning */
86
- .sourceCode .im { color: #d73a49; } /* Import */
87
- .sourceCode .bu { color: #005cc5; } /* BuiltIn */
88
- .sourceCode .ex { color: #6f42c1; } /* Extension */
89
- .sourceCode .va { color: #e36209; } /* Variable */
90
- .sourceCode .ss { color: #032f62; } /* SpecialString */
91
- .sourceCode .sc { color: #032f62; } /* SpecialChar */
92
- .sourceCode .vs { color: #032f62; } /* VerbatimString */
93
- .sourceCode .il { color: #005cc5; } /* Special */
94
- /* Line numbers (Skylighting) */
95
- .sourceCode.numberSource .sourceCode { counter-reset: line; }
96
- .sourceCode.numberSource .sourceCode > span { position: relative; left: -4em; counter-increment: line; }
97
- .sourceCode.numberSource .sourceCode > span > a:first-child::before { content: counter(line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; min-width: 1em; padding-right: 0.5em; color: #aaa; }
98
- </style>
99
- <style>
100
- body {
101
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
102
- line-height: 1.6;
103
- max-width: 800px;
104
- margin: 2rem auto;
105
- padding: 0 1rem;
106
- color: #333;
107
- }
108
- pre { background: #f5f5f5; padding: 1rem; overflow-x: auto; }
109
- code { background: #f0f0f0; padding: 0.2em 0.4em; border-radius: 3px; }
110
- blockquote { border-left: 4px solid #ddd; margin: 0; padding-left: 1rem; color: #666; }
111
- table { border-collapse: collapse; width: 100%%; }
112
- th, td { border: 1px solid #ddd; padding: 0.5rem; }
113
- th { background: #f5f5f5; }
114
- tfoot td { background: #e8e8e8; }
115
- figure.table-figure { width: fit-content; margin: 1em 0; }
116
- figure.table-figure table { width: auto; }
117
- figcaption { text-align: center; font-weight: bold; font-size: 0.8em; }
118
- .page-break { page-break-after: always; }
119
- .callout { padding: 1rem; margin: 1rem 0; border-left: 4px solid; }
120
- .callout-note { border-color: #3b82f6; background: #eff6ff; }
121
- .callout-warning { border-color: #f59e0b; background: #fffbeb; }
122
- .callout-tip { border-color: #10b981; background: #f0fdf4; }
123
- .callout-danger { border-color: #ef4444; background: #fef2f2; }
124
- ins { background: #d4fcbc; text-decoration: none; }
125
- del { background: #fbb6c2; text-decoration: line-through; }
126
- mark { background: #fff3cd; }
127
- .smallcaps { font-variant: small-caps; }
128
- .underline { text-decoration: underline; }
129
- span.mark { background: #fff3cd; }
130
- .hidden { display: none; }
131
- .quarto-xref { font-variant: normal; }
132
- .critic.comment { background: #e7e7e7; color: #666; font-style: italic; }
133
- .mkhashtag { color: #666; }
134
- .mkstyledtag {
135
- display: inline-block;
136
- background: #e0e0e0;
137
- padding: 3px 9px;
138
- border-radius: 20px;
139
- font-size: 0.9em;
140
- line-height: 1.4;
141
- color: #333;
142
- margin: 0 2px;
143
- }
144
- </style>
145
- <meta name="paginate" content="symbols"/>
146
- <meta name="highlight-language-only" content="true"/>
147
- <meta name="code-line-numbers" content="false"/>
148
- <meta name="code-highlight" content="pygments"/>
149
- <meta name="sup-sub" content="true"/>
150
- <meta name="relaxed-tables" content="true"/>
151
- <meta name="includes" content="true"/>
152
- <meta name="autolink" content="true"/>
153
- <meta name="pretty" content="false"/>
154
- <meta name="standalone" content="false"/>
155
- <meta name="mode" content="unified"/>
156
- <meta name="markdown-in-html" content="true"/>
157
- <meta name="image-captions" content="true"/>
158
- <meta name="wikilink-extension" content="html"/>
159
- <meta name="wikilink-space" content="hyphen"/>
160
- <meta name="wikilinks" content="true"/>
161
- <meta name="widont" content="true"/>
162
- <meta name="plugins" content="true"/>
163
- <meta name="id-format" content="gfm"/>
164
-
165
- <style>
166
- :root {
167
- /* border-box width of the fixed sidebar; body offset includes a small gap */
168
- --sidebar-width: 250px;
169
- --sidebar-offset: 270px;
170
- }
171
-
172
- /* Base styles — override Apex standalone centering (max-width + margin: auto) */
173
- body {
174
- -webkit-font-smoothing: antialiased;
175
- -moz-osx-font-smoothing: grayscale;
176
- font-size: 17px;
177
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
178
- "Helvetica Neue", Arial, sans-serif;
179
- line-height: 1.65;
180
- color: #1e293b;
181
- background-color: #fff;
182
- max-width: none;
183
- width: auto;
184
- margin: 2rem 2rem 2rem var(--sidebar-offset);
185
- padding: 0 1rem;
186
- box-sizing: border-box;
187
- }
188
-
189
- /* Sidebar / Main TOC - wider on larger screens */
190
- .main-toc,
191
- .sidebar {
192
- position: fixed;
193
- left: 0;
194
- top: 0;
195
- box-sizing: border-box;
196
- width: var(--sidebar-width);
197
- min-width: var(--sidebar-width);
198
- max-width: var(--sidebar-width);
199
- height: 100vh;
200
- overflow-y: auto;
201
- background: #1e293b;
202
- color: rgba(255, 255, 255, 0.9);
203
- border-right: 2px solid rgba(255, 255, 255, 0.1);
204
- padding: 24px 20px 130px;
205
- font-size: 14px;
206
- z-index: 100;
207
- box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
208
- transition: transform 0.3s ease;
209
- }
210
-
211
- .main-toc ul,
212
- .sidebar ul {
213
- list-style: none;
214
- padding-left: 0;
215
- margin: 0;
216
- padding-bottom: 80px;
217
- }
218
-
219
- .main-toc ul::after,
220
- .sidebar ul::after {
221
- content: "";
222
- display: block;
223
- height: 80px;
224
- }
225
-
226
- .main-toc li,
227
- .sidebar li {
228
- margin: 0.25em 0;
229
- }
230
-
231
- .main-toc a,
232
- .sidebar a {
233
- color: rgba(255, 255, 255, 0.85);
234
- text-decoration: none;
235
- display: block;
236
- padding: 6px 12px;
237
- border-radius: 4px;
238
- transition: all 0.15s ease;
239
- white-space: nowrap;
240
- overflow: hidden;
241
- text-overflow: ellipsis;
242
- }
243
-
244
- .main-toc a:hover,
245
- .sidebar a:hover {
246
- background: #334155;
247
- color: #fff;
248
- }
249
-
250
- .sidebar a.active {
251
- color: #0ea5e9;
252
- font-weight: 500;
253
- }
254
-
255
- /* Hamburger menu button */
256
- .hamburger-menu {
257
- display: none;
258
- position: fixed;
259
- top: 12px;
260
- left: 12px;
261
- z-index: 200;
262
- background: #1e293b;
263
- border: 2px solid rgba(255, 255, 255, 0.1);
264
- border-radius: 6px;
265
- padding: 10px;
266
- cursor: pointer;
267
- color: rgba(255, 255, 255, 0.9);
268
- font-size: 20px;
269
- line-height: 1;
270
- box-sizing: border-box;
271
- width: 44px;
272
- height: 44px;
273
- align-items: center;
274
- justify-content: center;
275
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
276
- transition: all 0.2s ease;
277
- opacity: 0.2;
278
- }
279
-
280
- .hamburger-menu:hover {
281
- background: #334155;
282
- color: #fff;
283
- opacity: 1;
284
- }
285
-
286
- /* Move hamburger to the right of the sidebar when menu is open */
287
- .hamburger-menu.active {
288
- left: calc(var(--sidebar-width) + 12px);
289
- }
290
-
291
- .hamburger-menu.active {
292
- background: #0ea5e9;
293
- }
294
-
295
- .hamburger-menu::before {
296
- content: "☰";
297
- }
298
-
299
- .hamburger-menu.active::before {
300
- content: "✕";
301
- }
302
-
303
- /* Mobile menu overlay */
304
- .mobile-menu-overlay {
305
- display: none;
306
- position: fixed;
307
- top: 0;
308
- left: 0;
309
- right: 0;
310
- bottom: 0;
311
- background: rgba(0, 0, 0, 0.5);
312
- z-index: 150;
313
- opacity: 0;
314
- visibility: hidden;
315
- transition: opacity 0.3s ease, visibility 0.3s ease;
316
- }
317
-
318
- .mobile-menu-overlay.active {
319
- opacity: 1;
320
- visibility: visible;
321
- }
322
-
323
- /* Page TOC */
324
- .page-toc {
325
- background: #f9f9f9;
326
- border: 1px solid #ddd;
327
- border-radius: 4px;
328
- padding: 1rem;
329
- margin: 1.5rem 0;
330
- }
331
-
332
- .page-toc ul {
333
- list-style: none;
334
- padding-left: 0;
335
- margin: 0;
336
- }
337
-
338
- .page-toc > ul {
339
- padding-left: 0;
340
- }
341
-
342
- .page-toc li {
343
- margin: 0.25em 0;
344
- }
345
-
346
- .page-toc a {
347
- color: #0066cc;
348
- text-decoration: none;
349
- display: block;
350
- padding: 0.25em 0.5em;
351
- border-radius: 3px;
352
- }
353
-
354
- .page-toc a:hover {
355
- background: #e0e0e0;
356
- color: #004499;
357
- }
358
-
359
- .page-toc ul ul {
360
- list-style: none;
361
- padding-left: 1.5em;
362
- margin-top: 0.25em;
363
- margin-left: 0;
364
- }
365
-
366
- .page-toc ul ul ul {
367
- padding-left: 1.5em;
368
- }
369
-
370
- .page-toc ul ul a {
371
- font-size: 0.9em;
372
- color: #555;
373
- }
374
-
375
- .page-toc ul ul ul a {
376
- font-size: 0.85em;
377
- color: #666;
378
- }
379
-
380
- /* Floating TOC */
381
- .floating-toc {
382
- position: fixed;
383
- top: 0;
384
- left: var(--sidebar-offset);
385
- right: 0;
386
- z-index: 50;
387
- opacity: 0;
388
- visibility: hidden;
389
- transition: opacity 0.2s ease, visibility 0.2s ease;
390
- pointer-events: none;
391
- display: flex;
392
- justify-content: flex-end;
393
- padding-right: 2rem;
394
- }
395
-
396
- .floating-toc.visible {
397
- opacity: 1;
398
- visibility: visible;
399
- pointer-events: auto;
400
- }
401
-
402
- .floating-toc-container {
403
- background: rgba(255, 255, 255, 0.95);
404
- backdrop-filter: blur(10px);
405
- border-bottom: 1px solid #ddd;
406
- border-radius: 0 0 12px 12px;
407
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
408
- width: fit-content;
409
- max-width: 400px;
410
- min-width: 200px;
411
- overflow: hidden;
412
- transition: max-height 0.3s ease;
413
- }
414
-
415
- .floating-toc-header {
416
- padding: 8px 16px;
417
- cursor: pointer;
418
- user-select: none;
419
- font-size: 14px;
420
- font-weight: 500;
421
- color: #1e293b;
422
- display: flex;
423
- align-items: center;
424
- justify-content: space-between;
425
- }
426
-
427
- .floating-toc-header:hover {
428
- background: rgba(0, 0, 0, 0.02);
429
- }
430
-
431
- .floating-toc-content {
432
- max-height: 0;
433
- overflow: hidden;
434
- transition: max-height 0.3s ease;
435
- }
436
-
437
- .floating-toc-container:hover .floating-toc-content {
438
- max-height: 70vh;
439
- overflow-y: auto;
440
- }
441
-
442
- .floating-toc-content ul {
443
- list-style: none;
444
- padding: 8px 16px 16px;
445
- margin: 0;
446
- }
447
-
448
- .floating-toc-content li {
449
- margin: 0.1em 0;
450
- }
451
-
452
- .floating-toc-content a {
453
- color: #0066cc;
454
- text-decoration: none;
455
- display: block;
456
- padding: 0.2em 0.5em;
457
- border-radius: 4px;
458
- font-size: 13px;
459
- transition: background 0.15s ease;
460
- }
461
-
462
- .floating-toc-content a:hover {
463
- background: #e0e0e0;
464
- color: #004499;
465
- }
466
-
467
- .floating-toc-content ul ul {
468
- padding-left: 1.2em;
469
- margin-top: 0;
470
- margin-bottom: 0;
471
- }
472
-
473
- .floating-toc-content ul ul ul {
474
- margin-top: 0;
475
- margin-bottom: 0;
476
- }
477
-
478
- .floating-toc-content ul ul a {
479
- font-size: 12px;
480
- color: #555;
481
- }
482
-
483
- .floating-toc-content ul ul ul a {
484
- font-size: 11px;
485
- color: #666;
486
- }
487
-
488
- /* Smooth scrolling */
489
- html {
490
- scroll-behavior: smooth;
491
- }
492
-
493
- /* Code blocks */
494
- code {
495
- background: #f0f0f0;
496
- padding: 0.2em 0.4em;
497
- border-radius: 3px;
498
- font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
499
- font-size: 0.9em;
500
- margin: 0 0.1em;
501
- }
502
-
503
- pre {
504
- background: #f5f5f5;
505
- padding: 1rem;
506
- overflow-x: auto;
507
- border-radius: 4px;
508
- margin: 1em 0;
509
- }
510
-
511
- pre code {
512
- background: none;
513
- padding: 0;
514
- margin: 0;
515
- }
516
-
517
- /* Rouge syntax highlighting - GitHub theme, scoped to .highlight containers */
518
- .highlight {
519
- color: #24292e;
520
- }
521
-
522
- .highlight .c {
523
- color: #6a737d;
524
- font-style: italic;
525
- } /* Comment */
526
- .highlight .err {
527
- color: #a61717;
528
- background-color: #e3d2d2;
529
- } /* Error */
530
- .highlight .k {
531
- color: #d73a49;
532
- font-weight: bold;
533
- } /* Keyword */
534
- .highlight .l {
535
- color: #032f62;
536
- } /* Literal */
537
- .highlight .n {
538
- color: #24292e;
539
- } /* Name */
540
- .highlight .o {
541
- color: #d73a49;
542
- } /* Operator */
543
- .highlight .p {
544
- color: #24292e;
545
- } /* Punctuation */
546
- .highlight .cm {
547
- color: #6a737d;
548
- font-style: italic;
549
- } /* Comment.Multiline */
550
- .highlight .cp {
551
- color: #6a737d;
552
- font-weight: bold;
553
- } /* Comment.Preproc */
554
- .highlight .c1 {
555
- color: #6a737d;
556
- font-style: italic;
557
- } /* Comment.Single */
558
- .highlight .cs {
559
- color: #6a737d;
560
- font-weight: bold;
561
- font-style: italic;
562
- } /* Comment.Special */
563
- .highlight .gd {
564
- color: #24292e;
565
- background-color: #ffeef0;
566
- } /* Generic.Deleted */
567
- .highlight .ge {
568
- color: #24292e;
569
- font-style: italic;
570
- } /* Generic.Emph */
571
- .highlight .gr {
572
- color: #aa0000;
573
- } /* Generic.Error */
574
- .highlight .gh {
575
- color: #999999;
576
- font-weight: bold;
577
- } /* Generic.Heading */
578
- .highlight .gi {
579
- color: #24292e;
580
- background-color: #f0fff4;
581
- } /* Generic.Inserted */
582
- .highlight .go {
583
- color: #888888;
584
- } /* Generic.Output */
585
- .highlight .gp {
586
- color: #555555;
587
- } /* Generic.Prompt */
588
- .highlight .gs {
589
- font-weight: bold;
590
- } /* Generic.Strong */
591
- .highlight .gu {
592
- color: #aaaaaa;
593
- } /* Generic.Subheading */
594
- .highlight .gt {
595
- color: #aa0000;
596
- } /* Generic.Traceback */
597
- .highlight .kc {
598
- color: #d73a49;
599
- font-weight: bold;
600
- } /* Keyword.Constant */
601
- .highlight .kd {
602
- color: #d73a49;
603
- font-weight: bold;
604
- } /* Keyword.Declaration */
605
- .highlight .kn {
606
- color: #d73a49;
607
- font-weight: bold;
608
- } /* Keyword.Namespace */
609
- .highlight .kp {
610
- color: #d73a49;
611
- font-weight: bold;
612
- } /* Keyword.Pseudo */
613
- .highlight .kr {
614
- color: #d73a49;
615
- font-weight: bold;
616
- } /* Keyword.Reserved */
617
- .highlight .kt {
618
- color: #d73a49;
619
- font-weight: bold;
620
- } /* Keyword.Type */
621
- .highlight .ld {
622
- color: #032f62;
623
- } /* Literal.Date */
624
- .highlight .m {
625
- color: #005cc5;
626
- } /* Literal.Number */
627
- .highlight .s {
628
- color: #032f62;
629
- } /* Literal.String */
630
- .highlight .na {
631
- color: #6f42c1;
632
- } /* Name.Attribute */
633
- .highlight .nb {
634
- color: #005cc5;
635
- } /* Name.Builtin */
636
- .highlight .nc {
637
- color: #6f42c1;
638
- font-weight: bold;
639
- } /* Name.Class */
640
- .highlight .no {
641
- color: #005cc5;
642
- } /* Name.Constant */
643
- .highlight .nd {
644
- color: #6f42c1;
645
- font-weight: bold;
646
- } /* Name.Decorator */
647
- .highlight .ni {
648
- color: #800080;
649
- } /* Name.Entity */
650
- .highlight .ne {
651
- color: #990000;
652
- font-weight: bold;
653
- } /* Name.Exception */
654
- .highlight .nf {
655
- color: #6f42c1;
656
- } /* Name.Function */
657
- .highlight .nl {
658
- color: #990000;
659
- } /* Name.Label */
660
- .highlight .nn {
661
- color: #555555;
662
- } /* Name.Namespace */
663
- .highlight .nx {
664
- color: #6f42c1;
665
- } /* Name.Other */
666
- .highlight .py {
667
- color: #990000;
668
- } /* Name.Property */
669
- .highlight .nt {
670
- color: #22863a;
671
- } /* Name.Tag */
672
- .highlight .nv {
673
- color: #e36209;
674
- } /* Name.Variable */
675
- .highlight .ow {
676
- color: #d73a49;
677
- font-weight: bold;
678
- } /* Operator.Word */
679
- .highlight .w {
680
- color: #bbbbbb;
681
- } /* Text.Whitespace */
682
- .highlight .mf {
683
- color: #005cc5;
684
- } /* Literal.Number.Float */
685
- .highlight .mh {
686
- color: #005cc5;
687
- } /* Literal.Number.Hex */
688
- .highlight .mi {
689
- color: #005cc5;
690
- } /* Literal.Number.Integer */
691
- .highlight .mo {
692
- color: #005cc5;
693
- } /* Literal.Number.Oct */
694
- .highlight .sb {
695
- color: #032f62;
696
- } /* Literal.String.Backtick */
697
- .highlight .sc {
698
- color: #032f62;
699
- } /* Literal.String.Char */
700
- .highlight .sd {
701
- color: #032f62;
702
- } /* Literal.String.Doc */
703
- .highlight .s2 {
704
- color: #032f62;
705
- } /* Literal.String.Double */
706
- .highlight .se {
707
- color: #032f62;
708
- } /* Literal.String.Escape */
709
- .highlight .sh {
710
- color: #032f62;
711
- } /* Literal.String.Heredoc */
712
- .highlight .si {
713
- color: #032f62;
714
- } /* Literal.String.Interpol */
715
- .highlight .sx {
716
- color: #032f62;
717
- } /* Literal.String.Other */
718
- .highlight .sr {
719
- color: #22863a;
720
- } /* Literal.String.Regex */
721
- .highlight .s1 {
722
- color: #032f62;
723
- } /* Literal.String.Single */
724
- .highlight .ss {
725
- color: #032f62;
726
- } /* Literal.String.Symbol */
727
- .highlight .bp {
728
- color: #005cc5;
729
- } /* Name.Builtin.Pseudo */
730
- .highlight .vc {
731
- color: #e36209;
732
- } /* Name.Variable.Class */
733
- .highlight .vg {
734
- color: #e36209;
735
- } /* Name.Variable.Global */
736
- .highlight .vi {
737
- color: #e36209;
738
- } /* Name.Variable.Instance */
739
- .highlight .il {
740
- color: #005cc5;
741
- } /* Literal.Number.Integer.Long */
742
-
743
- /* Additional Rouge token classes that may be used */
744
- .highlight .token {
745
- color: #5670a0;
746
- }
747
- .highlight .token.list {
748
- color: #546e9f;
749
- }
750
- .highlight .token.punctuation {
751
- color: #3e8dad;
752
- }
753
- .highlight .token.list.punctuation {
754
- color: #e05b78;
755
- }
756
- .highlight .token.content {
757
- padding: 0;
758
- }
759
-
760
- /* Nested lists in page content */
761
- ul ul,
762
- ol ol,
763
- ul ol,
764
- ol ul {
765
- padding-left: 1.5em;
766
- margin-top: 0.25em;
767
- }
768
-
769
- /* Page footer */
770
- .page-footer {
771
- background: #f5f5f5;
772
- border-top: 1px solid #ddd;
773
- padding: 1.5rem;
774
- margin-top: 3rem;
775
- color: #666;
776
- font-size: 0.9em;
777
- }
778
-
779
- .page-footer p {
780
- margin: 0.5em 0;
781
- }
782
-
783
- .page-footer a {
784
- color: #0066cc;
785
- text-decoration: none;
786
- }
787
-
788
- .page-footer a:hover {
789
- text-decoration: underline;
790
- }
791
-
792
- /* Mobile responsive */
793
- @media (max-width: 768px) {
794
- .hamburger-menu {
795
- display: flex;
796
- }
797
-
798
- .main-toc,
799
- .sidebar {
800
- transform: translateX(-100%);
801
- z-index: 175;
802
- }
803
-
804
- .main-toc.mobile-open,
805
- .sidebar.mobile-open {
806
- transform: translateX(0);
807
- }
808
-
809
- body {
810
- margin: 2rem 1rem;
811
- }
812
-
813
- .floating-toc {
814
- left: 0;
815
- }
816
- }
817
-
818
- </style></head>
819
-
820
- <body class="code-highlighted">
821
- <div class="floating-toc" id="floating-toc">
822
- <div class="floating-toc-container">
823
- <div class="floating-toc-header">
824
- <span>Table of Contents 🔻</span>
825
- </div>
826
- <div class="floating-toc-content" id="floating-toc-content">
827
- <!-- Content will be populated by JavaScript -->
828
- </div>
829
- </div>
830
- </div>
831
-
832
- <button class="hamburger-menu" id="hamburger-menu" aria-label="Toggle navigation"></button>
833
- <div class="mobile-menu-overlay" id="mobile-menu-overlay"></div>
834
-
835
- <nav class="main-toc"><ul><li><a href="Home.html">Home</a></li><li><a href="Getting-Started.html">Getting Started</a></li><li><a href="Installation.html">Installation</a></li><li><a href="Usage.html">Usage</a></li><li><a href="Syntax.html">Syntax</a></li><li><a href="Callouts.html">Callouts</a></li><li><a href="Tables.html">Tables</a></li><li><a href="Inline-Attribute-Lists.html">Inline Attribute Lists</a></li><li><a href="Modes.html">Modes</a></li><li><a href="Quarto-Mode.html">Quarto Mode</a></li><li><a href="Command-Line-Options.html">Command Line Options</a></li><li><a href="Rendering-Markdown-In-Terminal.html">Rendering Markdown in the Terminal</a></li><li><a href="Generating-Man-Pages.html">Generating Man Pages</a></li><li><a href="Multi-File-Documents.html">Multi-file Documents</a></li><li><a href="Citations.html">Citations</a></li><li><a href="Indices.html">Indices</a></li><li><a href="Metadata-Transforms.html">Metadata Transforms</a></li><li><a href="Pandoc-Integration.html">Integrating with Pandoc</a></li><li><a href="Using-Apex-with-Jekyll.html">Using Apex with Jekyll</a></li><li><a href="Header-IDs.html">Header IDs</a></li><li><a href="C-API.html">C API</a></li><li><a href="Writing-Tests.html">Writing Tests</a></li><li><a href="Xcode-Integration.html">Xcode Integration</a></li><li><a href="Examples.html">Examples</a></li><li><a href="Plugins.html">Plugins</a></li><li><a href="Filters.html">Filters</a></li><li><a href="Troubleshooting.html">Troubleshooting</a></li><li><a href="Credits.html">Credits</a></li></ul></nav>
836
-
837
- <h1 id="plugins">
838
- Plugins
839
- </h1>
840
- <nav class="page-toc" id="page-toc-top"><ul><li><a href="#plugins">Plugins</a><ul><li><a href="#enabling-and-disabling-plugins">Enabling and disabling&nbsp;plugins</a></li><li><a href="#where-plugins-live">Where plugins&nbsp;live</a></li><li><a href="#disabling-a-global-plugin-within-a-project-shadowno-op">Disabling a global plugin within a project&nbsp;(shadow/no-op)</a></li><li><a href="#processing-phases">Processing&nbsp;phases</a></li><li><a href="#plugin-manifest-pluginyml">Plugin manifest:&nbsp;plugin.yml</a><ul><li><a href="#metadata-fields-for-directories-and-installers">Metadata fields for directories and&nbsp;installers</a></li><li><a href="#post-install-hooks-postinstall">Post-install hooks&nbsp;(post_install)</a></li></ul></li><li><a href="#plugin-bundles-bundle-key">Plugin bundles (bundle&nbsp;key)</a><ul><li><a href="#bundle-structure">Bundle&nbsp;structure</a></li><li><a href="#inheritance-and-overrides">Inheritance and&nbsp;overrides</a></li><li><a href="#behavior-and-limitations">Behavior and&nbsp;limitations</a></li></ul></li><li><a href="#external-handler-plugins-scriptscommands">External handler plugins&nbsp;(scripts/commands)</a><ul><li><a href="#manifest-fields">Manifest&nbsp;fields</a></li><li><a href="#json-protocol">JSON&nbsp;protocol</a></li></ul></li><li><a href="#declarative-regex-plugins-no-scripting">Declarative regex plugins (no&nbsp;scripting)</a><ul><li><a href="#manifest-fields">Manifest&nbsp;fields</a></li></ul></li><li><a href="#support-directory-and-environment-variables">Support directory and environment&nbsp;variables</a><ul><li><a href="#support-directory-apexsupportdir">Support directory&nbsp;(APEX_SUPPORT_DIR)</a></li><li><a href="#environment-variables-for-external-plugins">Environment variables for external&nbsp;plugins</a></li></ul></li><li><a href="#installing-plugins-from-the-directory">Installing plugins from the&nbsp;directory</a><ul><li><a href="#listing-available-plugins">Listing available&nbsp;plugins</a></li><li><a href="#installing-a-plugin">Installing&nbsp;a&nbsp;plugin</a><ul><li><a href="#security-confirmation-for-direct-installs">Security confirmation for direct&nbsp;installs</a></li><li><a href="#installation-process">Installation&nbsp;process</a></li></ul></li><li><a href="#uninstalling-a-plugin">Uninstalling&nbsp;a&nbsp;plugin</a></li></ul></li><li><a href="#share-your-plugin">Share Your&nbsp;Plugin</a></li><li><a href="#example-kbd-liquid-tag-plugin">Example: kbd liquid tag plugin</a><ul><li><a href="#directory-layout">Directory&nbsp;layout</a></li><li><a href="#pluginyml">plugin.yml</a></li><li><a href="#kbdpluginrb-simplified-shape">kbd_plugin.rb (simplified shape)</a></li></ul></li><li><a href="#example-emoji-span-plugin-declarative">Example: :emoji: span plugin (declarative)</a><ul><li><a href="#directory-layout">Directory&nbsp;layout</a></li><li><a href="#pluginyml">plugin.yml</a></li></ul></li><li><a href="#putting-it-all-together">Putting it all&nbsp;together</a></li></ul></li></ul></nav>
841
-
842
- <p>
843
- Apex supports a lightweight plugin system that lets you add new syntax and post‑processing behavior <strong>without patching the core</strong>. Plugins can be small scripts (Ruby, Python, etc.) or simple declarative regex rules defined in YAML.
844
- </p>
845
-
846
- <p>
847
- This page covers:
848
- </p>
849
-
850
- <ul>
851
-
852
- <li>
853
- <strong>Where plugins live</strong>
854
- </li>
855
-
856
- <li>
857
- <strong>How to enable/disable plugins</strong>
858
- </li>
859
-
860
- <li>
861
- <strong>Processing phases</strong>
862
- </li>
863
-
864
- <li>
865
- <strong>Plugin manifest format (<code>plugin.yml</code>)</strong>
866
- </li>
867
-
868
- <li>
869
- <strong>External handler plugins (scripts/commands)</strong>
870
- </li>
871
-
872
- <li>
873
- <strong>Declarative regex plugins (pure YAML)</strong>
874
- </li>
875
-
876
- <li>
877
- <strong>Plugin bundles (<code>bundle</code> key)</strong>
878
- </li>
879
-
880
- <li>
881
- <strong>Support directory and environment variables</strong>
882
- </li>
883
-
884
- <li>
885
- <strong>Plugin metadata for directories and installers</strong>
886
- </li>
887
-
888
- <li>
889
- <strong>Installing plugins from the directory or a Git URL</strong>
890
- </li>
891
-
892
- <li>
893
- <strong>Examples: <code>kbd</code> liquid tag and <code><span class=\"emoji\">:emoji:</span></code> spans</strong>
894
- </li>
895
-
896
- </ul>
897
-
898
- <p>
899
- If you are using plugins from Swift/Xcode, see <a href="Xcode-Integration#apexoptions-vs-apex_options">Xcode Integration</a> for guidance on when to use high-level <code>ApexOptions</code> vs low-level <code>apex_options</code> and required imports (<code>Apex</code> + <code>ApexC</code>) for direct C struct field access.
900
- </p>
901
-
902
- <hr />
903
- <h2 id="enabling-and-disabling-plugins">
904
- Enabling and disabling&nbsp;plugins
905
- </h2>
906
-
907
- <p>
908
- By design, <strong>plugins are disabled by default</strong> so Apex’s performance and behavior are unchanged unless you explicitly opt in.
909
- </p>
910
-
911
- <ul>
912
-
913
- <li>
914
-
915
- <p>
916
- <strong>CLI flags</strong>
917
- </p>
918
-
919
- <ul>
920
-
921
- <li>
922
- <strong>Enable plugins</strong>: <code>apex --plugins input.md</code>
923
- </li>
924
-
925
- <li>
926
- <strong>Disable plugins</strong>: <code>apex --no-plugins input.md</code>
927
- </li>
928
-
929
- </ul>
930
-
931
- </li>
932
-
933
- <li>
934
-
935
- <p>
936
- <strong>Metadata keys</strong> (in the document’s front matter)
937
- </p>
938
-
939
- <ul>
940
-
941
- <li>
942
-
943
- <p>
944
- Any of these keys are recognized (case-insensitive):
945
- </p>
946
-
947
- <ul>
948
-
949
- <li>
950
- <code>plugins</code>
951
- </li>
952
-
953
- <li>
954
- <code>enable-plugins</code>
955
- </li>
956
-
957
- <li>
958
- <code>enable_plugins</code>
959
- </li>
960
-
961
- </ul>
962
-
963
- </li>
964
-
965
- <li>
966
-
967
- <p>
968
- Example:
969
- </p>
970
-
971
- <div class="highlight">
972
- <pre><span></span><span class="nn">---</span>
973
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Plugin demo</span>
974
- <span class="nt">plugins</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
975
- <span class="nn">---</span>
976
- </pre>
977
- </div>
978
-
979
- </li>
980
-
981
- </ul>
982
-
983
- </li>
984
-
985
- <li>
986
-
987
- <p>
988
- <strong>Precedence</strong>
989
- </p>
990
-
991
- <ul>
992
-
993
- <li>
994
- If metadata enables or disables plugins, you can still override it from the CLI:
995
- <ul>
996
-
997
- <li>
998
- <code>--plugins</code> forces plugins <strong>on</strong>
999
- </li>
1000
-
1001
- <li>
1002
- <code>--no-plugins</code> forces plugins <strong>off</strong>
1003
- </li>
1004
-
1005
- </ul>
1006
-
1007
- </li>
1008
-
1009
- <li>
1010
- CLI flags always win over metadata.
1011
- </li>
1012
-
1013
- </ul>
1014
-
1015
- </li>
1016
-
1017
- </ul>
1018
-
1019
- <p>
1020
- If you never set <code>plugins: true</code> or pass <code>--plugins</code>, Apex will not load or run any plugins.
1021
- </p>
1022
-
1023
- <hr />
1024
- <h2 id="where-plugins-live">
1025
- Where plugins&nbsp;live
1026
- </h2>
1027
-
1028
- <p>
1029
- Plugins are discovered from <strong>project</strong> and <strong>user</strong> locations, in this order:
1030
- </p>
1031
-
1032
- <ul>
1033
-
1034
- <li>
1035
-
1036
- <p>
1037
- <strong>Project-local plugins (current directory)</strong>
1038
- </p>
1039
-
1040
- <ul>
1041
-
1042
- <li>
1043
- Directory: <code>.apex/plugins/</code> under the <strong>current working directory</strong>.
1044
- </li>
1045
-
1046
- <li>
1047
- Structure: <strong>one subdirectory per plugin</strong>, for example:
1048
- <ul>
1049
-
1050
- <li>
1051
- <code>.apex/plugins/kbd/plugin.yml</code>
1052
- </li>
1053
-
1054
- <li>
1055
- <code>.apex/plugins/kbd/kbd_plugin.rb</code>
1056
- </li>
1057
-
1058
- <li>
1059
- <code>.apex/plugins/emoji/plugin.yml</code>
1060
- </li>
1061
-
1062
- </ul>
1063
-
1064
- </li>
1065
-
1066
- </ul>
1067
-
1068
- </li>
1069
-
1070
- <li>
1071
-
1072
- <p>
1073
- <strong>Project-local plugins (base directory)</strong>
1074
- </p>
1075
-
1076
- <ul>
1077
-
1078
- <li>
1079
- If Apex knows a <code>base_directory</code> (from <code>--base-dir</code>, metadata, or the input file’s directory), it also looks in:
1080
- <ul>
1081
-
1082
- <li>
1083
- <code>&lt;base_directory&gt;/.apex/plugins/</code>
1084
- </li>
1085
-
1086
- </ul>
1087
-
1088
- </li>
1089
-
1090
- </ul>
1091
-
1092
- </li>
1093
-
1094
- <li>
1095
-
1096
- <p>
1097
- <strong>Project-local plugins (Git repository root)</strong>
1098
- </p>
1099
-
1100
- <ul>
1101
-
1102
- <li>
1103
- If the current directory is inside a Git repository and <code>git rev-parse --show-toplevel</code> succeeds, Apex will also look in:
1104
- <ul>
1105
-
1106
- <li>
1107
- <code>&lt;git-top-level&gt;/.apex/plugins/</code>
1108
- </li>
1109
-
1110
- </ul>
1111
-
1112
- </li>
1113
-
1114
- <li>
1115
- This is only used when the Git top-level is a parent of (or equal to) the current directory.
1116
- </li>
1117
-
1118
- </ul>
1119
-
1120
- </li>
1121
-
1122
- <li>
1123
-
1124
- <p>
1125
- <strong>Global (user) plugins</strong>
1126
- </p>
1127
-
1128
- <ul>
1129
-
1130
- <li>
1131
- Directory (XDG-aware):
1132
- <ul>
1133
-
1134
- <li>
1135
- If <code>$XDG_CONFIG_HOME</code> is set:
1136
- <ul>
1137
-
1138
- <li>
1139
- <code>$XDG_CONFIG_HOME/apex/plugins/</code>
1140
- </li>
1141
-
1142
- </ul>
1143
-
1144
- </li>
1145
-
1146
- <li>
1147
- Otherwise:
1148
- <ul>
1149
-
1150
- <li>
1151
- <code>~/.config/apex/plugins/</code>
1152
- </li>
1153
-
1154
- </ul>
1155
-
1156
- </li>
1157
-
1158
- </ul>
1159
-
1160
- </li>
1161
-
1162
- <li>
1163
- Same structure: one subdirectory per plugin:
1164
- <ul>
1165
-
1166
- <li>
1167
- <code>~/.config/apex/plugins/kbd/plugin.yml</code>
1168
- </li>
1169
-
1170
- <li>
1171
- <code>~/.config/apex/plugins/emoji/plugin.yml</code>
1172
- </li>
1173
-
1174
- </ul>
1175
-
1176
- </li>
1177
-
1178
- </ul>
1179
-
1180
- </li>
1181
-
1182
- </ul>
1183
-
1184
- <p>
1185
- <strong>Plugin IDs must be unique.</strong> If a project plugin and a global plugin share the same <code>id</code>, the <strong>project plugin wins</strong> and the global one is ignored.
1186
- </p>
1187
-
1188
- <hr />
1189
- <h2 id="disabling-a-global-plugin-within-a-project-shadowno-op">
1190
- Disabling a global plugin within a project&nbsp;(shadow/no-op)
1191
- </h2>
1192
-
1193
- <p>
1194
- Sometimes you may want to <strong>disable</strong> a plugin that is installed globally, but only for a specific project. Apex’s lookup order makes this easy: you can <strong>shadow</strong> a global plugin with a <strong>no-op project plugin</strong> that has the same <code>id</code>.
1195
- </p>
1196
-
1197
- <p>
1198
- Key points:
1199
- </p>
1200
-
1201
- <ul>
1202
-
1203
- <li>
1204
- <strong>Project plugins are loaded before global plugins.</strong>
1205
- </li>
1206
-
1207
- <li>
1208
- If two plugins share the same <code>id</code>, the <strong>first one wins</strong> and the later one is ignored.
1209
- </li>
1210
-
1211
- <li>
1212
- A plugin that has <strong>no handler and no regex</strong> is a <strong>true no-op</strong>: it is loaded, but never changes the text.
1213
- </li>
1214
-
1215
- </ul>
1216
-
1217
- <p>
1218
- To disable a global plugin called <code>emoji-span</code> just for one project:
1219
- </p>
1220
-
1221
- <ol>
1222
-
1223
- <li>
1224
-
1225
- <p>
1226
- Create a project plugins directory:
1227
- </p>
1228
-
1229
- <div class="highlight">
1230
- <pre><span></span>.apex/
1231
- plugins/
1232
- emoji-span/
1233
- plugin.yml
1234
- </pre>
1235
- </div>
1236
-
1237
- </li>
1238
-
1239
- <li>
1240
-
1241
- <p>
1242
- Add a minimal <strong>no-op</strong> manifest that declares the same <code>id</code> and a phase, but no handler or pattern:
1243
- </p>
1244
-
1245
- <div class="highlight">
1246
- <pre><span></span><span class="nn">---</span>
1247
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
1248
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span><span class="w"> </span><span class="c1"># or pre_parse, depending on the original plugin</span>
1249
- <span class="c1"># No handler.command, pattern, or replacement on purpose:</span>
1250
- <span class="c1"># this plugin will be loaded, but it does nothing.</span>
1251
- <span class="nn">---</span>
1252
- </pre>
1253
- </div>
1254
-
1255
- </li>
1256
-
1257
- </ol>
1258
-
1259
- <p>
1260
- When you run Apex with plugins enabled in that project:
1261
- </p>
1262
-
1263
- <ul>
1264
-
1265
- <li>
1266
- The project-local <code>emoji-span</code> plugin is discovered first.
1267
- </li>
1268
-
1269
- <li>
1270
- Because a plugin with id <code>emoji-span</code> already exists, the <strong>global</strong> <code>emoji-span</code> plugin is <strong>skipped</strong>.
1271
- </li>
1272
-
1273
- <li>
1274
- Since the project version has no handler or regex, it is effectively a <strong>no-op</strong>, which means the global plugin is <strong>disabled for this project only</strong>.
1275
- </li>
1276
-
1277
- </ul>
1278
-
1279
- <hr />
1280
- <h2 id="processing-phases">
1281
- Processing&nbsp;phases
1282
- </h2>
1283
-
1284
- <p>
1285
- Apex exposes several <strong>phases</strong> in its pipeline. Plugins can hook into one or more phases; for now, two are wired up:
1286
- </p>
1287
-
1288
- <ul>
1289
-
1290
- <li>
1291
-
1292
- <p>
1293
- <strong><code>pre_parse</code></strong>
1294
- </p>
1295
-
1296
- <ul>
1297
-
1298
- <li>
1299
- Runs on the <strong>raw Markdown text</strong> <em>before</em> it is parsed.
1300
- </li>
1301
-
1302
- <li>
1303
- Good for:
1304
- <ul>
1305
-
1306
- <li>
1307
- Custom syntax (e.g. <code>&lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt;</code>)
1308
- </li>
1309
-
1310
- <li>
1311
- Textual rewrites
1312
- </li>
1313
-
1314
- <li>
1315
- Adding/removing markup before Apex sees it
1316
- </li>
1317
-
1318
- </ul>
1319
-
1320
- </li>
1321
-
1322
- </ul>
1323
-
1324
- </li>
1325
-
1326
- <li>
1327
-
1328
- <p>
1329
- <strong><code>post_render</code></strong>
1330
- </p>
1331
-
1332
- <ul>
1333
-
1334
- <li>
1335
- Runs on the <strong>final HTML output</strong> after Apex finishes rendering.
1336
- </li>
1337
-
1338
- <li>
1339
- Good for:
1340
- <ul>
1341
-
1342
- <li>
1343
- Wrapping elements in spans/divs
1344
- </li>
1345
-
1346
- <li>
1347
- Adding CSS classes
1348
- </li>
1349
-
1350
- <li>
1351
- Simple HTML post-processing (e.g. turning <code><span class=\"emoji\">:emoji:</span></code> into <code>&lt;span&gt;</code>)
1352
- </li>
1353
-
1354
- </ul>
1355
-
1356
- </li>
1357
-
1358
- </ul>
1359
-
1360
- </li>
1361
-
1362
- </ul>
1363
-
1364
- <p>
1365
- Internally, plugins for each phase are run in a <strong>deterministic order</strong>:
1366
- </p>
1367
-
1368
- <ol>
1369
-
1370
- <li>
1371
- Sorted by <strong>priority</strong> (lower numbers first; default is <code>100</code>).
1372
- </li>
1373
-
1374
- <li>
1375
- Ties broken by <strong>plugin <code>id</code></strong> (lexicographically).
1376
- </li>
1377
-
1378
- </ol>
1379
-
1380
- <hr />
1381
- <h2 id="plugin-manifest-pluginyml">
1382
- Plugin manifest:&nbsp;<code>plugin.yml</code>
1383
- </h2>
1384
-
1385
- <p>
1386
- Each plugin is defined by a <strong>manifest</strong> file:
1387
- </p>
1388
-
1389
- <ul>
1390
-
1391
- <li>
1392
-
1393
- <p>
1394
- <strong>File name</strong>: <code>plugin.yml</code>
1395
- </p>
1396
-
1397
- </li>
1398
-
1399
- <li>
1400
-
1401
- <p>
1402
- <strong>Location</strong>: inside the plugin’s directory, e.g.:
1403
- </p>
1404
-
1405
- <div class="highlight">
1406
- <pre><span></span>.apex/plugins/kbd/plugin.yml
1407
- ~/.config/apex/plugins/emoji/plugin.yml
1408
- </pre>
1409
- </div>
1410
-
1411
- </li>
1412
-
1413
- </ul>
1414
-
1415
- <p>
1416
- At minimum, a plugin needs:
1417
- </p>
1418
-
1419
- <div class="highlight">
1420
- <pre><span></span><span class="nn">---</span>
1421
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-plugin</span>
1422
- <span class="c1"># Optional, but strongly recommended metadata:</span>
1423
- <span class="c1"># title: Human-friendly name (if omitted, tools may fall back to id)</span>
1424
- <span class="c1"># author: Name or handle of the plugin author</span>
1425
- <span class="c1"># description: Short, human-readable description of what the plugin does</span>
1426
- <span class="c1"># homepage: URL for the plugin landing page or README</span>
1427
- <span class="c1"># repo: Canonical Git repository URL used for installation/updates</span>
1428
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span><span class="w"> </span><span class="c1"># or post_render</span>
1429
- <span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span><span class="w"> </span><span class="c1"># optional, lower runs earlier</span>
1430
- <span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span><span class="w"> </span><span class="c1"># optional, 0 = no extra timeout logic (best-effort)</span>
1431
- <span class="nn">---</span>
1432
- </pre>
1433
- </div>
1434
-
1435
- <p>
1436
- From there, you choose <strong>one of two plugin types</strong>:
1437
- </p>
1438
-
1439
- <ul>
1440
-
1441
- <li>
1442
- <strong>External handler plugin</strong>
1443
- <ul>
1444
-
1445
- <li>
1446
- Runs an external command (Ruby, Python, shell, etc.).
1447
- </li>
1448
-
1449
- <li>
1450
- Declared with a <code>handler.command</code> field.
1451
- </li>
1452
-
1453
- </ul>
1454
-
1455
- </li>
1456
-
1457
- <li>
1458
- <strong>Declarative regex plugin</strong>
1459
- <ul>
1460
-
1461
- <li>
1462
- No external code; in-process regex search/replace.
1463
- </li>
1464
-
1465
- <li>
1466
- Declared with <code>pattern</code> and <code>replacement</code> fields.
1467
- </li>
1468
-
1469
- </ul>
1470
-
1471
- </li>
1472
-
1473
- </ul>
1474
-
1475
- <p>
1476
- You can’t mix both styles in a single plugin; if <code>handler.command</code> is present, the plugin is treated as external.
1477
- </p>
1478
-
1479
- <h3 id="metadata-fields-for-directories-and-installers">
1480
- Metadata fields for directories and&nbsp;installers
1481
- </h3>
1482
-
1483
- <p>
1484
- To support plugin directories, automatic installation, and future auto-update tools, Apex understands several <strong>optional metadata fields</strong> in <code>plugin.yml</code>:
1485
- </p>
1486
-
1487
- <ul>
1488
-
1489
- <li>
1490
- <strong><code>title</code></strong>: Short, human-friendly name for the plugin (e.g. <code>Keyboard Shortcuts</code>).
1491
- </li>
1492
-
1493
- <li>
1494
- <strong><code>author</code></strong>: Free-form author string (your name, handle, or organization).
1495
- </li>
1496
-
1497
- <li>
1498
- <strong><code>description</code></strong>: One–two sentence description of what the plugin does. This is already used in examples and is what directory listings will usually display.
1499
- </li>
1500
-
1501
- <li>
1502
- <strong><code>homepage</code></strong>: Informational URL where users can learn more about the plugin—often a README, documentation site, or the GitHub project page. This field is <strong>not</strong> used for cloning, but may be shown in <code>--list-plugins</code> output.
1503
- </li>
1504
-
1505
- <li>
1506
- <strong><code>repo</code></strong>: <strong>Canonical Git URL</strong> for the plugin repository, used by Apex when installing plugins from the central directory (for example, <code>https://github.com/ApexMarkdown/apex-kbd-plugin.git</code>). The repository must contain the <code>plugin.yml</code> manifest (and any supporting files) at its root.
1507
- </li>
1508
-
1509
- <li>
1510
- <strong><code>post_install</code></strong>: Optional command that Apex will run after cloning the plugin during <code>--install-plugin</code>. See “Post-install hooks” below.
1511
- </li>
1512
-
1513
- </ul>
1514
-
1515
- <p>
1516
- Only <code>id</code>, <code>phase</code>, and either <code>handler.command</code> (for external plugins) or <code>pattern</code>/<code>replacement</code> (for declarative plugins) are required for execution—everything else is optional metadata used by tools.
1517
- </p>
1518
-
1519
- <h3 id="post-install-hooks-postinstall">
1520
- Post-install hooks&nbsp;(<code>post_install</code>)
1521
- </h3>
1522
-
1523
- <p>
1524
- External plugins can define an optional <code>post_install</code> command in <code>plugin.yml</code> that Apex will run immediately after cloning the plugin during <code>--install-plugin</code>:
1525
- </p>
1526
-
1527
- <div class="highlight">
1528
- <pre><span></span><span class="nn">---</span>
1529
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
1530
- <span class="c1"># ... other fields ...</span>
1531
- <span class="nt">post_install</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">./post_install.sh</span>
1532
- <span class="nn">---</span>
1533
- </pre>
1534
- </div>
1535
-
1536
- <p>
1537
- When you run:
1538
- </p>
1539
-
1540
- <div class="highlight">
1541
- <pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>kbd
1542
- </pre>
1543
- </div>
1544
-
1545
- <p>
1546
- Apex will:
1547
- </p>
1548
-
1549
- <ol>
1550
-
1551
- <li>
1552
- Clone the plugin repository into your user plugin directory (e.g. <code>~/.config/apex/plugins/kbd</code>).
1553
- </li>
1554
-
1555
- <li>
1556
- Look for <code>plugin.yml</code> (or <code>plugin.yaml</code>) in the root of that directory.
1557
- </li>
1558
-
1559
- <li>
1560
- If it finds a <code>post_install</code> key, run the value as a shell command from the plugin directory (equivalent to <code>cd &lt;plugin_dir&gt; &amp;&amp; &lt;post_install&gt;</code>).
1561
- </li>
1562
-
1563
- </ol>
1564
-
1565
- <p>
1566
- This hook is useful for:
1567
- </p>
1568
-
1569
- <ul>
1570
-
1571
- <li>
1572
- Creating initial configuration files or support data under <code>APEX_SUPPORT_DIR</code>.
1573
- </li>
1574
-
1575
- <li>
1576
- Printing a welcome or usage message via <code>echo</code>.
1577
- </li>
1578
-
1579
- <li>
1580
- Running an interactive setup script that asks the user questions and writes config.
1581
- </li>
1582
-
1583
- </ul>
1584
-
1585
- <p>
1586
- If the <code>post_install</code> command exits with a non-zero status, Apex prints a warning but considers the plugin installed successfully (the clone is not rolled back).
1587
- </p>
1588
-
1589
- <hr />
1590
- <h2 id="plugin-bundles-bundle-key">
1591
- Plugin bundles (<code>bundle</code>&nbsp;key)
1592
- </h2>
1593
-
1594
- <p>
1595
- Sometimes it is convenient for a single repository to provide <strong>multiple related plugins</strong> as a bundle—for example, a “documentation” bundle that contains:
1596
- </p>
1597
-
1598
- <ul>
1599
-
1600
- <li>
1601
- <code>kbd</code> – expands <code>&lt;span class=&quot;keycombo combined&quot; title=&quot;Command-3&quot;&gt;&lt;kbd class=&quot;mod symbol&quot;&gt;&amp;#8984;&lt;/kbd&gt;&lt;kbd class=&quot;key symbol&quot;&gt;3&lt;/kbd&gt;&lt;/span&gt;</code> keyboard shortcuts
1602
- </li>
1603
-
1604
- <li>
1605
- <code>prefpane</code> – expands <code>{% prefspane Advanced, Processor %}</code>
1606
- </li>
1607
-
1608
- <li>
1609
- <code>menubar</code> – expands <code>{% menubar File, Open %}</code>
1610
- </li>
1611
-
1612
- </ul>
1613
-
1614
- <p>
1615
- Instead of creating a separate repo (and <code>plugin.yml</code>) for each, Apex supports a <strong>bundle</strong> syntax in <code>plugin.yml</code> when built with full YAML (libyaml) support.
1616
- </p>
1617
-
1618
- <h3 id="bundle-structure">
1619
- Bundle&nbsp;structure
1620
- </h3>
1621
-
1622
- <p>
1623
- A <strong>bundle manifest</strong> has:
1624
- </p>
1625
-
1626
- <ul>
1627
-
1628
- <li>
1629
- Top-level metadata that applies to the bundle as a whole.
1630
- </li>
1631
-
1632
- <li>
1633
- A <code>bundle:</code> key whose value is a YAML sequence (array) of per-plugin configs.
1634
- </li>
1635
-
1636
- </ul>
1637
-
1638
- <p>
1639
- Example:
1640
- </p>
1641
-
1642
- <div class="highlight">
1643
- <pre><span></span><span class="nn">---</span>
1644
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">documentation</span>
1645
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Documentation helpers</span>
1646
- <span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
1647
- <span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">A bundle of documentation-related helpers (kbd, menubar, prefpane).</span>
1648
- <span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-plugin-documentation</span>
1649
- <span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-plugin-documentation.git</span>
1650
-
1651
- <span class="c1"># Each entry in bundle defines a child plugin</span>
1652
- <span class="nt">bundle</span><span class="p">:</span>
1653
- <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
1654
- <span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
1655
- <span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render &lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt; key combos to HTML &lt;kbd&gt; elements</span>
1656
- <span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
1657
- <span class="w"> </span><span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
1658
- <span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
1659
- <span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb&quot;</span>
1660
-
1661
- <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">menubar</span>
1662
- <span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Menubar Paths</span>
1663
- <span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render {% menubar File, Open %} to a styled menu path</span>
1664
- <span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
1665
- <span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
1666
- <span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ruby</span><span class="nv"> </span><span class="s">menubar_plugin.rb&quot;</span>
1667
-
1668
- <span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">prefspane</span>
1669
- <span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Preferences Pane</span>
1670
- <span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render {% prefspane Advanced, Processor %} to a styled preference path</span>
1671
- <span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
1672
- <span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
1673
- <span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ruby</span><span class="nv"> </span><span class="s">prefspane_plugin.rb&quot;</span>
1674
- <span class="nn">---</span>
1675
- </pre>
1676
- </div>
1677
-
1678
- <p>
1679
- Apex will treat this as <strong>three distinct plugins</strong>:
1680
- </p>
1681
-
1682
- <ul>
1683
-
1684
- <li>
1685
- <code>kbd</code>
1686
- </li>
1687
-
1688
- <li>
1689
- <code>menubar</code>
1690
- </li>
1691
-
1692
- <li>
1693
- <code>prefspane</code>
1694
- </li>
1695
-
1696
- </ul>
1697
-
1698
- <p>
1699
- all sourced from the same repository and manifest.
1700
- </p>
1701
-
1702
- <h3 id="inheritance-and-overrides">
1703
- Inheritance and&nbsp;overrides
1704
- </h3>
1705
-
1706
- <p>
1707
- When loading a bundle, Apex:
1708
- </p>
1709
-
1710
- <ol>
1711
-
1712
- <li>
1713
- Parses the top-level mapping (the “bundle header”), and the <code>bundle:</code> sequence, using full YAML.
1714
- </li>
1715
-
1716
- <li>
1717
- For each entry in <code>bundle</code>:
1718
- <ul>
1719
-
1720
- <li>
1721
- Starts with the <strong>top-level metadata</strong>.
1722
- </li>
1723
-
1724
- <li>
1725
- Applies the child entry’s fields as <strong>overrides</strong>.
1726
- </li>
1727
-
1728
- </ul>
1729
-
1730
- </li>
1731
-
1732
- </ol>
1733
-
1734
- <p>
1735
- Concretely:
1736
- </p>
1737
-
1738
- <ul>
1739
-
1740
- <li>
1741
- Top-level <code>author</code>, <code>homepage</code>, and <code>repo</code> are used as defaults for every child plugin.
1742
- </li>
1743
-
1744
- <li>
1745
- Each child <strong>must</strong> define its own:
1746
- <ul>
1747
-
1748
- <li>
1749
- <code>id</code>
1750
- </li>
1751
-
1752
- <li>
1753
- <code>phase</code>
1754
- </li>
1755
-
1756
- <li>
1757
- and either:
1758
- <ul>
1759
-
1760
- <li>
1761
- <code>handler.command</code> (external plugin), or
1762
- </li>
1763
-
1764
- <li>
1765
- <code>pattern</code> + <code>replacement</code> (declarative plugin)
1766
- </li>
1767
-
1768
- </ul>
1769
-
1770
- </li>
1771
-
1772
- </ul>
1773
-
1774
- </li>
1775
-
1776
- <li>
1777
- A child <strong>may</strong> also define its own:
1778
- <ul>
1779
-
1780
- <li>
1781
- <code>title</code>
1782
- </li>
1783
-
1784
- <li>
1785
- <code>description</code>
1786
- </li>
1787
-
1788
- <li>
1789
- <code>priority</code>
1790
- </li>
1791
-
1792
- <li>
1793
- <code>timeout_ms</code>
1794
- </li>
1795
-
1796
- <li>
1797
- <code>flags</code>
1798
- </li>
1799
-
1800
- </ul>
1801
-
1802
- </li>
1803
-
1804
- <li>
1805
- If a child defines <code>author</code>, <code>homepage</code>, or <code>repo</code>, those values <strong>override</strong> the bundle-level defaults for that child only.
1806
- </li>
1807
-
1808
- </ul>
1809
-
1810
- <p>
1811
- After merging, each child is turned into a normal internal plugin record, just like if it had its own standalone <code>plugin.yml</code>.
1812
- </p>
1813
-
1814
- <h3 id="behavior-and-limitations">
1815
- Behavior and&nbsp;limitations
1816
- </h3>
1817
-
1818
- <ul>
1819
-
1820
- <li>
1821
- <strong>Discovery</strong>:
1822
- <ul>
1823
-
1824
- <li>
1825
- Bundle manifests live in the same places as normal plugins:
1826
- <ul>
1827
-
1828
- <li>
1829
- Project-local: <code>.apex/plugins/documentation/plugin.yml</code>
1830
- </li>
1831
-
1832
- <li>
1833
- Global: <code>~/.config/apex/plugins/documentation/plugin.yml</code>
1834
- </li>
1835
-
1836
- </ul>
1837
-
1838
- </li>
1839
-
1840
- </ul>
1841
-
1842
- </li>
1843
-
1844
- <li>
1845
- <strong>Phases and IDs</strong>:
1846
- <ul>
1847
-
1848
- <li>
1849
- Each child plugin’s <code>id</code> and <code>phase</code> are used when registering and running plugins.
1850
- </li>
1851
-
1852
- <li>
1853
- All normal rules apply:
1854
- <ul>
1855
-
1856
- <li>
1857
- IDs must be unique across all loaded plugins.
1858
- </li>
1859
-
1860
- <li>
1861
- Phase must be <code>pre_parse</code> or <code>post_render</code> (for now).
1862
- </li>
1863
-
1864
- </ul>
1865
-
1866
- </li>
1867
-
1868
- </ul>
1869
-
1870
- </li>
1871
-
1872
- <li>
1873
- <strong>libyaml requirement</strong>:
1874
- <ul>
1875
-
1876
- <li>
1877
- The <code>bundle</code> syntax relies on full YAML parsing via <code>libyaml</code>.
1878
- </li>
1879
-
1880
- <li>
1881
- If Apex is built <strong>without</strong> libyaml support, <code>bundle:</code> is not recognized as a special structure; in that case, you should fall back to separate manifests for each plugin if you need cross-platform behavior on builds that omit libyaml.
1882
- </li>
1883
-
1884
- </ul>
1885
-
1886
- </li>
1887
-
1888
- </ul>
1889
-
1890
- <hr />
1891
- <h2 id="external-handler-plugins-scriptscommands">
1892
- External handler plugins&nbsp;(scripts/commands)
1893
- </h2>
1894
-
1895
- <p>
1896
- An external handler plugin defines a <strong>command</strong> to run, which receives JSON on stdin and writes the transformed text to stdout.
1897
- </p>
1898
-
1899
- <h3 id="manifest-fields">
1900
- Manifest&nbsp;fields
1901
- </h3>
1902
-
1903
- <div class="highlight">
1904
- <pre><span></span><span class="nn">---</span>
1905
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
1906
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
1907
- <span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
1908
- <span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render &lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt; key combos to HTML</span>
1909
- <span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin</span>
1910
- <span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin.git</span>
1911
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
1912
- <span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
1913
- <span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span><span class="w"> </span><span class="c1"># optional</span>
1914
- <span class="nt">handler</span><span class="p">:</span>
1915
- <span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb&quot;</span>
1916
- <span class="nn">---</span>
1917
- </pre>
1918
- </div>
1919
-
1920
- <ul>
1921
-
1922
- <li>
1923
- <strong><code>id</code></strong>: unique identifier (no spaces recommended).
1924
- </li>
1925
-
1926
- <li>
1927
- <strong><code>title</code>/<code>author</code>/<code>description</code>/<code>homepage</code>/<code>repo</code></strong>: optional metadata used by listing/installation tools and plugin directories.
1928
- </li>
1929
-
1930
- <li>
1931
- <strong><code>phase</code></strong>: <code>pre_parse</code> or <code>post_render</code>.
1932
- </li>
1933
-
1934
- <li>
1935
- <strong><code>priority</code></strong>: integer; lower runs first.
1936
- </li>
1937
-
1938
- <li>
1939
- <strong><code>timeout_ms</code></strong>: optional; host may use this as a soft cap.
1940
- </li>
1941
-
1942
- <li>
1943
- <strong><code>handler.command</code></strong>:
1944
- <ul>
1945
-
1946
- <li>
1947
- Executed via <code>sh -c</code> from the plugin’s directory (<code>APEX_PLUGIN_DIR</code>).
1948
- </li>
1949
-
1950
- <li>
1951
- Must be runnable in your environment (e.g. Ruby installed if you use <code>ruby</code>).
1952
- </li>
1953
-
1954
- </ul>
1955
-
1956
- </li>
1957
-
1958
- </ul>
1959
-
1960
- <h3 id="json-protocol">
1961
- JSON&nbsp;protocol
1962
- </h3>
1963
-
1964
- <p>
1965
- For text phases (<code>pre_parse</code>, <code>post_render</code>), Apex sends your command a JSON object on <strong>stdin</strong>:
1966
- </p>
1967
-
1968
- <div class="highlight">
1969
- <pre><span></span><span class="p">{</span>
1970
- <span class="w"> </span><span class="nt">&quot;version&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
1971
- <span class="w"> </span><span class="nt">&quot;plugin_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;kbd&quot;</span><span class="p">,</span>
1972
- <span class="w"> </span><span class="nt">&quot;phase&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;pre_parse&quot;</span><span class="p">,</span>
1973
- <span class="w"> </span><span class="nt">&quot;text&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;raw or rendered text here&quot;</span>
1974
- <span class="p">}</span>
1975
- </pre>
1976
- </div>
1977
-
1978
- <p>
1979
- Your plugin should:
1980
- </p>
1981
-
1982
- <ol>
1983
-
1984
- <li>
1985
- Read all of stdin.
1986
- </li>
1987
-
1988
- <li>
1989
- Parse the JSON.
1990
- </li>
1991
-
1992
- <li>
1993
- Transform the <code>text</code> field.
1994
- </li>
1995
-
1996
- <li>
1997
- Print the <strong>new text only</strong> to stdout (no extra JSON, headers, or logging).
1998
- </li>
1999
-
2000
- </ol>
2001
-
2002
- <p>
2003
- If your plugin fails, times out, or prints nothing, Apex will treat it as a no-op and continue gracefully.
2004
- </p>
2005
-
2006
- <hr />
2007
- <h2 id="declarative-regex-plugins-no-scripting">
2008
- Declarative regex plugins (no&nbsp;scripting)
2009
- </h2>
2010
-
2011
- <p>
2012
- For many cases, you don’t need a script at all. A <strong>declarative regex plugin</strong> uses <code>regex.h</code> inside Apex for fast in-process search/replace.
2013
- </p>
2014
-
2015
- <h3 id="manifest-fields">
2016
- Manifest&nbsp;fields
2017
- </h3>
2018
-
2019
- <div class="highlight">
2020
- <pre><span></span><span class="nn">---</span>
2021
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
2022
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Emoji span wrapper</span>
2023
- <span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
2024
- <span class="nt">description: Wrap :emoji</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">markers in a span for styling</span>
2025
- <span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin</span>
2026
- <span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin.git</span>
2027
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span>
2028
- <span class="nt">pattern</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;(:[a-zA-Z0-9_+-]+:)&quot;</span>
2029
- <span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;&lt;span</span><span class="nv"> </span><span class="s">class=\&quot;emoji\&quot;&gt;$1&lt;/span&gt;&quot;</span>
2030
- <span class="nt">flags</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;i&quot;</span><span class="w"> </span><span class="c1"># optional: e.g. i, m, s</span>
2031
- <span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">200</span>
2032
- <span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
2033
- <span class="nn">---</span>
2034
- </pre>
2035
- </div>
2036
-
2037
- <ul>
2038
-
2039
- <li>
2040
- <strong><code>pattern</code></strong>: POSIX regular expression (compiled via <code>regcomp</code>).
2041
- </li>
2042
-
2043
- <li>
2044
- <strong><code>replacement</code></strong>:
2045
- <ul>
2046
-
2047
- <li>
2048
- Replacement string with capture groups like <code>$1</code>, <code>$2</code>, etc.
2049
- </li>
2050
-
2051
- <li>
2052
- Runs repeatedly across the text until no more matches.
2053
- </li>
2054
-
2055
- </ul>
2056
-
2057
- </li>
2058
-
2059
- <li>
2060
- <strong><code>flags</code></strong> (optional):
2061
- <ul>
2062
-
2063
- <li>
2064
- Currently supports:
2065
- <ul>
2066
-
2067
- <li>
2068
- <code>i</code> – case-insensitive
2069
- </li>
2070
-
2071
- <li>
2072
- <code>m</code> – multi-line
2073
- </li>
2074
-
2075
- <li>
2076
- <code>s</code> – dot matches newline (if supported by underlying regex flavor)
2077
- </li>
2078
-
2079
- </ul>
2080
-
2081
- </li>
2082
-
2083
- </ul>
2084
-
2085
- </li>
2086
-
2087
- </ul>
2088
-
2089
- <p>
2090
- This is ideal when:
2091
- </p>
2092
-
2093
- <ul>
2094
-
2095
- <li>
2096
- You only need straightforward pattern substitution.
2097
- </li>
2098
-
2099
- <li>
2100
- Performance matters and you want to avoid <code>fork/exec</code>.
2101
- </li>
2102
-
2103
- </ul>
2104
-
2105
- <hr />
2106
- <h2 id="support-directory-and-environment-variables">
2107
- Support directory and environment&nbsp;variables
2108
- </h2>
2109
-
2110
- <p>
2111
- Plugins sometimes need a place to store <strong>cache/data files</strong> or know which file is being processed. To keep plugin code directories clean and give plugins enough context, Apex exposes a <strong>support directory</strong> and several environment variables.
2112
- </p>
2113
-
2114
- <h3 id="support-directory-apexsupportdir">
2115
- Support directory&nbsp;(<code>APEX_SUPPORT_DIR</code>)
2116
- </h3>
2117
-
2118
- <p>
2119
- Base path:
2120
- </p>
2121
-
2122
- <ul>
2123
-
2124
- <li>
2125
- If <code>$XDG_CONFIG_HOME</code> is set:
2126
- <ul>
2127
-
2128
- <li>
2129
- <code>$XDG_CONFIG_HOME/apex/support/</code>
2130
- </li>
2131
-
2132
- </ul>
2133
-
2134
- </li>
2135
-
2136
- <li>
2137
- Otherwise:
2138
- <ul>
2139
-
2140
- <li>
2141
- <code>~/.config/apex/support/</code>
2142
- </li>
2143
-
2144
- </ul>
2145
-
2146
- </li>
2147
-
2148
- </ul>
2149
-
2150
- <p>
2151
- For each plugin, Apex creates:
2152
- </p>
2153
-
2154
- <div class="highlight">
2155
- <pre><span></span>APEX_SUPPORT_DIR/&lt;plugin-id&gt;/
2156
- </pre>
2157
- </div>
2158
-
2159
- <p>
2160
- You can safely write caches, logs, or temporary files there.
2161
- </p>
2162
-
2163
- <h3 id="environment-variables-for-external-plugins">
2164
- Environment variables for external&nbsp;plugins
2165
- </h3>
2166
-
2167
- <p>
2168
- When Apex runs an external handler plugin, it sets:
2169
- </p>
2170
-
2171
- <ul>
2172
-
2173
- <li>
2174
-
2175
- <p>
2176
- <strong><code>APEX_PLUGIN_DIR</code></strong>
2177
- </p>
2178
-
2179
- <ul>
2180
-
2181
- <li>
2182
- Filesystem path to the plugin’s directory (where <code>plugin.yml</code> lives).
2183
- </li>
2184
-
2185
- <li>
2186
- Useful for loading sidecar files, templates, etc.
2187
- </li>
2188
-
2189
- </ul>
2190
-
2191
- </li>
2192
-
2193
- <li>
2194
-
2195
- <p>
2196
- <strong><code>APEX_SUPPORT_DIR</code></strong>
2197
- </p>
2198
-
2199
- <ul>
2200
-
2201
- <li>
2202
- Base support directory as described above.
2203
- </li>
2204
-
2205
- <li>
2206
- You’ll usually combine it with your plugin id, e.g. <code>$APEX_SUPPORT_DIR/kbd</code>.
2207
- </li>
2208
-
2209
- </ul>
2210
-
2211
- </li>
2212
-
2213
- <li>
2214
-
2215
- <p>
2216
- <strong><code>APEX_FILE_PATH</code></strong>
2217
- </p>
2218
-
2219
- <ul>
2220
-
2221
- <li>
2222
- When Apex is invoked on a file (for example <code>apex path/to/file.md</code>), this is the <strong>original path</strong> that was passed on the command line. Plugins can use this to make decisions based on path, directory, or extension.
2223
- </li>
2224
-
2225
- <li>
2226
- When Apex reads from stdin (for example <code>cat file.md | apex</code>), <code>APEX_FILE_PATH</code> is set to:
2227
- <ul>
2228
-
2229
- <li>
2230
- The current <code>base_directory</code> (if one was set via <code>--base-dir</code> or metadata), or
2231
- </li>
2232
-
2233
- <li>
2234
- An empty string (<code>&quot;&quot;</code>) if no base directory is known.
2235
- </li>
2236
-
2237
- </ul>
2238
-
2239
- </li>
2240
-
2241
- <li>
2242
- An empty <code>APEX_FILE_PATH</code> is a clear signal that there is no concrete source file path.
2243
- </li>
2244
-
2245
- </ul>
2246
-
2247
- </li>
2248
-
2249
- </ul>
2250
-
2251
- <p>
2252
- All of these variables apply only during the external command’s execution and are restored afterward.
2253
- </p>
2254
-
2255
- <hr />
2256
- <h2 id="installing-plugins-from-the-directory">
2257
- Installing plugins from the&nbsp;directory
2258
- </h2>
2259
-
2260
- <p>
2261
- Apex can install plugins directly from a central directory hosted in the <code>ApexMarkdown/apex-plugins</code> GitHub repository. The directory is published as a JSON file:
2262
- </p>
2263
-
2264
- <ul>
2265
-
2266
- <li>
2267
- <code>https://github.com/ApexMarkdown/apex-plugins</code> (repository)
2268
- </li>
2269
-
2270
- <li>
2271
- <code>https://raw.githubusercontent.com/ApexMarkdown/apex-plugins/refs/heads/main/apex-plugins.json</code> (JSON index)
2272
- </li>
2273
-
2274
- </ul>
2275
-
2276
- <p>
2277
- Each entry in <code>apex-plugins.json</code> looks like this:
2278
- </p>
2279
-
2280
- <div class="highlight">
2281
- <pre><span></span><span class="p">{</span>
2282
- <span class="w"> </span><span class="nt">&quot;plugins&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
2283
- <span class="w"> </span><span class="p">{</span>
2284
- <span class="w"> </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;kbd&quot;</span><span class="p">,</span>
2285
- <span class="w"> </span><span class="nt">&quot;title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Keyboard Shortcuts&quot;</span><span class="p">,</span>
2286
- <span class="w"> </span><span class="nt">&quot;description&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Renders {% kbd %} tags as &lt;kbd&gt; elements.&quot;</span><span class="p">,</span>
2287
- <span class="w"> </span><span class="nt">&quot;author&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Brett Terpstra&quot;</span><span class="p">,</span>
2288
- <span class="w"> </span><span class="nt">&quot;homepage&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://github.com/ApexMarkdown/apex-plugin-kbd&quot;</span><span class="p">,</span>
2289
- <span class="w"> </span><span class="nt">&quot;repo&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://github.com/ApexMarkdown/apex-plugin-kbd&quot;</span>
2290
- <span class="w"> </span><span class="p">}</span>
2291
- <span class="w"> </span><span class="p">]</span>
2292
- <span class="p">}</span>
2293
- </pre>
2294
- </div>
2295
-
2296
- <ul>
2297
-
2298
- <li>
2299
- <strong><code>id</code></strong> must match the plugin <code>id</code> declared in that repo’s <code>plugin.yml</code>.
2300
- </li>
2301
-
2302
- <li>
2303
- <strong><code>repo</code></strong> is the canonical Git URL that Apex will pass to <code>git clone</code>.
2304
- </li>
2305
-
2306
- <li>
2307
- <strong><code>title</code></strong>, <strong><code>author</code></strong>, <strong><code>description</code></strong>, and <strong><code>homepage</code></strong> are used for human-readable listings.
2308
- </li>
2309
-
2310
- </ul>
2311
-
2312
- <h3 id="listing-available-plugins">
2313
- Listing available&nbsp;plugins
2314
- </h3>
2315
-
2316
- <p>
2317
- To see what plugins are available in the central directory, use:
2318
- </p>
2319
-
2320
- <div class="highlight">
2321
- <pre><span></span>apex<span class="w"> </span>--list-plugins
2322
- </pre>
2323
- </div>
2324
-
2325
- <p>
2326
- This command:
2327
- </p>
2328
-
2329
- <ul>
2330
-
2331
- <li>
2332
- Fetches <code>apex-plugins.json</code> using <code>curl</code>.
2333
- </li>
2334
-
2335
- <li>
2336
- Parses the <code>plugins</code> array.
2337
- </li>
2338
-
2339
- <li>
2340
- Prints a concise listing to stdout, for example:
2341
- </li>
2342
-
2343
- </ul>
2344
-
2345
- <div class="highlight">
2346
- <pre><span></span>## Installed Plugins
2347
-
2348
- kbd - Keyboard Shortcuts (author: Brett Terpstra)
2349
- Renders {% kbd %} tags as &lt;kbd&gt; elements.
2350
- homepage: https://github.com/ApexMarkdown/apex-kbd-plugin
2351
-
2352
- ---
2353
-
2354
- ## Available Plugins
2355
-
2356
- emoji-span - Emoji span wrapper (author: Brett Terpstra)
2357
- Wrap <span class=\"emoji\">:emoji:</span> markers in a span for styling.
2358
- homepage: https://github.com/ApexMarkdown/apex-emoji-plugin
2359
- </pre>
2360
- </div>
2361
-
2362
- <h3 id="installing-a-plugin">
2363
- Installing&nbsp;a&nbsp;plugin
2364
- </h3>
2365
-
2366
- <p>
2367
- The <code>--install-plugin</code> command accepts three types of arguments:
2368
- </p>
2369
-
2370
- <ol>
2371
-
2372
- <li>
2373
-
2374
- <p>
2375
- <strong>Plugin ID from the directory</strong> (recommended for curated plugins):
2376
- </p>
2377
-
2378
- <div class="highlight">
2379
- <pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>kbd
2380
- </pre>
2381
- </div>
2382
-
2383
- <p>
2384
- This will:
2385
- </p>
2386
-
2387
- <ol>
2388
-
2389
- <li>
2390
- Fetch <code>apex-plugins.json</code> from the central directory.
2391
- </li>
2392
-
2393
- <li>
2394
- Find the entry whose <code>id</code> matches <code>kbd</code>.
2395
- </li>
2396
-
2397
- <li>
2398
- Read the <code>repo</code> field and clone the repository.
2399
- </li>
2400
-
2401
- <li>
2402
- Install into <code>$XDG_CONFIG_HOME/apex/plugins/kbd</code> or <code>~/.config/apex/plugins/kbd</code>.
2403
- </li>
2404
-
2405
- </ol>
2406
-
2407
- </li>
2408
-
2409
- <li>
2410
-
2411
- <p>
2412
- <strong>Full Git URL</strong> (for plugins not in the directory):
2413
- </p>
2414
-
2415
- <div class="highlight">
2416
- <pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>https://github.com/ttscoff/apex-plugin-kbd.git
2417
- </pre>
2418
- </div>
2419
-
2420
- <p>
2421
- Also works with SSH URLs:
2422
- </p>
2423
-
2424
- <div class="highlight">
2425
- <pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>git@github.com:ttscoff/apex-plugin-kbd.git
2426
- </pre>
2427
- </div>
2428
-
2429
- </li>
2430
-
2431
- <li>
2432
-
2433
- <p>
2434
- <strong>GitHub shorthand</strong> (<code>user/repo</code> format):
2435
- </p>
2436
-
2437
- <div class="highlight">
2438
- <pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>ttscoff/apex-plugin-kbd
2439
- </pre>
2440
- </div>
2441
-
2442
- <p>
2443
- This is automatically expanded to <code>https://github.com/ttscoff/apex-plugin-kbd.git</code>.
2444
- </p>
2445
-
2446
- </li>
2447
-
2448
- </ol>
2449
-
2450
- <h4 id="security-confirmation-for-direct-installs">
2451
- Security confirmation for direct&nbsp;installs
2452
- </h4>
2453
-
2454
- <p>
2455
- When installing from a <strong>direct Git URL or GitHub shorthand</strong> (i.e., anything outside the curated directory), Apex will prompt:
2456
- </p>
2457
-
2458
- <div class="highlight">
2459
- <pre><span></span>Apex plugins execute unverified code. Only install plugins from trusted sources.
2460
- Continue? (y/n)
2461
- </pre>
2462
- </div>
2463
-
2464
- <ul>
2465
-
2466
- <li>
2467
- Answer <code>y</code> or <code>Y</code> to proceed with the installation.
2468
- </li>
2469
-
2470
- <li>
2471
- Any other response (including <code>n</code>, <code>N</code>, or just pressing Enter) aborts the install.
2472
- </li>
2473
-
2474
- </ul>
2475
-
2476
- <p>
2477
- <strong>Directory ID installs</strong> (like <code>--install-plugin kbd</code> from the curated list) do <strong>not</strong> show this prompt, as those plugins have been reviewed and included in the central directory.
2478
- </p>
2479
-
2480
- <h4 id="installation-process">
2481
- Installation&nbsp;process
2482
- </h4>
2483
-
2484
- <p>
2485
- For all installation methods, Apex will:
2486
- </p>
2487
-
2488
- <ol>
2489
-
2490
- <li>
2491
-
2492
- <p>
2493
- Create (if necessary) the user plugin directory:
2494
- </p>
2495
-
2496
- <ul>
2497
-
2498
- <li>
2499
- <code>$XDG_CONFIG_HOME/apex/plugins</code> if <code>$XDG_CONFIG_HOME</code> is set, or
2500
- </li>
2501
-
2502
- <li>
2503
- <code>~/.config/apex/plugins</code> otherwise.
2504
- </li>
2505
-
2506
- </ul>
2507
-
2508
- </li>
2509
-
2510
- <li>
2511
-
2512
- <p>
2513
- For <strong>direct URL/shorthand installs</strong>:
2514
- </p>
2515
-
2516
- <ul>
2517
-
2518
- <li>
2519
- Clone the repository into a temporary directory.
2520
- </li>
2521
-
2522
- <li>
2523
- Read <code>plugin.yml</code> (or <code>plugin.yaml</code>) from the cloned repo to determine the plugin <code>id</code>.
2524
- </li>
2525
-
2526
- <li>
2527
- Move the cloned directory to the final location: <code>~/.config/apex/plugins/&lt;id&gt;/</code>.
2528
- </li>
2529
-
2530
- </ul>
2531
-
2532
- </li>
2533
-
2534
- <li>
2535
-
2536
- <p>
2537
- For <strong>directory ID installs</strong>:
2538
- </p>
2539
-
2540
- <ul>
2541
-
2542
- <li>
2543
- Clone directly into the final location: <code>~/.config/apex/plugins/&lt;id&gt;/</code>.
2544
- </li>
2545
-
2546
- </ul>
2547
-
2548
- </li>
2549
-
2550
- <li>
2551
-
2552
- <p>
2553
- If the target directory already exists, Apex will refuse to overwrite it and print an error. You can remove or rename the existing directory and rerun <code>--install-plugin</code> to reinstall.
2554
- </p>
2555
-
2556
- </li>
2557
-
2558
- <li>
2559
-
2560
- <p>
2561
- After successful cloning, look for a <code>post_install</code> hook in <code>plugin.yml</code> and run it if present.
2562
- </p>
2563
-
2564
- </li>
2565
-
2566
- </ol>
2567
-
2568
- <blockquote>
2569
-
2570
- <p>
2571
- <strong>Security note:</strong> Apex plugins execute unverified code. Only install plugins from trusted sources. When installing from a direct Git URL or GitHub repo name, you will be prompted to confirm before the plugin is cloned.
2572
- </p>
2573
-
2574
- </blockquote>
2575
-
2576
- <p>
2577
- Once installed, the plugin is just like any other user-global plugin:
2578
- </p>
2579
-
2580
- <ul>
2581
-
2582
- <li>
2583
- It will be discovered from <code>$XDG_CONFIG_HOME/apex/plugins</code> or <code>~/.config/apex/plugins</code>.
2584
- </li>
2585
-
2586
- <li>
2587
- You still need to enable plugins via <code>--plugins</code> or metadata (<code>plugins: true</code>).
2588
- </li>
2589
-
2590
- </ul>
2591
-
2592
- <p>
2593
- If you are authoring a plugin for inclusion in the directory:
2594
- </p>
2595
-
2596
- <ul>
2597
-
2598
- <li>
2599
- Make sure your <code>plugin.yml</code> has at least <code>id</code>, <code>phase</code>, and either <code>handler.command</code> or <code>pattern</code>/<code>replacement</code>.
2600
- </li>
2601
-
2602
- <li>
2603
- Add <code>title</code>, <code>author</code>, <code>description</code>, <code>homepage</code>, and <code>repo</code> to <code>plugin.yml</code> so directory tools and installers have complete metadata.
2604
- </li>
2605
-
2606
- <li>
2607
- Ensure the <code>plugin.yml</code> and any scripts live at the <strong>root</strong> of the Git repository referenced by <code>repo</code>.
2608
- </li>
2609
-
2610
- </ul>
2611
-
2612
- <h3 id="uninstalling-a-plugin">
2613
- Uninstalling&nbsp;a&nbsp;plugin
2614
- </h3>
2615
-
2616
- <p>
2617
- To remove a locally installed plugin, use:
2618
- </p>
2619
-
2620
- <div class="highlight">
2621
- <pre><span></span>apex<span class="w"> </span>--uninstall-plugin<span class="w"> </span>kbd
2622
- </pre>
2623
- </div>
2624
-
2625
- <p>
2626
- The <code>--uninstall-plugin</code> command:
2627
- </p>
2628
-
2629
- <ul>
2630
-
2631
- <li>
2632
- Verifies that the plugin directory exists under the user plugin path (<code>$XDG_CONFIG_HOME/apex/plugins</code> or <code>~/.config/apex/plugins</code>).
2633
- </li>
2634
-
2635
- <li>
2636
- Prompts for confirmation before deleting the plugin directory.
2637
- </li>
2638
-
2639
- <li>
2640
- Removes only the plugin’s directory; support data under <code>.../apex/support/&lt;plugin-id&gt;/</code> is left intact.
2641
- </li>
2642
-
2643
- </ul>
2644
-
2645
- <p>
2646
- This command only works for plugins installed in the user plugin directory. Project-local plugins (in <code>.apex/plugins/</code>) must be removed manually by deleting the plugin directory.
2647
- </p>
2648
-
2649
- <h2 id="share-your-plugin">
2650
- Share Your&nbsp;Plugin
2651
- </h2>
2652
-
2653
- <p>
2654
- To request that your plugin be added to the central directory:
2655
- </p>
2656
-
2657
- <ol>
2658
-
2659
- <li>
2660
- <strong>Fork</strong> the <code>ApexMarkdown/apex-plugins</code> repository on GitHub to your own account or organization.
2661
- </li>
2662
-
2663
- <li>
2664
- <strong>Clone</strong> your fork locally and create a new branch for your plugin entry (for example, <code>add-kbd-plugin</code>).
2665
- </li>
2666
-
2667
- <li>
2668
- Open the <code>apex-plugins.json</code> file in the root of your fork and add a new object to the <code>plugins</code> array with the fields:
2669
- <ul>
2670
-
2671
- <li>
2672
- <code>id</code> (matching the <code>id</code> in your plugin’s <code>plugin.yml</code>),
2673
- </li>
2674
-
2675
- <li>
2676
- <code>title</code>,
2677
- </li>
2678
-
2679
- <li>
2680
- <code>description</code>,
2681
- </li>
2682
-
2683
- <li>
2684
- <code>author</code>,
2685
- </li>
2686
-
2687
- <li>
2688
- <code>homepage</code>,
2689
- </li>
2690
-
2691
- <li>
2692
- <code>repo</code> (canonical Git URL for the plugin repo).
2693
- </li>
2694
-
2695
- </ul>
2696
-
2697
- </li>
2698
-
2699
- <li>
2700
- Commit your changes and <strong>push</strong> the branch to your fork on GitHub.
2701
- </li>
2702
-
2703
- <li>
2704
- From your fork, open a <strong>pull request</strong> against the <code>main</code> branch of <code>ApexMarkdown/apex-plugins</code>, briefly describing your plugin and confirming that the <code>id</code> and <code>repo</code> match your published plugin repository.
2705
- </li>
2706
-
2707
- <li>
2708
- Once the pull request is reviewed and merged, your plugin will show up in <code>apex --list-plugins</code> and be installable via <code>apex --install-plugin &lt;id&gt;</code>.
2709
- </li>
2710
-
2711
- </ol>
2712
-
2713
- <hr />
2714
- <h2 id="example-kbd-liquid-tag-plugin">
2715
- Example: <code>kbd</code> liquid tag plugin
2716
- </h2>
2717
-
2718
- <p>
2719
- This example shows how to support a liquid-style <code>&lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt;</code> syntax, turning key combos into <code>&lt;kbd&gt;</code> markup.
2720
- </p>
2721
-
2722
- <h3 id="directory-layout">
2723
- Directory&nbsp;layout
2724
- </h3>
2725
-
2726
- <p>
2727
- Project-local example:
2728
- </p>
2729
-
2730
- <div class="highlight">
2731
- <pre><span></span>.apex/
2732
- plugins/
2733
- kbd/
2734
- plugin.yml
2735
- kbd_plugin.rb
2736
- </pre>
2737
- </div>
2738
-
2739
- <p>
2740
- Global example:
2741
- </p>
2742
-
2743
- <div class="highlight">
2744
- <pre><span></span>~/.config/apex/plugins/
2745
- kbd/
2746
- plugin.yml
2747
- kbd_plugin.rb
2748
- </pre>
2749
- </div>
2750
-
2751
- <h3 id="pluginyml">
2752
- <code>plugin.yml</code>
2753
- </h3>
2754
-
2755
- <div class="highlight">
2756
- <pre><span></span><span class="nn">---</span>
2757
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
2758
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
2759
- <span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
2760
- <span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render &lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt; key combos to HTML &lt;kbd&gt; elements</span>
2761
- <span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin</span>
2762
- <span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin.git</span>
2763
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
2764
- <span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
2765
- <span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
2766
- <span class="nt">handler</span><span class="p">:</span>
2767
- <span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb&quot;</span>
2768
- <span class="nn">---</span>
2769
- </pre>
2770
- </div>
2771
-
2772
- <h3 id="kbdpluginrb-simplified-shape">
2773
- <code>kbd_plugin.rb</code> (simplified shape)
2774
- </h3>
2775
-
2776
- <p>
2777
- The full script lives in the <code>examples</code> directory of the Apex repo as a reference. Conceptually, it:
2778
- </p>
2779
-
2780
- <ul>
2781
-
2782
- <li>
2783
- Reads JSON from stdin.
2784
- </li>
2785
-
2786
- <li>
2787
- Extracts <code>text</code>.
2788
- </li>
2789
-
2790
- <li>
2791
- Replaces each <code>&lt;span class=&quot;keycombo combined&quot; title=&quot;...&quot;&gt;&lt;kbd class=&quot;key symbol&quot;&gt;...&lt;/kbd&gt;&lt;/span&gt;</code> occurrence with properly formatted <code>&lt;kbd&gt;</code> HTML.
2792
- </li>
2793
-
2794
- <li>
2795
- Prints the full transformed text to stdout.
2796
- </li>
2797
-
2798
- </ul>
2799
-
2800
- <p>
2801
- A very abridged sketch:
2802
- </p>
2803
-
2804
- <div class="highlight">
2805
- <pre><span></span><span class="ch">#!/usr/bin/env ruby</span>
2806
- <span class="nb">require</span><span class="w"> </span><span class="s2">&quot;json&quot;</span>
2807
-
2808
- <span class="n">payload</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">JSON</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="vg">$stdin</span><span class="o">.</span><span class="n">read</span><span class="p">)</span>
2809
- <span class="n">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">payload</span><span class="o">[</span><span class="s2">&quot;text&quot;</span><span class="o">]</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="s2">&quot;&quot;</span>
2810
-
2811
- <span class="c1"># ... helper methods for normalizing modifier names, etc. ...</span>
2812
-
2813
- <span class="k">def</span><span class="w"> </span><span class="nf">render_kbd</span><span class="p">(</span><span class="n">markup</span><span class="p">)</span>
2814
- <span class="w"> </span><span class="c1"># convert markup like &quot;^~@r&quot; to HTML</span>
2815
- <span class="w"> </span><span class="c1"># returning something like:</span>
2816
- <span class="w"> </span><span class="c1"># &lt;kbd&gt;⌃&lt;/kbd&gt;+&lt;kbd&gt;⌥&lt;/kbd&gt;+&lt;kbd&gt;⌘&lt;/kbd&gt;+&lt;kbd&gt;R&lt;/kbd&gt;</span>
2817
- <span class="k">end</span>
2818
-
2819
- <span class="n">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">text</span><span class="o">.</span><span class="n">gsub</span><span class="p">(</span><span class="sr">/\{%\s*kbd\s+([^%]+)%\}/</span><span class="p">)</span><span class="w"> </span><span class="k">do</span>
2820
- <span class="w"> </span><span class="n">render_kbd</span><span class="p">(</span><span class="no">Regexp</span><span class="o">.</span><span class="n">last_match</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
2821
- <span class="k">end</span>
2822
-
2823
- <span class="nb">print</span><span class="w"> </span><span class="n">result</span>
2824
- </pre>
2825
- </div>
2826
-
2827
- <p>
2828
- You can customize this script as you like; the only requirement is that it obey the stdin JSON / stdout contract.
2829
- </p>
2830
-
2831
- <hr />
2832
- <h2 id="example-emoji-span-plugin-declarative">
2833
- Example: <code><span class=\"emoji\">:emoji:</span></code> span plugin (declarative)
2834
- </h2>
2835
-
2836
- <p>
2837
- This plugin turns <code><span class=\"emoji\">:emoji:</span></code> tokens in the final HTML into <code>&lt;span class=&quot;emoji&quot;&gt;<span class=\"emoji\">:emoji:</span>&lt;/span&gt;</code>.
2838
- </p>
2839
-
2840
- <h3 id="directory-layout">
2841
- Directory&nbsp;layout
2842
- </h3>
2843
-
2844
- <div class="highlight">
2845
- <pre><span></span>~/.config/apex/plugins/
2846
- emoji/
2847
- plugin.yml
2848
- </pre>
2849
- </div>
2850
-
2851
- <h3 id="pluginyml">
2852
- <code>plugin.yml</code>
2853
- </h3>
2854
-
2855
- <div class="highlight">
2856
- <pre><span></span><span class="nn">---</span>
2857
- <span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
2858
- <span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Emoji span wrapper</span>
2859
- <span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
2860
- <span class="nt">description: Wrap :emoji</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">markers in a span for styling</span>
2861
- <span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin</span>
2862
- <span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin.git</span>
2863
- <span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span>
2864
- <span class="nt">pattern</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;(:[a-zA-Z0-9_+-]+:)&quot;</span>
2865
- <span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;&lt;span</span><span class="nv"> </span><span class="s">class=\&quot;emoji\&quot;&gt;$1&lt;/span&gt;&quot;</span>
2866
- <span class="nt">flags</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;i&quot;</span>
2867
- <span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">200</span>
2868
- <span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
2869
- <span class="nn">---</span>
2870
- </pre>
2871
- </div>
2872
-
2873
- <p>
2874
- Because this is a declarative plugin, <strong>no external command is run</strong>. Apex compiles the regex and runs the replacements internally.
2875
- </p>
2876
-
2877
- <hr />
2878
- <h2 id="putting-it-all-together">
2879
- Putting it all&nbsp;together
2880
- </h2>
2881
-
2882
- <p>
2883
- A typical workflow:
2884
- </p>
2885
-
2886
- <ol>
2887
-
2888
- <li>
2889
-
2890
- <p>
2891
- <strong>Create a plugin directory</strong>
2892
- </p>
2893
-
2894
- <ul>
2895
-
2896
- <li>
2897
- Project-local: <code>.apex/plugins/my-plugin/</code>
2898
- </li>
2899
-
2900
- <li>
2901
- Or global: <code>~/.config/apex/plugins/my-plugin/</code>
2902
- </li>
2903
-
2904
- </ul>
2905
-
2906
- </li>
2907
-
2908
- <li>
2909
-
2910
- <p>
2911
- <strong>Add <code>plugin.yml</code></strong>
2912
- </p>
2913
-
2914
- <ul>
2915
-
2916
- <li>
2917
- Choose <code>phase</code> (<code>pre_parse</code> or <code>post_render</code>).
2918
- </li>
2919
-
2920
- <li>
2921
- Choose plugin type:
2922
- <ul>
2923
-
2924
- <li>
2925
- External: add <code>handler.command</code>.
2926
- </li>
2927
-
2928
- <li>
2929
- Declarative: add <code>pattern</code>, <code>replacement</code>, and optional <code>flags</code>.
2930
- </li>
2931
-
2932
- </ul>
2933
-
2934
- </li>
2935
-
2936
- <li>
2937
- Optionally, add metadata fields (<code>title</code>, <code>author</code>, <code>description</code>, <code>homepage</code>, <code>repo</code>) so your plugin shows up nicely in directories and can be auto-installed.
2938
- </li>
2939
-
2940
- <li>
2941
- For bundles, use <code>bundle:</code> to define multiple related child plugins in one manifest.
2942
- </li>
2943
-
2944
- </ul>
2945
-
2946
- </li>
2947
-
2948
- <li>
2949
-
2950
- <p>
2951
- <strong>Add code (if external)</strong>
2952
- </p>
2953
-
2954
- <ul>
2955
-
2956
- <li>
2957
- Put your script alongside <code>plugin.yml</code>.
2958
- </li>
2959
-
2960
- <li>
2961
- Implement the JSON stdin → text stdout contract.
2962
- </li>
2963
-
2964
- </ul>
2965
-
2966
- </li>
2967
-
2968
- <li>
2969
-
2970
- <p>
2971
- <strong>Enable plugins</strong>
2972
- </p>
2973
-
2974
- <ul>
2975
-
2976
- <li>
2977
- Either:
2978
- <ul>
2979
-
2980
- <li>
2981
- Add <code>plugins: true</code> (or <code>enable-plugins: true</code>) to your document metadata, <strong>or</strong>
2982
- </li>
2983
-
2984
- <li>
2985
- Run with <code>--plugins</code> on the command line.
2986
- </li>
2987
-
2988
- </ul>
2989
-
2990
- </li>
2991
-
2992
- </ul>
2993
-
2994
- </li>
2995
-
2996
- <li>
2997
-
2998
- <p>
2999
- <strong>Test</strong>
3000
- </p>
3001
-
3002
- <ul>
3003
-
3004
- <li>
3005
- Run Apex on a sample document that exercises your plugin syntax.
3006
- </li>
3007
-
3008
- <li>
3009
- If something goes wrong, log to a file under <code>$APEX_SUPPORT_DIR/&lt;id&gt;/</code> rather than printing debugging output to stdout.
3010
- </li>
3011
-
3012
- </ul>
3013
-
3014
- </li>
3015
-
3016
- </ol>
3017
-
3018
- <p>
3019
- Once you’re comfortable, you can share the <code>plugin.yml</code> plus any scripts with others; they just need to drop the directory into their <code>.apex/plugins/</code> or <code>~/.config/apex/plugins/</code> and enable plugins as needed.
3020
- </p>
3021
-
3022
- <script>
3023
- // Hamburger menu functionality
3024
- (function() {
3025
- function initHamburgerMenu() {
3026
- var hamburger = document.getElementById('hamburger-menu');
3027
- var sidebar = document.querySelector('.main-toc, .sidebar');
3028
- var overlay = document.getElementById('mobile-menu-overlay');
3029
-
3030
- if (!hamburger || !sidebar) return;
3031
-
3032
- function toggleMenu() {
3033
- var isOpen = sidebar.classList.contains('mobile-open');
3034
- if (isOpen) {
3035
- sidebar.classList.remove('mobile-open');
3036
- hamburger.classList.remove('active');
3037
- if (overlay) overlay.classList.remove('active');
3038
- } else {
3039
- sidebar.classList.add('mobile-open');
3040
- hamburger.classList.add('active');
3041
- if (overlay) overlay.classList.add('active');
3042
- }
3043
- }
3044
-
3045
- hamburger.addEventListener('click', function(e) {
3046
- e.stopPropagation();
3047
- toggleMenu();
3048
- });
3049
-
3050
- if (overlay) {
3051
- overlay.addEventListener('click', function() {
3052
- toggleMenu();
3053
- });
3054
- }
3055
-
3056
- // Close menu when clicking on a sidebar link (mobile only)
3057
- if (window.innerWidth <= 768) {
3058
- var sidebarLinks = sidebar.querySelectorAll('a');
3059
- sidebarLinks.forEach(function(link) {
3060
- link.addEventListener('click', function() {
3061
- setTimeout(function() {
3062
- sidebar.classList.remove('mobile-open');
3063
- hamburger.classList.remove('active');
3064
- if (overlay) overlay.classList.remove('active');
3065
- }, 100);
3066
- });
3067
- });
3068
- }
3069
-
3070
- // Close menu on window resize if going to desktop
3071
- window.addEventListener('resize', function() {
3072
- if (window.innerWidth > 768) {
3073
- sidebar.classList.remove('mobile-open');
3074
- hamburger.classList.remove('active');
3075
- if (overlay) overlay.classList.remove('active');
3076
- }
3077
- });
3078
- }
3079
-
3080
- // Initialize when DOM is ready
3081
- if (document.readyState === 'loading') {
3082
- document.addEventListener('DOMContentLoaded', initHamburgerMenu);
3083
- } else {
3084
- initHamburgerMenu();
3085
- }
3086
- })();
3087
-
3088
- </script>
3089
- <script>
3090
- (function() {
3091
- // Clone the page TOC for floating TOC
3092
- function initFloatingTOC() {
3093
- var pageTOC = document.getElementById('page-toc-top');
3094
- var floatingTOCContent = document.getElementById('floating-toc-content');
3095
- var floatingTOC = document.getElementById('floating-toc');
3096
-
3097
- if (!pageTOC || !floatingTOCContent || !floatingTOC) return;
3098
-
3099
- // Clone the TOC structure
3100
- var tocClone = pageTOC.cloneNode(true);
3101
- tocClone.id = 'floating-toc-clone';
3102
- floatingTOCContent.appendChild(tocClone);
3103
-
3104
- // Update all links to use smooth scrolling
3105
- var allTOCLinks = document.querySelectorAll('.page-toc a, .floating-toc-content a');
3106
- allTOCLinks.forEach(function(link) {
3107
- link.addEventListener('click', function(e) {
3108
- var href = this.getAttribute('href');
3109
- if (href && href.startsWith('#')) {
3110
- e.preventDefault();
3111
- var targetId = href.substring(1);
3112
- var targetElement = document.getElementById(targetId);
3113
- if (targetElement) {
3114
- var offset = 20; // Offset from top
3115
-
3116
- // Function to calculate absolute position from document top
3117
- function getAbsoluteTop(element) {
3118
- var top = 0;
3119
- while (element) {
3120
- top += element.offsetTop;
3121
- element = element.offsetParent;
3122
- }
3123
- return top;
3124
- }
3125
-
3126
- var absoluteTop = getAbsoluteTop(targetElement);
3127
- var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
3128
- var offsetPosition = absoluteTop - offset;
3129
-
3130
- // Only scroll if we're not already at the target position
3131
- if (Math.abs(scrollTop - offsetPosition) > 10) {
3132
- window.scrollTo({
3133
- top: Math.max(0, offsetPosition),
3134
- behavior: 'smooth'
3135
- });
3136
- }
3137
-
3138
- // Update URL hash without triggering scroll
3139
- if (history.pushState) {
3140
- history.pushState(null, null, href);
3141
- }
3142
- }
3143
- }
3144
- });
3145
- });
3146
-
3147
- // Handle scroll to show/hide floating TOC
3148
- var tocTop = pageTOC.getBoundingClientRect().top + window.pageYOffset;
3149
- var tocBottom = tocTop + pageTOC.offsetHeight;
3150
-
3151
- function updateFloatingTOC() {
3152
- var scrollY = window.pageYOffset || document.documentElement.scrollTop;
3153
-
3154
- if (scrollY > tocBottom) {
3155
- floatingTOC.classList.add('visible');
3156
- } else {
3157
- floatingTOC.classList.remove('visible');
3158
- }
3159
- }
3160
-
3161
- // Throttle scroll events
3162
- var ticking = false;
3163
- window.addEventListener('scroll', function() {
3164
- if (!ticking) {
3165
- window.requestAnimationFrame(function() {
3166
- updateFloatingTOC();
3167
- ticking = false;
3168
- });
3169
- ticking = true;
3170
- }
3171
- });
3172
-
3173
- // Initial check
3174
- updateFloatingTOC();
3175
- }
3176
-
3177
- // Initialize when DOM is ready
3178
- if (document.readyState === 'loading') {
3179
- document.addEventListener('DOMContentLoaded', initFloatingTOC);
3180
- } else {
3181
- initFloatingTOC();
3182
- }
3183
- })();
3184
- </script>
3185
- <footer class="page-footer"><p>Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License</p></footer></body>
3186
-
3187
- </html>
3188
-