apex-ruby 1.0.18 → 1.0.20

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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -3
  3. data/ext/apex_ext/apex_ext.c +260 -91
  4. data/ext/apex_ext/apex_src/CHANGELOG.md +440 -0
  5. data/ext/apex_ext/apex_src/CMakeLists.txt +15 -1
  6. data/ext/apex_ext/apex_src/Formula/apex.rb +7 -2
  7. data/ext/apex_ext/apex_src/Package.swift +15 -4
  8. data/ext/apex_ext/apex_src/README.md +94 -35
  9. data/ext/apex_ext/apex_src/VERSION +1 -1
  10. data/ext/apex_ext/apex_src/apex-debug.log +4 -0
  11. data/ext/apex_ext/apex_src/apex.code-workspace +38 -0
  12. data/ext/apex_ext/apex_src/apex.taskpaper +12 -0
  13. data/ext/apex_ext/apex_src/apex_deflist_debug.log +25 -0
  14. data/ext/apex_ext/apex_src/buildnotes.md +1435 -0
  15. data/ext/apex_ext/apex_src/cli/main.c +262 -33
  16. data/ext/apex_ext/apex_src/debug.log +7 -0
  17. data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +274 -0
  18. data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +749 -0
  19. data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +744 -0
  20. data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +382 -0
  21. data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +351 -0
  22. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +745 -0
  23. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +829 -0
  24. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +1148 -0
  25. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +161 -0
  26. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +184 -0
  27. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +211 -0
  28. data/ext/apex_ext/apex_src/documentation/app-settings-table.md +67 -0
  29. data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +340 -0
  30. data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +11 -0
  31. data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +234 -0
  32. data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +516 -0
  33. data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +461 -0
  34. data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +193 -0
  35. data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +201 -0
  36. data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +678 -0
  37. data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +1367 -0
  38. data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +6 -0
  39. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +774 -300
  40. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +1194 -0
  41. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +416 -216
  42. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3544 -1094
  43. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +371 -97
  44. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +153 -23
  45. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +358 -124
  46. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +1656 -0
  47. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +1226 -0
  48. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +201 -56
  49. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +279 -109
  50. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +200 -53
  51. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +2327 -0
  52. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +690 -271
  53. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +201 -55
  54. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +238 -68
  55. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +421 -221
  56. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +340 -78
  57. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +251 -86
  58. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +1362 -0
  59. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +277 -90
  60. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +673 -346
  61. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +1405 -0
  62. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +1902 -0
  63. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +1939 -1698
  64. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +1781 -0
  65. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +315 -140
  66. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +307 -113
  67. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +1132 -0
  68. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +1754 -0
  69. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +872 -376
  70. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
  71. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  72. data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +8746 -0
  73. data/ext/apex_ext/apex_src/documentation/shared_styles.css +20 -15
  74. data/ext/apex_ext/apex_src/documentation/transform_for_app.md +55 -0
  75. data/ext/apex_ext/apex_src/escaping-repro.md +103 -0
  76. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +8 -0
  77. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
  78. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +547 -0
  79. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
  80. data/ext/apex_ext/apex_src/examples/quick-actions/README.md +33 -0
  81. data/ext/apex_ext/apex_src/include/apex/apex.h +92 -6
  82. data/ext/apex_ext/apex_src/include/apex/ast_rtf.h +23 -0
  83. data/ext/apex_ext/apex_src/include/apex/ast_terminal.h +6 -0
  84. data/ext/apex_ext/apex_src/include/apex/module.modulemap +5 -0
  85. data/ext/apex_ext/apex_src/include/apex/plugins.h +105 -0
  86. data/ext/apex_ext/apex_src/include/apexc.h +1 -0
  87. data/ext/apex_ext/apex_src/man/apex.1 +82 -78
  88. data/ext/apex_ext/apex_src/man/apex.1.md +81 -4
  89. data/ext/apex_ext/apex_src/objc/Apex.swift +73 -0
  90. data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +79 -0
  91. data/ext/apex_ext/apex_src/objc/NSString+Apex.h +83 -5
  92. data/ext/apex_ext/apex_src/objc/NSString+Apex.m +244 -1
  93. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +76 -0
  94. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +169 -0
  95. data/ext/apex_ext/apex_src/output.html +87 -0
  96. data/ext/apex_ext/apex_src/plans/quarto-mode.md +442 -0
  97. data/ext/apex_ext/apex_src/src/_README.md +85 -32
  98. data/ext/apex_ext/apex_src/src/apex.c +770 -200
  99. data/ext/apex_ext/apex_src/src/ast_rtf.c +848 -0
  100. data/ext/apex_ext/apex_src/src/ast_terminal.c +184 -7
  101. data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +10 -3
  102. data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +7 -11
  103. data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.c +467 -0
  104. data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.h +27 -0
  105. data/ext/apex_ext/apex_src/src/extensions/callouts.c +400 -4
  106. data/ext/apex_ext/apex_src/src/extensions/callouts.h +15 -5
  107. data/ext/apex_ext/apex_src/src/extensions/citations.c +26 -5
  108. data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.c +632 -0
  109. data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.h +22 -0
  110. data/ext/apex_ext/apex_src/src/extensions/concordance.c +632 -0
  111. data/ext/apex_ext/apex_src/src/extensions/definition_list.c +129 -15
  112. data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1050 -121
  113. data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +569 -16
  114. data/ext/apex_ext/apex_src/src/extensions/ial.c +502 -52
  115. data/ext/apex_ext/apex_src/src/extensions/ial.h +2 -1
  116. data/ext/apex_ext/apex_src/src/extensions/includes.c +532 -33
  117. data/ext/apex_ext/apex_src/src/extensions/includes.h +7 -1
  118. data/ext/apex_ext/apex_src/src/extensions/index.c +1427 -140
  119. data/ext/apex_ext/apex_src/src/extensions/index.h +28 -0
  120. data/ext/apex_ext/apex_src/src/extensions/metadata.c +200 -161
  121. data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.c +251 -0
  122. data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.h +22 -0
  123. data/ext/apex_ext/apex_src/src/extensions/quarto_lists.c +624 -0
  124. data/ext/apex_ext/apex_src/src/extensions/quarto_lists.h +35 -0
  125. data/ext/apex_ext/apex_src/src/extensions/quarto_polish.c +264 -0
  126. data/ext/apex_ext/apex_src/src/extensions/quarto_polish.h +23 -0
  127. data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.c +307 -0
  128. data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.h +21 -0
  129. data/ext/apex_ext/apex_src/src/extensions/raw_content.c +351 -0
  130. data/ext/apex_ext/apex_src/src/extensions/raw_content.h +20 -0
  131. data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +117 -3
  132. data/ext/apex_ext/apex_src/src/extensions/special_markers.c +53 -0
  133. data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +23 -1
  134. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +83 -92
  135. data/ext/apex_ext/apex_src/src/extensions/toc.c +446 -25
  136. data/ext/apex_ext/apex_src/src/extensions/toc.h +26 -1
  137. data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +28 -0
  138. data/ext/apex_ext/apex_src/src/html_renderer.c +387 -17
  139. data/ext/apex_ext/apex_src/src/plugin_catalog.c +517 -0
  140. data/ext/apex_ext/apex_src/src/plugins_remote.c +88 -14
  141. data/ext/apex_ext/apex_src/src/plugins_remote.h +34 -0
  142. data/ext/apex_ext/apex_src/src/pretty_html.c +6 -1
  143. data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +21 -0
  144. data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +10 -0
  145. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +19 -0
  146. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +11 -0
  147. data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +2 -0
  148. data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +46 -0
  149. data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +5 -0
  150. data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +47 -0
  151. data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +3 -0
  152. data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +3 -0
  153. data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +8 -0
  154. data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +19 -0
  155. data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +5 -0
  156. data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +7 -0
  157. data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +81 -0
  158. data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +5 -0
  159. data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +47 -0
  160. data/ext/apex_ext/apex_src/tests/fixtures/speed.md +192 -0
  161. data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +37 -0
  162. data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +16 -0
  163. data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +301 -0
  164. data/ext/apex_ext/apex_src/tests/test_concordance.tsv +4 -0
  165. data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +82 -0
  166. data/ext/apex_ext/apex_src/tests/test_extensions.c +821 -1
  167. data/ext/apex_ext/apex_src/tests/test_ial.c +7 -0
  168. data/ext/apex_ext/apex_src/tests/test_marked_integration.c +25 -0
  169. data/ext/apex_ext/apex_src/tests/test_metadata.c +129 -0
  170. data/ext/apex_ext/apex_src/tests/test_output.c +568 -2
  171. data/ext/apex_ext/apex_src/tests/test_runner.c +11 -0
  172. data/ext/apex_ext/apex_src/tests/test_tables.c +420 -0
  173. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +1 -1
  174. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +77 -1
  175. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +135 -5
  176. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +56 -1
  177. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +38 -0
  178. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +1 -1
  179. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
  180. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
  181. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +69 -0
  182. data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +74 -0
  183. data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +22 -0
  184. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
  185. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +44 -0
  186. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +128 -0
  187. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +5118 -0
  188. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  189. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  190. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +8 -0
  191. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +99 -0
  192. data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +452 -0
  193. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +52 -0
  194. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +55 -0
  195. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +2455 -0
  196. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  197. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +171 -0
  198. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +55 -0
  199. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +220 -0
  200. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +43 -0
  201. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +7 -0
  202. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +76 -0
  203. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +10 -0
  204. data/ext/apex_ext/extconf.rb +35 -0
  205. data/lib/apex/version.rb +2 -2
  206. metadata +117 -2
  207. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
@@ -0,0 +1,461 @@
1
+ # Metadata Transforms
2
+
3
+ Metadata transforms allow you to modify metadata values using the `[%key:transform]` syntax. Transforms can be chained together, and many accept optional parameters.
4
+
5
+ ## Metadata Sources
6
+
7
+ Metadata can come from three sources (merged in priority order):
8
+
9
+ 1. **Document**: Metadata embedded in the document (YAML, MMD, or Pandoc format)
10
+ 2. **External file**: Select a metadata file in **Settings->Processor->Metadata File**, or specify a file in document metadata
11
+ 3. **Document metadata**: Metadata specified in the document's front matter
12
+
13
+ You can create reusable metadata files for common settings like language and quotes language. This is especially useful for maintaining consistent settings across multiple documents.
14
+
15
+ ## Basic Usage
16
+
17
+ The basic syntax is `[%key:transform]` where `key` is a metadata key and `transform` is one of the available transforms:
18
+
19
+ ```markdown
20
+ ---
21
+ title: hello world
22
+ ---
23
+
24
+ # [%title:upper]
25
+ <!-- Outputs: # HELLO WORLD -->
26
+ ```
27
+
28
+ Transforms can be chained using colons:
29
+
30
+ ```markdown
31
+ ---
32
+ title: hello world
33
+ ---
34
+
35
+ # [%title:title:split( ):first]
36
+ <!-- Outputs: # Hello -->
37
+ ```
38
+
39
+ ## Enabling Transforms
40
+
41
+ Metadata transforms are **enabled by default in unified mode**. For other modes, enable them in **Settings->Processor->Metadata Transforms**. You can disable transforms (even in unified mode) by unchecking this setting.
42
+
43
+ ## Case Transforms
44
+
45
+ ### `upper`
46
+ Converts the value to uppercase.
47
+
48
+ ```markdown
49
+ ---
50
+ title: hello world
51
+ ---
52
+
53
+ [%title:upper]
54
+ <!-- Outputs: HELLO WORLD -->
55
+ ```
56
+
57
+ ### `lower`
58
+ Converts the value to lowercase.
59
+
60
+ ```markdown
61
+ ---
62
+ title: HELLO WORLD
63
+ ---
64
+
65
+ [%title:lower]
66
+ <!-- Outputs: hello world -->
67
+ ```
68
+
69
+ ### `title`
70
+ Converts the value to title case (capitalizes first letter of each word).
71
+
72
+ ```markdown
73
+ ---
74
+ title: hello world
75
+ ---
76
+
77
+ [%title:title]
78
+ <!-- Outputs: Hello World -->
79
+ ```
80
+
81
+ ### `capitalize`
82
+ Capitalizes only the first letter of the value.
83
+
84
+ ```markdown
85
+ ---
86
+ title: hello world
87
+ ---
88
+
89
+ [%title:capitalize]
90
+ <!-- Outputs: Hello world -->
91
+ ```
92
+
93
+ ## String Manipulation
94
+
95
+ ### `trim`
96
+ Removes leading and trailing whitespace.
97
+
98
+ ```markdown
99
+ ---
100
+ title: " hello world "
101
+ ---
102
+
103
+ [%title:trim]
104
+ <!-- Outputs: hello world -->
105
+ ```
106
+
107
+ ### `slug` / `slugify`
108
+ Converts the value to a URL-friendly slug (lowercase, spaces and special characters replaced with hyphens).
109
+
110
+ ```markdown
111
+ ---
112
+ title: My Great Post!
113
+ ---
114
+
115
+ [%title:slug]
116
+ <!-- Outputs: my-great-post -->
117
+ ```
118
+
119
+ ### `replace(OLD,NEW)` / `replace(regex:PATTERN,REPLACEMENT)`
120
+ Replaces occurrences of `OLD` with `NEW`. Supports both simple string replacement and regex patterns.
121
+
122
+ ```markdown
123
+ ---
124
+ url: http://example.com
125
+ ---
126
+
127
+ [%url:replace(http:,https:)]
128
+ <!-- Outputs: https://example.com -->
129
+ ```
130
+
131
+ **Regex replacement:**
132
+ ```markdown
133
+ ---
134
+ text: Hello 123 World
135
+ ---
136
+
137
+ [%text:replace(regex:[0-9]+,N)]
138
+ <!-- Outputs: Hello N World -->
139
+ ```
140
+
141
+ ### `substring(START,END)` / `substr(START,END)`
142
+ Extracts a substring. Supports negative indices (from end).
143
+
144
+ ```markdown
145
+ ---
146
+ title: Hello World
147
+ ---
148
+
149
+ [%title:substr(0,5)]
150
+ <!-- Outputs: Hello -->
151
+
152
+ [%title:substr(-5)]
153
+ <!-- Outputs: World (last 5 characters) -->
154
+ ```
155
+
156
+ ### `truncate(LENGTH,SUFFIX)`
157
+ Truncates the value to the specified length, optionally appending a suffix.
158
+
159
+ ```markdown
160
+ ---
161
+ title: This is a very long title
162
+ ---
163
+
164
+ [%title:truncate(15,...)]
165
+ <!-- Outputs: This is a very... -->
166
+ ```
167
+
168
+ ### `reverse`
169
+ Reverses the order of characters in the value.
170
+
171
+ ```markdown
172
+ ---
173
+ text: Hello
174
+ ---
175
+
176
+ [%text:reverse]
177
+ <!-- Outputs: olleH -->
178
+ ```
179
+
180
+ ## Array Transforms
181
+
182
+ ### `split(DELIMITER)`
183
+ Splits a string into an array using the specified delimiter (default: space).
184
+
185
+ ```markdown
186
+ ---
187
+ tags: tag1,tag2,tag3
188
+ ---
189
+
190
+ [%tags:split(,)]
191
+ <!-- Outputs: tag1 (first element as representation) -->
192
+ <!-- Use with :first, :last, :slice, or :join to work with the array -->
193
+ ```
194
+
195
+ ### `join(DELIMITER)`
196
+ Joins an array into a string using the specified delimiter.
197
+
198
+ ```markdown
199
+ ---
200
+ tags: tag1,tag2,tag3
201
+ ---
202
+
203
+ [%tags:split(,):join( | )]
204
+ <!-- Outputs: tag1 | tag2 | tag3 -->
205
+ ```
206
+
207
+ ### `first`
208
+ Returns the first element of an array.
209
+
210
+ ```markdown
211
+ ---
212
+ tags: tag1,tag2,tag3
213
+ ---
214
+
215
+ [%tags:split(,):first]
216
+ <!-- Outputs: tag1 -->
217
+ ```
218
+
219
+ ### `last`
220
+ Returns the last element of an array.
221
+
222
+ ```markdown
223
+ ---
224
+ tags: tag1,tag2,tag3
225
+ ---
226
+
227
+ [%tags:split(,):last]
228
+ <!-- Outputs: tag3 -->
229
+ ```
230
+
231
+ ### `slice(START,LENGTH)`
232
+ Extracts a slice from an array. If applied to a non-array value, splits the string into individual characters.
233
+
234
+ ```markdown
235
+ ---
236
+ tags: tag1,tag2,tag3
237
+ ---
238
+
239
+ [%tags:split(,):slice(0,2):join(,)]
240
+ <!-- Outputs: tag1,tag2 -->
241
+
242
+ ---
243
+ text: Hello
244
+ ---
245
+
246
+ [%text:slice(0,5)]
247
+ <!-- Outputs: Hello (characters 0-5) -->
248
+ ```
249
+
250
+ ## Utility Transforms
251
+
252
+ ### `default(VALUE)`
253
+ Returns the specified default value if the metadata value is empty.
254
+
255
+ ```markdown
256
+ ---
257
+ desc: ""
258
+ ---
259
+
260
+ [%desc:default(No description)]
261
+ <!-- Outputs: No description -->
262
+ ```
263
+
264
+ ### `escape` / `html_escape`
265
+ Escapes HTML special characters (`&`, `<`, `>`, `"`, `'`).
266
+
267
+ ```markdown
268
+ ---
269
+ title: A & B
270
+ ---
271
+
272
+ [%title:html_escape]
273
+ <!-- Outputs: A &amp; B -->
274
+ ```
275
+
276
+ ### `basename`
277
+ Extracts the filename from a path.
278
+
279
+ ```markdown
280
+ ---
281
+ image: /path/to/image.jpg
282
+ ---
283
+
284
+ [%image:basename]
285
+ <!-- Outputs: image.jpg -->
286
+ ```
287
+
288
+ ### `urlencode`
289
+ URL-encodes the value.
290
+
291
+ ```markdown
292
+ ---
293
+ search: hello world
294
+ ---
295
+
296
+ [%search:urlencode]
297
+ <!-- Outputs: hello%20world -->
298
+ ```
299
+
300
+ ### `urldecode`
301
+ URL-decodes the value.
302
+
303
+ ```markdown
304
+ ---
305
+ search: hello%20world
306
+ ---
307
+
308
+ [%search:urldecode]
309
+ <!-- Outputs: hello world -->
310
+ ```
311
+
312
+ ### `prefix(VALUE)`
313
+ Adds a prefix to the value.
314
+
315
+ ```markdown
316
+ ---
317
+ url: example.com
318
+ ---
319
+
320
+ [%url:prefix(https://)]
321
+ <!-- Outputs: https://example.com -->
322
+ ```
323
+
324
+ ### `suffix(VALUE)`
325
+ Adds a suffix to the value.
326
+
327
+ ```markdown
328
+ ---
329
+ title: Hello
330
+ ---
331
+
332
+ [%title:suffix(!)]
333
+ <!-- Outputs: Hello! -->
334
+ ```
335
+
336
+ ### `remove(STRING)`
337
+ Removes all occurrences of the specified string.
338
+
339
+ ```markdown
340
+ ---
341
+ title: Hello'World
342
+ ---
343
+
344
+ [%title:remove(')]
345
+ <!-- Outputs: HelloWorld -->
346
+ ```
347
+
348
+ ### `repeat(COUNT)`
349
+ Repeats the value the specified number of times.
350
+
351
+ ```markdown
352
+ ---
353
+ sep: -
354
+ ---
355
+
356
+ [%sep:repeat(3)]
357
+ <!-- Outputs: --- -->
358
+ ```
359
+
360
+ ## Formatting Transforms
361
+
362
+ ### `format(FORMAT_STRING)`
363
+ Formats a numeric value using `sprintf`-style formatting.
364
+
365
+ ```markdown
366
+ ---
367
+ price: 42.5
368
+ ---
369
+
370
+ [%price:format($%.2f)]
371
+ <!-- Outputs: $42.50 -->
372
+ ```
373
+
374
+ ### `length`
375
+ Returns the length of the value as a string.
376
+
377
+ ```markdown
378
+ ---
379
+ text: Hello
380
+ ---
381
+
382
+ [%text:length]
383
+ <!-- Outputs: 5 -->
384
+ ```
385
+
386
+ ### `pad(WIDTH,CHAR)`
387
+ Pads the value to the specified width with the specified character (default: space).
388
+
389
+ ```markdown
390
+ ---
391
+ number: 42
392
+ ---
393
+
394
+ [%number:pad(5,0)]
395
+ <!-- Outputs: 00042 -->
396
+ ```
397
+
398
+ ### `contains(STRING)`
399
+ Returns `"true"` if the value contains the specified string, `"false"` otherwise.
400
+
401
+ ```markdown
402
+ ---
403
+ tags: javascript,html,css
404
+ ---
405
+
406
+ [%tags:contains(javascript)]
407
+ <!-- Outputs: true -->
408
+ ```
409
+
410
+ ## Date/Time Transforms
411
+
412
+ ### `strftime(FORMAT)`
413
+ Formats a date using `strftime`-style format strings. Parses dates in formats like `YYYY-MM-DD`, `YYYY-MM-DD HH:MM`, or `YYYY-MM-DD HH:MM:SS`.
414
+
415
+ ```markdown
416
+ ---
417
+ date: 2024-03-15
418
+ ---
419
+
420
+ [%date:strftime(%Y)]
421
+ <!-- Outputs: 2024 -->
422
+
423
+ [%date:strftime(%B %d, %Y)]
424
+ <!-- Outputs: March 15, 2024 -->
425
+ ```
426
+
427
+ ## Transform Chaining
428
+
429
+ Multiple transforms can be chained together using colons. Each transform operates on the result of the previous transform:
430
+
431
+ ```markdown
432
+ ---
433
+ title: hello world
434
+ ---
435
+
436
+ [%title:title:split( ):first]
437
+ <!--
438
+ 1. title -> "Hello World"
439
+ 2. split( ) -> ["Hello", "World"] (array)
440
+ 3. first -> "Hello"
441
+ -->
442
+ ```
443
+
444
+ **Example with dates:**
445
+ ```markdown
446
+ ---
447
+ date: 2024-03-15 14:30
448
+ ---
449
+
450
+ [%date:strftime(%Y)]
451
+ <!-- Outputs: 2024 -->
452
+ ```
453
+
454
+ ## Notes
455
+
456
+ - Transforms are case-sensitive
457
+ - Array transforms (`split`, `join`, `first`, `last`, `slice`) work together - use `split` to create an array, then apply other array transforms
458
+ - The `slice` transform automatically converts non-array strings into character arrays if needed
459
+ - Regex patterns in `replace` support POSIX Extended Regular Expressions and can include character classes like `[0-9]+`
460
+ - Date parsing supports common formats but may not handle all date string formats
461
+ - Unknown transforms are ignored and return the original value
@@ -0,0 +1,193 @@
1
+ # Processor Modes
2
+
3
+ Apex supports multiple processor modes, each optimized for compatibility with different Markdown flavors. You can select between unified, multimarkdown, commonmark, kramdown, and gfm from the **Settings->Processor** panel.
4
+
5
+ ## Overview
6
+
7
+ | Mode | Description | Default ID Format |
8
+ | ------------ | --------------------------- | ----------------- |
9
+ | `unified` | All features enabled | GFM |
10
+ | `gfm` | GitHub Flavored Markdown | GFM |
11
+ | `mmd` | MultiMarkdown compatibility | MultiMarkdown |
12
+ | `kramdown` | Kramdown compatibility | Kramdown |
13
+ | `commonmark` | Pure CommonMark spec | GFM |
14
+
15
+ ## Unified Mode (Default)
16
+
17
+ Unified mode enables all features from all other modes. This is the default mode.
18
+
19
+ ### Enabled Features
20
+
21
+ - ✅ Tables (GFM style)
22
+ - ✅ Strikethrough (`~~text~~`)
23
+ - ✅ Task lists (`- [ ]` and `- [x]`)
24
+ - ✅ Autolinks (URLs and emails)
25
+ - ✅ Footnotes (reference and inline styles)
26
+ - ✅ Definition lists
27
+ - ✅ Smart typography
28
+ - ✅ Math support (`$inline$` and `$$display$$`)
29
+ - ✅ Wiki links (`[[Page]]`) - Enable in **Settings->Processor->Wiki Links** (disabled by default)
30
+ - ✅ Critic Markup
31
+ - ✅ Callouts
32
+ - ✅ File includes
33
+ - ✅ Metadata blocks (YAML, MMD, Pandoc)
34
+ - ✅ Metadata variables (`[%key]`) - See [Metadata Transforms](Metadata-Transforms) for transform syntax
35
+ - ✅ Abbreviations
36
+ - ✅ Inline Attribute Lists (IAL)
37
+ - ✅ Relaxed tables (default)
38
+ - ✅ GitHub Emoji (`:emoji_name:`)
39
+
40
+ ### ID Format
41
+
42
+ - Default: GFM format
43
+ - Can be overridden in **Settings->Processor->Header ID Format**
44
+
45
+ ## GFM Mode
46
+
47
+ GitHub Flavored Markdown compatibility mode. Select this in **Settings->Processor->Mode**.
48
+
49
+ ### Enabled Features
50
+
51
+ - ✅ Tables
52
+ - ✅ Strikethrough
53
+ - ✅ Task lists
54
+ - ✅ Autolinks
55
+ - ✅ Hard line breaks (newlines become `<br>`)
56
+
57
+ ### Disabled Features
58
+
59
+ - ❌ Footnotes
60
+ - ❌ Definition lists
61
+ - ❌ Smart typography
62
+ - ❌ Math
63
+ - ❌ Wiki links
64
+ - ❌ Critic Markup
65
+ - ❌ Callouts
66
+ - ❌ File includes
67
+ - ❌ Metadata
68
+ - ❌ Abbreviations
69
+ - ❌ IAL
70
+ - ❌ Relaxed tables
71
+
72
+ ### ID Format
73
+
74
+ - GFM format (cannot be changed)
75
+
76
+ ## MultiMarkdown Mode
77
+
78
+ MultiMarkdown compatibility mode. Select this in **Settings->Processor->Mode**.
79
+
80
+ ### Enabled Features
81
+
82
+ - ✅ Tables
83
+ - ✅ Footnotes (reference style)
84
+ - ✅ Definition lists
85
+ - ✅ Smart typography
86
+ - ✅ Math support
87
+ - ✅ Metadata blocks (YAML, MMD, Pandoc)
88
+ - ✅ Metadata variables (`[%key]`) - See [Metadata Transforms](Metadata-Transforms) for transform syntax
89
+ - ✅ Abbreviations
90
+ - ✅ File includes
91
+
92
+ ### Disabled Features
93
+
94
+ - ❌ Strikethrough
95
+ - ❌ Task lists
96
+ - ❌ Wiki links
97
+ - ❌ Critic Markup
98
+ - ❌ Callouts
99
+ - ❌ IAL
100
+ - ❌ Relaxed tables
101
+
102
+ ### ID Format
103
+
104
+ - MultiMarkdown format (cannot be changed)
105
+
106
+ ## Kramdown Mode
107
+
108
+ Kramdown compatibility mode. Select this in **Settings->Processor->Mode**.
109
+
110
+ ### Enabled Features
111
+
112
+ - ✅ Tables
113
+ - ✅ Footnotes (reference and inline styles)
114
+ - ✅ Definition lists
115
+ - ✅ Smart typography
116
+ - ✅ Math support
117
+ - ✅ Inline Attribute Lists (IAL)
118
+ - ✅ Abbreviations
119
+ - ✅ Relaxed tables (default)
120
+
121
+ ### Disabled Features
122
+
123
+ - ❌ Strikethrough
124
+ - ❌ Task lists
125
+ - ❌ Wiki links
126
+ - ❌ Critic Markup
127
+ - ❌ Callouts
128
+ - ❌ File includes
129
+ - ❌ Metadata
130
+ - ❌ Autolinks
131
+
132
+ ### ID Format
133
+
134
+ - Kramdown format (cannot be changed)
135
+
136
+ ## CommonMark Mode
137
+
138
+ Pure CommonMark specification compliance. No extensions. Select this in **Settings->Processor->Mode**.
139
+
140
+ ### Enabled Features
141
+
142
+ - ✅ Basic Markdown only (headers, lists, emphasis, links, code, blockquotes, etc.)
143
+
144
+ ### Disabled Features
145
+
146
+ - ❌ All extensions (tables, footnotes, etc.)
147
+
148
+ ### ID Format
149
+
150
+ - GFM format (for consistency)
151
+
152
+ ## Feature Comparison Table
153
+
154
+ | Feature | Unified | GFM | MMD | Kramdown | CommonMark |
155
+ | ---------------- | ------- | --- | --- | -------- | ---------- |
156
+ | Tables | ✅ | ✅ | ✅ | ✅ | ❌ |
157
+ | Strikethrough | ✅ | ✅ | ❌ | ❌ | ❌ |
158
+ | Task Lists | ✅ | ✅ | ❌ | ❌ | ❌ |
159
+ | Footnotes | ✅ | ❌ | ✅ | ✅ | ❌ |
160
+ | Definition Lists | ✅ | ❌ | ✅ | ✅ | ❌ |
161
+ | Smart Typography | ✅ | ❌ | ✅ | ✅ | ❌ |
162
+ | Math | ✅ | ❌ | ✅ | ✅ | ❌ |
163
+ | Wiki Links | ✅* | ❌ | ❌ | ❌ | ❌ |
164
+ | Critic Markup | ✅ | ❌ | ❌ | ❌ | ❌ |
165
+ | Callouts | ✅ | ❌ | ❌ | ❌ | ❌ |
166
+ | File Includes | ✅ | ❌ | ✅ | ❌ | ❌ |
167
+ | Metadata | ✅ | ❌ | ✅ | ❌ | ❌ |
168
+ | Abbreviations | ✅ | ❌ | ✅ | ✅ | ❌ |
169
+ | IAL | ✅ | ❌ | ❌ | ✅ | ❌ |
170
+ | Relaxed Tables | ✅ | ❌ | ❌ | ✅ | ❌ |
171
+
172
+ \* Wiki links are available in unified mode but **disabled by default**. Enable them in **Settings->Processor->Wiki Links**.
173
+
174
+ ## Choosing a Mode
175
+
176
+ - **Unified** - Use when you want all features or need compatibility with multiple Markdown flavors
177
+ - **GFM** - Use for GitHub compatibility or when publishing to GitHub
178
+ - **MMD** - Use for MultiMarkdown compatibility or when you need metadata
179
+ - **Kramdown** - Use for Kramdown compatibility or when you need IAL attributes
180
+ - **CommonMark** - Use for strict CommonMark compliance or minimal output
181
+
182
+ ## Overriding Mode Defaults
183
+
184
+ In unified mode, you can enable or disable specific features using the various settings in **Settings->Processor**. For example:
185
+
186
+ - Disable footnotes: Uncheck **Settings->Processor->Footnotes**
187
+ - Disable math: Uncheck **Settings->Processor->Math Support**
188
+ - Enable wiki links: Check **Settings->Processor->Wiki Links**
189
+
190
+ ## Related
191
+
192
+ - [Header IDs](Header-IDs) - How ID formats differ by mode
193
+ - [Syntax](Syntax) - Syntax available in each mode