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,1367 @@
1
+ # Syntax Reference
2
+
3
+ This page documents all syntax features available in **unified mode**. For mode-specific syntax, see [Modes](Modes).
4
+
5
+ ## Basic Markdown
6
+
7
+ ### Headers
8
+
9
+ **ATX-style headers:**
10
+ ```markdown
11
+ # H1
12
+ ## H2
13
+ ### H3
14
+ #### H4
15
+ ##### H5
16
+ ###### H6
17
+ ```
18
+
19
+ **Setext-style headers:**
20
+ ```markdown
21
+ H1 Alternative
22
+ ==============
23
+
24
+ H2 Alternative
25
+ --------------
26
+ ```
27
+
28
+ **Multi-line setext headers (MMD 6):**
29
+ Setext headers can span multiple lines before the underline. This is supported in **unified** and **MultiMarkdown** modes:
30
+
31
+ ```markdown
32
+ This is
33
+ a multi-line
34
+ setext header
35
+ ========
36
+
37
+ Another
38
+ header
39
+ with
40
+ multiple
41
+ lines
42
+ --------
43
+ ```
44
+
45
+ ### Emphasis
46
+
47
+ ```markdown
48
+ *italic*
49
+ _italic_
50
+ **bold**
51
+ __bold__
52
+ ***bold italic***
53
+ ___bold italic___
54
+ ```
55
+
56
+ ### Superscript and Subscript
57
+
58
+ MultiMarkdown-style superscript and subscript syntax:
59
+
60
+ ```markdown
61
+ H~2~O # H₂O (subscript - tildes within word)
62
+ m^2 # m² (superscript)
63
+ x^2 + y^2 # x² + y²
64
+ H~2~SO~4~ # H₂SO₄ (multiple subscripts within word)
65
+ ~h2o~ # <u>h2o</u> (underline - tildes at word boundaries)
66
+ ```
67
+
68
+ **Syntax rules:**
69
+ - The `^` character creates superscript for the text immediately following it. The superscript stops at the first space, punctuation, or newline.
70
+ - The `~` character creates subscript when used **within a word/identifier** with paired tildes (e.g., `H~2~O`). The subscript ends at the second tilde.
71
+ - When tildes are at word boundaries (e.g., `~text~`), they create underline instead of subscript. This prevents interference with underline/strikethrough syntax.
72
+
73
+ **Examples:**
74
+ ```markdown
75
+ Water: H~2~O # H₂O (subscript - tildes within word)
76
+ Area: m^2 # m² (superscript)
77
+ Formula: E = mc^2 # E = mc² (superscript)
78
+ Chemical: H~2~SO~4~ # H₂SO₄ (multiple subscripts within word)
79
+ ~h2o~ # <u>h2o</u> (underline - tildes at word boundaries)
80
+ ```
81
+
82
+ This feature is enabled by default in **MultiMarkdown** and **unified** modes. In other modes, enable it in **Settings->Processor->Superscript/Subscript**.
83
+
84
+ ### Lists
85
+
86
+ **Unordered:**
87
+ ```markdown
88
+ - Item 1
89
+ - Item 2
90
+ - Nested item
91
+ - Another nested
92
+ - Item 3
93
+ ```
94
+
95
+ **Ordered:**
96
+ ```markdown
97
+ 1. First item
98
+ 2. Second item
99
+ 1. Nested item
100
+ 2. Another nested
101
+ 3. Third item
102
+ ```
103
+
104
+ **Mixed Markers (Unified & MultiMarkdown modes):**
105
+ In unified and MultiMarkdown modes, you can mix different list marker types at the same indentation level. The list will inherit the type from the first item:
106
+
107
+ ```markdown
108
+ 1. First numbered item
109
+ * Second item (becomes numbered)
110
+ * Third item (becomes numbered)
111
+
112
+ * First bullet item
113
+ 1. Second item (becomes bullet)
114
+ 2. Third item (becomes bullet)
115
+ ```
116
+
117
+ By default, CommonMark and GFM modes create separate lists when marker types change. Enable **Settings->Processor->Mixed Lists** to enable this behavior in other modes, or disable it in unified/MultiMarkdown modes.
118
+
119
+ **Alpha Lists (Unified mode):**
120
+ In unified mode, you can use alphabetic markers for ordered lists:
121
+
122
+ ```markdown
123
+ a. First item
124
+ b. Second item
125
+ c. Third item
126
+
127
+ A. First item (uppercase)
128
+ B. Second item (uppercase)
129
+ C. Third item (uppercase)
130
+ ```
131
+
132
+ Alpha lists are automatically converted to HTML with `style="list-style-type: lower-alpha"` or `style="list-style-type: upper-alpha"`. This feature is enabled by default in unified mode. Enable **Settings->Processor->Alpha Lists** in other modes, or disable it in unified mode.
133
+
134
+ **Task Lists:**
135
+ ```markdown
136
+ - [ ] Todo item
137
+ - [x] Completed item
138
+ - [ ] Another todo
139
+ ```
140
+
141
+ ### Links and Images
142
+
143
+ **Standard Markdown links:**
144
+ ```markdown
145
+ [Link text](https://example.com)
146
+ [Link with title](https://example.com "Title")
147
+ ```
148
+
149
+ **Link titles with different quote styles (MMD 6):**
150
+ Link and image titles can use single quotes, double quotes, or parentheses. This is supported in **unified** and **MultiMarkdown** modes:
151
+
152
+ ```markdown
153
+ [Link with double quotes](https://example.com "Title")
154
+ [Link with single quotes](https://example.com 'Title')
155
+ [Link with parentheses](https://example.com (Title))
156
+ ```
157
+
158
+ **Images:**
159
+ ```markdown
160
+ ![Alt text](image.png)
161
+ ![Alt with title](image.png "Image title")
162
+ ```
163
+
164
+ **Image titles with different quote styles (MMD 6):**
165
+ ```markdown
166
+ ![Image](image.png "Double quote title")
167
+ ![Image](image.png 'Single quote title')
168
+ ![Image](image.png (Parentheses title))
169
+ ```
170
+
171
+ **Reference-style links and images:**
172
+ Reference-style links and images also support all three quote styles for titles:
173
+
174
+ ```markdown
175
+ [Link text][ref1]
176
+ ![Image][img1]
177
+
178
+ [ref1]: https://example.com "Reference title"
179
+ [ref2]: https://example.com 'Reference title'
180
+ [ref3]: https://example.com (Reference title)
181
+
182
+ [img1]: image.png "Image title"
183
+ [img2]: image.png 'Image title'
184
+ [img3]: image.png (Image title)
185
+ ```
186
+
187
+ **Autolinks:**
188
+
189
+ Apex can automatically convert URLs and email addresses into clickable links. Autolinking is enabled by default in **GFM**, **MultiMarkdown**, **Kramdown**, and **unified** modes. It is disabled by default in **CommonMark** mode.
190
+
191
+ **Angle-bracket autolinks:**
192
+ ```markdown
193
+ <https://example.com>
194
+ <http://example.com>
195
+ <mailto:user@example.com>
196
+ ```
197
+
198
+ **Bare URL autolinks:**
199
+ ```markdown
200
+ Visit https://example.com for more info.
201
+ Check out http://example.com too.
202
+ ```
203
+
204
+ **Email autolinks:**
205
+ ```markdown
206
+ Contact me@example.com for details.
207
+ Send to user@example.com.
208
+ ```
209
+
210
+ **Important notes:**
211
+ - Autolinks are **not** processed inside code spans (`` `code` ``) or code blocks (``` ``` ```)
212
+ - Enable **Settings->Processor->Autolinks** to enable autolinking in modes where it's disabled by default
213
+ - Disable **Settings->Processor->Autolinks** to disable autolinking in modes where it's enabled by default
214
+ - Angle-bracket autolinks (`<url>`) are converted to standard Markdown links during preprocessing
215
+ - Bare URLs and email addresses are also converted to Markdown links during preprocessing
216
+
217
+ ### Code
218
+
219
+ **Inline code:**
220
+ ```markdown
221
+ Use `code` in text.
222
+ ```
223
+
224
+ **Fenced code blocks:**
225
+ ````markdown
226
+ ```python
227
+ def hello():
228
+ print("Hello, World!")
229
+ ```
230
+ ````
231
+
232
+ **Indented code blocks:**
233
+ ```markdown
234
+ def hello():
235
+ print("Hello, World!")
236
+ ```
237
+
238
+ ### Blockquotes
239
+
240
+ ```markdown
241
+ > This is a quote.
242
+ > It can span multiple lines.
243
+ >
244
+ > > Nested quotes are supported.
245
+ ```
246
+
247
+ **Lists and definition lists in blockquotes:**
248
+
249
+ Blockquotes can contain lists and definition lists:
250
+
251
+ ```markdown
252
+ > 1. First item
253
+ > 2. Second item
254
+ >
255
+ > - Unordered item
256
+ > - Another item
257
+ >
258
+ > Term
259
+ > : Definition
260
+ ```
261
+
262
+ Nested blockquotes also support these features:
263
+
264
+ ```markdown
265
+ > > Nested quote
266
+ > > 1. List item
267
+ > > Term
268
+ > > : Definition
269
+ ```
270
+
271
+ ### Horizontal Rules
272
+
273
+ ```markdown
274
+ ---
275
+ ***
276
+ ___
277
+ ```
278
+
279
+ ## Tables
280
+
281
+ ### Standard Tables
282
+
283
+ ```markdown
284
+ | Header 1 | Header 2 | Header 3 |
285
+ | -------- | :------: | -------: |
286
+ | Left | Center | Right |
287
+ | Data | Data | Data |
288
+ ```
289
+
290
+ Column alignment:
291
+ - `:---` or `---` - Left (default)
292
+ - `:---:` - Center
293
+ - `---:` - Right
294
+
295
+ ### Relaxed Tables
296
+
297
+ In unified and kramdown modes, tables don't require separator rows:
298
+
299
+ ```markdown
300
+ one | two | three
301
+ 1 | 2 | 3
302
+ 4 | 5 | 6
303
+ ```
304
+
305
+ This automatically becomes a table. See [Modes](Modes) for details.
306
+
307
+ ### Headerless Tables
308
+
309
+ Apex supports tables that start with alignment rows (separator rows) without header rows. The alignment specified in the separator row is automatically applied to all columns:
310
+
311
+ ```markdown
312
+ | --- | --- | --- |
313
+ | a | b | c |
314
+ | 1 | 2 | 3 |
315
+ ```
316
+
317
+ Alignment specifiers work as usual:
318
+
319
+ ```markdown
320
+ |:---|:---:|---:|
321
+ | left | center | right |
322
+ ```
323
+
324
+ In this case, the first row (the alignment row) specifies the column alignment, and all subsequent data rows inherit that alignment. The empty header row that would normally be required is automatically handled.
325
+
326
+ #### Row header columns
327
+
328
+ You can also mark the **first column** as a row-header column by starting the header row with an **empty first cell**:
329
+
330
+ ```markdown
331
+ | | Header 1 | Header 2 |
332
+ | Row 1 | data 1.1 | data 1.2 |
333
+ | Row 2 | data 2.1 | data 2.2 |
334
+ ```
335
+
336
+ When the first header cell is empty (for example, `| |` or `| |`), Apex will:
337
+
338
+ - Treat the rest of the header row as usual column headers.
339
+ - Render the first cell of each body row as a **row header** using `<th scope="row">Row 1</th>`, `<th scope="row">Row 2</th>`, etc.
340
+
341
+ Notes:
342
+
343
+ - The row-header behavior only applies to the **first column** and only when the **first header cell is empty**.
344
+ - Tables that start with `|data|data|` or `data|data` do **not** enable row headers.
345
+ - This works together with all other table features (relaxed tables, headerless tables, colspans/rowspans, captions, etc.).
346
+
347
+ ### Inline Tables from CSV/TSV
348
+
349
+ In addition to regular pipe tables, Apex can convert inline CSV/TSV text into tables.
350
+
351
+ #### Fenced CSV/TSV tables
352
+
353
+ Use a fenced code block with the info string `table`. The delimiter is detected automatically:
354
+
355
+ - If any non-blank line contains a **tab**, the block is treated as TSV.
356
+ - Otherwise, if any non-blank line contains a **comma**, the block is treated as CSV.
357
+ - If no tabs or commas are found, the block is left unchanged as a normal `table`-info code block (useful for showing literal CSV/TSV).
358
+
359
+ ```table
360
+ header 1,header 2,header 3
361
+ data 1,data 2,data 3
362
+ ,,data 2c
363
+ ```
364
+
365
+ You can also use TSV with real tab characters:
366
+
367
+ ```table
368
+ col1\tcol2\tcol3
369
+ val1\tval2\tval3
370
+ ```
371
+
372
+ #### Alignment rows in CSV/TSV tables
373
+
374
+ CSV/TSV inline tables can specify column alignment using a row of **alignment keywords**:
375
+
376
+ ```table
377
+ H1,H2,H3
378
+ left,center,right
379
+ a,b,c
380
+ ```
381
+
382
+ The alignment row is not rendered as data; it is converted to the equivalent Markdown alignment row:
383
+
384
+ - `left` → `:---`
385
+ - `center` → `:---:`
386
+ - `right` → `---:`
387
+ - `auto` → `---`
388
+
389
+ If the first row contains only alignment keywords, it becomes a **headless table**: the alignment row is emitted first and all following rows become body rows. If there is **no alignment row at all**, Apex emits a default `---` separator row so that relaxed/headless table handling still works as expected.
390
+
391
+ #### `<!--TABLE-->` markers
392
+
393
+ You can also start an inline CSV/TSV table with an HTML comment:
394
+
395
+ ```markdown
396
+ <!--TABLE-->
397
+ header 1,header 2,header 3
398
+ data 1,data 2,data 3
399
+ ,,data 2c
400
+ ```
401
+
402
+ `<!--TABLE-->` consumes the following **contiguous non-blank lines** as table data (stopping at the first blank line), applies the same delimiter detection and optional alignment-row handling, and converts the block into a table. If no tabs or commas are found, the comment and lines are left unchanged.
403
+
404
+ ### Advanced Table Features
405
+
406
+ **Column spans (empty cells):**
407
+ ```markdown
408
+ | A | B | C |
409
+ | --- | --- | --- |
410
+ | D | | |
411
+ ```
412
+
413
+ Empty cells merge with the previous cell.
414
+
415
+ **Row spans:**
416
+ ```markdown
417
+ | A | B |
418
+ | --- | --- |
419
+ | C | D |
420
+ | ^^ | E |
421
+ ```
422
+
423
+ The `^^` marker creates a row span on the cell above. Consecutive `^^` markers stack to create larger row spans.
424
+
425
+ **Table footers (tfoot):**
426
+ ```markdown
427
+ | h1 | h2 | h3 |
428
+ | --- | :---: | --- |
429
+ | d1 | d2 | d3 |
430
+ | d1 | d2 | d3 |
431
+ | === | === | === |
432
+ | d-4 | d-5 | d-6 |
433
+ ```
434
+
435
+ A row where every cell contains only `===` (three or more equals, with optional extra `=` and whitespace) is treated as a **footer divider**. That row is removed from the output and all following rows are rendered inside `<tfoot>`.
436
+
437
+ **Individual cell alignment:**
438
+
439
+ Table cells can be aligned individually using colons, similar to Jekyll Spaceship:
440
+
441
+ ```markdown
442
+ | Header | Header | Header |
443
+ | --- | --- | --- |
444
+ | :Left | Center: | :Center: |
445
+ | Right: | Normal | :Left |
446
+ ```
447
+
448
+ - `:Text` or `: Text` - Left align (leading colon)
449
+ - `Text:` or `Text :` - Right align (trailing colon)
450
+ - `:Text:` or `: Text :` - Center align (both colons)
451
+
452
+ The colons are removed from the output, and the alignment is applied via CSS `text-align` styles. Escaped colons (`\:`) are not treated as alignment markers.
453
+
454
+ **Combined row and column spans:**
455
+
456
+ You can mix rowspans and colspans in the same table to create more complex layouts:
457
+
458
+ ```markdown
459
+ [Employee Performance Q4]
460
+ | Department | Employee | Q1-Q2 Average | Q3 | Q4 | Overall |
461
+ | ----------- | -------- | ------------- | ------ | --- | ------- |
462
+ | Engineering | Alice | 93.5 | 94 | 96 | 94.25 |
463
+ | ^^ | Bob | 89.0 | 87 | 91 | 89.00 |
464
+ | Marketing | Charlie | 92.0 | Absent | | 92.00 |
465
+ | Sales | Diana | 87.5 | 88 | 90 | 88.50 |
466
+ | ^^ | Eve | 93.0 | 95 | 93 | 93.50 |
467
+ {: .performance-table #q4-results}
468
+ ```
469
+
470
+ Here `^^` creates rowspans for the `Department` column, while empty cells in the "Absent" row allow the "Q4" value to span visually.
471
+
472
+ **Table captions:**
473
+ ```markdown
474
+ [Table Caption]
475
+
476
+ | A | B |
477
+ | --- | --- |
478
+ | C | D |
479
+ ```
480
+
481
+ Captions can appear **before or after** a table. They must be contiguous with the table (no other content between them), but a blank line is allowed:
482
+
483
+ ```markdown
484
+ | A | B |
485
+ | --- | --- |
486
+ | C | D |
487
+
488
+ [Caption after table]
489
+ ```
490
+
491
+ In addition, Apex supports **Pandoc-style captions**:
492
+
493
+ ```markdown
494
+ | A | B |
495
+ | --- | --- |
496
+ | C | D |
497
+
498
+ Table: Caption after table
499
+ ```
500
+
501
+ Pandoc-style `Table: Caption` lines are normalized to `[Caption]` before parsing, so they work with the same caption rendering as MultiMarkdown captions.
502
+
503
+ Apex also supports **Pandoc table_attributes extension** using the `: Caption` syntax:
504
+
505
+ ```markdown
506
+ | Key | Value |
507
+ | --- | :---: |
508
+ | one | 1 |
509
+ | two | 2 |
510
+
511
+ : Key value table {#table-id .testing key="value"}
512
+ ```
513
+
514
+ The `: Caption` format (with optional IAL attributes) is recognized when it appears immediately before or after a table. IAL attributes in the caption are extracted and applied to the table element itself. This supports both Kramdown-style IALs (`{: #id .class}`) and Pandoc-style IALs without the colon (`{#id .class}`).
515
+
516
+ **Note:** The `: Caption` syntax only works when adjacent to a table to avoid conflicts with definition list syntax. If a line starting with `:` is not next to a table, it will be processed as a definition list item.
517
+
518
+ **Caption position:** By default, captions appear **below** the table. Configure caption position in **Settings->Processor->Table Captions**.
519
+
520
+ ## Footnotes
521
+
522
+ ### Reference Style
523
+
524
+ ```markdown
525
+ Here's a footnote[^1] and another[^note].
526
+
527
+ [^1]: First footnote content.
528
+ [^note]: Second footnote with custom ID.
529
+ ```
530
+
531
+ ### Inline Style (Kramdown)
532
+
533
+ ```markdown
534
+ This is a footnote^[inline content here].
535
+ ```
536
+
537
+ ### Inline Style (MultiMarkdown)
538
+
539
+ ```markdown
540
+ This is a footnote[^inline content with spaces].
541
+ ```
542
+
543
+ ## Definition Lists
544
+
545
+ ```markdown
546
+ Term
547
+ : Definition text with **Markdown** support
548
+
549
+ Apple
550
+ : A fruit
551
+ : A company
552
+
553
+ Term with multiple definitions
554
+ : First definition
555
+ : Second definition
556
+ ```
557
+
558
+ **Definition lists in blockquotes:**
559
+
560
+ Definition lists work inside blockquotes, including nested blockquotes:
561
+
562
+ ```markdown
563
+ > Term 1
564
+ > : Definition 1
565
+ > Term 2
566
+ > : Definition 2
567
+
568
+ > > Nested blockquote
569
+ > > Term
570
+ > > : Definition
571
+ ```
572
+
573
+ This allows you to create quoted definitions and maintain proper nesting structure.
574
+
575
+ ## Citations
576
+
577
+ **Note:** Citations are supported in **MultiMarkdown** and **unified** modes. A bibliography file must be provided via **Settings->Processor->Citations** or document metadata.
578
+
579
+ ### Pandoc Citation Syntax
580
+
581
+ **Basic citation:**
582
+ ```markdown
583
+ See [@doe99] for details.
584
+ ```
585
+
586
+ **Multiple citations:**
587
+ ```markdown
588
+ See [@doe99; @smith2000; @smith2004] for more information.
589
+ ```
590
+
591
+ **Author in text:**
592
+ ```markdown
593
+ @smith04 says blah.
594
+ ```
595
+
596
+ **Author suppressed:**
597
+ ```markdown
598
+ Smith says blah [-@smith04].
599
+ ```
600
+
601
+ **With locator:**
602
+ ```markdown
603
+ @smith04 [p. 33] says blah.
604
+ ```
605
+
606
+ ### MultiMarkdown Citation Syntax
607
+
608
+ **Basic citation:**
609
+ ```markdown
610
+ This is a statement[#Doe:2006].
611
+ ```
612
+
613
+ **With locator:**
614
+ ```markdown
615
+ This is a statement[p. 23][#Doe:2006].
616
+ ```
617
+
618
+ **Inline citation:**
619
+ ```markdown
620
+ As per Doe.[#John Doe. *A Totally Fake Book 1*. Vanity Press, 2006.]
621
+ ```
622
+
623
+ ### mmark Citation Syntax
624
+
625
+ **Basic citation:**
626
+ ```markdown
627
+ This references [@RFC2535].
628
+ ```
629
+
630
+ **Normative citation:**
631
+ ```markdown
632
+ This references [@!RFC1034] (normative).
633
+ ```
634
+
635
+ **Multiple citations:**
636
+ ```markdown
637
+ Multiple citations: [@RFC1034;@RFC1035].
638
+ ```
639
+
640
+ **Combined reference:**
641
+ ```markdown
642
+ Combined reference: [@RFC1034@STD3].
643
+ ```
644
+
645
+ ### Bibliography
646
+
647
+ Bibliography is automatically generated from cited entries and inserted at the `<!-- REFERENCES -->` marker or appended to the end of the document.
648
+
649
+ **Bibliography marker:**
650
+ ```markdown
651
+ ## References
652
+
653
+ <!-- REFERENCES -->
654
+ ```
655
+
656
+ **Bibliography in metadata:**
657
+ ```markdown
658
+ ---
659
+ bibliography: references.bib
660
+ ---
661
+
662
+ See [@doe99] for details.
663
+ ```
664
+
665
+ **Multiple bibliography files:**
666
+ ```markdown
667
+ ---
668
+ bibliography:
669
+ - refs1.bib
670
+ - refs2.bib
671
+ ---
672
+ ```
673
+
674
+ For complete documentation of citations and bibliography, see [Citations](Citations).
675
+
676
+ ## Indices
677
+
678
+ **Note:** Indices are supported in **MultiMarkdown** and **unified** modes. Enabled by default in these modes.
679
+
680
+ ### mmark Index Syntax
681
+
682
+ **Basic index entry:**
683
+ ```markdown
684
+ This is about protocols (!Protocol).
685
+ ```
686
+
687
+ **Sub-item entry:**
688
+ ```markdown
689
+ HTTP/1.1 (!HTTP, HTTP/1.1) is a protocol version.
690
+ ```
691
+
692
+ **Primary entry (bold in index):**
693
+ ```markdown
694
+ This is a primary topic (!!Primary Topic, Sub Topic).
695
+ ```
696
+
697
+ **Multiple entries:**
698
+ ```markdown
699
+ Protocols (!Protocol) and implementations (!Implementation) are important.
700
+ ```
701
+
702
+ ### TextIndex Syntax
703
+
704
+ **Basic syntax (indexes preceding word):**
705
+ ```markdown
706
+ Most mechanical keyboard firmware{^} supports key combinations.
707
+ ```
708
+
709
+ **Explicit term:**
710
+ ```markdown
711
+ This uses [key combinations]{^} for indexing.
712
+ ```
713
+
714
+ **With parameters:**
715
+ ```markdown
716
+ Term{^param1 param2}
717
+ ```
718
+
719
+ ### Index Generation
720
+
721
+ The index is automatically generated at the end of the document or at the `<!--INDEX-->` marker if present:
722
+
723
+ ```markdown
724
+ # Document
725
+
726
+ This is about protocols (!Protocol).
727
+
728
+ <!--INDEX-->
729
+
730
+ More content after the index.
731
+ ```
732
+
733
+ **Index features:**
734
+ - Entries are sorted alphabetically
735
+ - Can be grouped by first letter (default)
736
+ - Sub-items are nested under main terms
737
+ - Primary entries are marked (typically bold)
738
+ - Each entry links back to its location in the document
739
+
740
+ **Suppress index:**
741
+ Disable **Settings->Processor->Generate Index** to suppress index generation while still creating index markers.
742
+
743
+ ## Math
744
+
745
+ **Inline math:**
746
+ ```markdown
747
+ The equation $E = mc^2$ is famous.
748
+ ```
749
+
750
+ **Display math:**
751
+ ```markdown
752
+ $$
753
+ \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
754
+ $$
755
+ ```
756
+
757
+ Math is wrapped in spans with appropriate classes for MathJax or KaTeX.
758
+
759
+ ## Wiki Links
760
+
761
+ **Note:** Wiki links are **disabled by default** in all modes. Enable them in **Settings->Processor->Wiki Links**.
762
+
763
+ ```markdown
764
+ [[Page Name]] # Link to page
765
+ [[Page Name|Display Text]] # Custom display text
766
+ [[Page Name#Section]] # Link to section
767
+ [[Page Name#Section|Display]] # Custom display with section
768
+ ```
769
+
770
+ ## Critic Markup
771
+
772
+ Track changes and annotations:
773
+
774
+ ```markdown
775
+ {++addition++} # Added text
776
+ {--deletion--} # Deleted text
777
+ {~~old text~>new text~~} # Substitution
778
+ {==highlighted==} # Highlighted text
779
+ {>>comment text<<} # Comment/annotation
780
+ ```
781
+
782
+ Critic Markup changes can be accepted or rejected using options in **Settings->Processor->Critic Markup**.
783
+
784
+ ## Callouts
785
+
786
+ Bear/Obsidian/Xcode Playground syntax:
787
+
788
+ ```markdown
789
+ > [!NOTE] Title
790
+ > This is a note callout
791
+
792
+ > [!WARNING] Be Careful
793
+ > Warning content
794
+
795
+ > [!TIP] Pro Tip
796
+ > Helpful advice
797
+
798
+ > [!DANGER] Critical
799
+ > Dangerous operation
800
+
801
+ > [!INFO] Information
802
+ > Informational content
803
+ ```
804
+
805
+ **Collapsible callouts:**
806
+ ```markdown
807
+ > [!NOTE]+ Expandable
808
+ > Defaults to open
809
+
810
+ > [!NOTE]- Collapsed
811
+ > Defaults to closed
812
+ ```
813
+
814
+ ## File Includes
815
+
816
+ **Marked syntax:**
817
+ ```markdown
818
+ <<[file.md] # Include and process Markdown
819
+ <<(code.py) # Include as code block
820
+ <<{raw.html} # Include raw HTML
821
+ ```
822
+
823
+ **MultiMarkdown transclusion:**
824
+ ```markdown
825
+ {{file.md}} # Include file
826
+ {{file.*}} # Prefer file.html, file.md, file.txt, file.tex (in that order)
827
+ {{*.md}} # Glob include (first matching .md file)
828
+ {{c?de.py}} # ? wildcard (e.g. resolves to code.py)
829
+ ```
830
+
831
+ `{{file.*}}` implements MultiMarkdown-style wildcard resolution, trying common extensions in a preferred order.
832
+ Patterns containing `*`, `?`, `[]`, or `{}` are treated as glob patterns and resolved relative to the current transclude base (see metadata `transclude base`).
833
+
834
+ **iA Writer syntax:**
835
+ ```markdown
836
+ /image.png # Intelligent include (detects type)
837
+ /code.py # Auto-detects as code block
838
+ /document.md # Auto-detects as Markdown
839
+ ```
840
+
841
+ CSV and TSV files automatically convert to tables.
842
+
843
+ ### Address Syntax for File Includes
844
+
845
+ File includes support mmark-style address syntax to include specific line ranges or sections. This works with `{{file}}` and `<<[file]`, `<<(file)`, `<<{file}` syntaxes, but **not** with iA Writer `/file` syntax.
846
+
847
+ **Line number ranges:**
848
+ ```markdown
849
+ {{file.md}}[3,5] # Include lines 3 to 5 (exclusive of 5)
850
+ {{file.md}}[3,] # Include from line 3 to end of file
851
+ <<[file.md][1,10] # Include lines 1 to 10 in Marked syntax
852
+ <<(code.py)[5,15] # Include lines 5 to 15 in code block
853
+ ```
854
+
855
+ **Regular expression ranges:**
856
+ ```markdown
857
+ {{file.md}}[/START/,/END/] # Include lines between regex matches
858
+ {{file.md}}[/^## /,/^## /] # Include between heading markers
859
+ <<[file.md][/function/,/^}/] # Include from function to closing brace
860
+ ```
861
+
862
+ **Prefix option:**
863
+ ```markdown
864
+ {{file.md}}[3,5;prefix="C: "] # Prefix each line with "C: "
865
+ {{code.py}}[1,10;prefix=" "] # Indent included lines
866
+ ```
867
+
868
+ **Combined examples:**
869
+ ```markdown
870
+ # Include lines 10-20 with prefix
871
+ {{example.py}}[10,20;prefix=" "]
872
+
873
+ # Include from regex match to end
874
+ {{config.md}}[/^## Config/,]
875
+
876
+ # Include between patterns with prefix
877
+ {{script.sh}}[/# START/,/# END/;prefix="# "]
878
+ ```
879
+
880
+ **Notes:**
881
+ - Line numbers are 1-based
882
+ - End line is exclusive (e.g., `[3,5]` includes lines 3 and 4, not 5)
883
+ - Regex patterns use POSIX extended regular expressions
884
+ - If start pattern is not found, empty content is returned
885
+ - If end pattern is not found, content from start to end of file is included
886
+ - Prefix is applied to each included line
887
+
888
+ ### Address Syntax for File Includes
889
+
890
+ Apex supports mmark-style address syntax for specifying line ranges and applying prefixes to included files. This works with `{{file}}` and `<<[file]` syntaxes (but not iA Writer `/file` syntax).
891
+
892
+ **Line number ranges:**
893
+ ```markdown
894
+ {{file.md}}[3,5] # Include lines 3 to 5 (exclusive of 5)
895
+ {{file.md}}[3,] # Include from line 3 to end of file
896
+ <<[file.md][1,10] # Include lines 1 to 10
897
+ <<(code.py)[5,15] # Include lines 5 to 15 from code file
898
+ ```
899
+
900
+ **Regular expression ranges:**
901
+ ```markdown
902
+ {{file.md}}[/START/,/END/] # Include lines between regex matches
903
+ {{file.md}}[/^## Section/,/^## /] # Include from section to next section
904
+ <<[file.md][/BEGIN/,/END/] # Include between BEGIN and END markers
905
+ ```
906
+
907
+ **Prefix option:**
908
+ ```markdown
909
+ {{file.md}}[3,5;prefix="C: "] # Prefix each line with "C: "
910
+ {{file.md}}[prefix="> "] # Prefix all lines with "> "
911
+ <<(code.py)[1,10;prefix=" "] # Prefix with 4 spaces (indentation)
912
+ ```
913
+
914
+ **Combined examples:**
915
+ ```markdown
916
+ {{config.py}}[/def setup/,/^def /;prefix="# "]
917
+ # Includes lines from "def setup" to next "def", with "# " prefix
918
+
919
+ <<[readme.md][10,20;prefix="> "]
920
+ # Includes lines 10-20 with blockquote prefix
921
+ ```
922
+
923
+ **Notes:**
924
+ - Line numbers are 1-based
925
+ - End line is exclusive (e.g., `[3,5]` includes lines 3 and 4, not 5)
926
+ - Regex patterns use POSIX extended regular expressions
927
+ - Prefix is applied to each included line
928
+ - Address syntax does not apply to iA Writer syntax (`/file`)
929
+
930
+ ## Metadata
931
+
932
+ ### YAML Front Matter
933
+
934
+ ```yaml
935
+ ---
936
+ title: My Document
937
+ author: John Doe
938
+ date: 2025-12-06
939
+ ---
940
+ ```
941
+
942
+ ### MultiMarkdown Metadata
943
+
944
+ ```markdown
945
+ Title: My Document
946
+ Author: John Doe
947
+ Date: 2025-12-06
948
+
949
+ ```
950
+
951
+ ### Pandoc Title Block
952
+
953
+ ```markdown
954
+ % My Document
955
+ % John Doe
956
+ % 2025-12-06
957
+ ```
958
+
959
+ ### Metadata Variables
960
+
961
+ Use `[%key]` to insert metadata values anywhere:
962
+
963
+ ```markdown
964
+ ---
965
+ title: Apex Guide
966
+ version: 0.1.0
967
+ ---
968
+
969
+ # [%title]
970
+
971
+ Version: [%version]
972
+ ```
973
+
974
+ You can also transform metadata values using the `[%key:transform]` syntax. See [Metadata Transforms](Metadata-Transforms) for a complete guide to available transforms.
975
+
976
+ **External Metadata Sources:**
977
+
978
+ Metadata can also be loaded from external files:
979
+
980
+ - **Metadata File**: Select a metadata file in **Settings->Processor->Metadata File**, or specify a file in document metadata (YAML, MMD, or Pandoc format, auto-detected)
981
+
982
+ Metadata precedence (highest to lowest):
983
+ 1. Document metadata (in the document)
984
+ 2. File metadata (from **Settings->Processor->Metadata File** or document metadata)
985
+
986
+ **Reusable Metadata Files:**
987
+
988
+ 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.
989
+
990
+ **Example metadata file (`lang-fr.yml`):**
991
+ ```yaml
992
+ ---
993
+ language: fr
994
+ quoteslanguage: french
995
+ ---
996
+ ```
997
+
998
+ **Note:** In YAML, keys with spaces must be quoted (e.g., `"Quotes Language": french`). Since Apex normalizes metadata keys (removes spaces, case-insensitive), you can use keys without spaces for cleaner YAML syntax. Both `quoteslanguage` and `"Quotes Language"` will work.
999
+
1000
+ **Example metadata file (`lang-de.mmd`):**
1001
+ ```
1002
+ Language: de
1003
+ Quotes Language: german
1004
+ ```
1005
+
1006
+ **Note:** MultiMarkdown format allows spaces in keys, so `Quotes Language` works without quotes.
1007
+
1008
+ **Usage:**
1009
+
1010
+ Select the metadata file in **Settings->Processor->Metadata File** to apply it to all documents, or specify it in document metadata.
1011
+
1012
+ **Benefits:**
1013
+ - **Consistency**: Ensure all documents use the same language settings
1014
+ - **Reusability**: Define language and quotes language once, use across many documents
1015
+ - **Maintainability**: Update language settings in one place
1016
+ - **Automatic fallback**: If `Quotes Language` is not specified, it automatically uses the `language` value
1017
+
1018
+ **Controlling Settings via Metadata:**
1019
+
1020
+ Most settings can be controlled via metadata, allowing per-document configuration. Boolean options accept `true`/`false`, `yes`/`no`, or `1`/`0` (case-insensitive). String options use the value directly.
1021
+
1022
+ **Example:**
1023
+ ```yaml
1024
+ ---
1025
+ indices: false
1026
+ wikilinks: true
1027
+ bibliography: references.bib
1028
+ title: My Research Paper
1029
+ pretty: true
1030
+ standalone: true
1031
+ ---
1032
+ ```
1033
+
1034
+ This enables per-document configuration where each file can have its own settings.
1035
+
1036
+ ## Abbreviations
1037
+
1038
+ **Classic MMD syntax:**
1039
+ ```markdown
1040
+ *[HTML]: Hypertext Markup Language
1041
+ *[CSS]: Cascading Style Sheets
1042
+
1043
+ HTML and CSS are essential.
1044
+ ```
1045
+
1046
+ **MMD 6 reference syntax:**
1047
+ ```markdown
1048
+ [>MMD]: MultiMarkdown
1049
+
1050
+ Using [>MMD] here and [>MMD] again.
1051
+ ```
1052
+
1053
+ **MMD 6 inline syntax:**
1054
+ ```markdown
1055
+ This is [>(MD) Markdown] and [>(CSS) Cascading Style Sheets].
1056
+ ```
1057
+
1058
+ ## Inline Attribute Lists (IAL)
1059
+
1060
+ Kramdown and Pandoc syntax for adding HTML attributes (IDs, classes, and custom key-value pairs) to Markdown elements.
1061
+
1062
+ Apex supports both **Kramdown-style IALs** (`{: ...}`) and **Pandoc-style IALs** (`{#id .class}`). Both formats work identically throughout the document.
1063
+
1064
+ **Block-level IALs** appear on the line immediately after the element:
1065
+ ```markdown
1066
+ # Header
1067
+ {: #custom-id}
1068
+
1069
+ # Another Header
1070
+ {#custom-id-2 .highlight}
1071
+
1072
+ Paragraph with class.
1073
+ {: .important}
1074
+
1075
+ ## Another Header
1076
+ {: #section-2 .highlight title="Section Title" lang="en"}
1077
+ ```
1078
+
1079
+ **Inline IALs** appear immediately after the element within the paragraph:
1080
+ ```markdown
1081
+ Here's a [styled link](url){:.button} with a class.
1082
+
1083
+ Here's a [Pandoc-style link](url){#link-id .button} with attributes.
1084
+
1085
+ This has **bold text**{:.bold-style} and *italic text*{:.italic-style}.
1086
+ ```
1087
+
1088
+ **Key-value pairs** allow custom attributes:
1089
+ ```markdown
1090
+ Paragraph.
1091
+ {: title="Important Note" lang="en" data-custom="value"}
1092
+
1093
+ [Link](url){:rel="nofollow" target="_blank"}
1094
+ ```
1095
+
1096
+ **Attribute List Definitions (ALDs)** define reusable attribute sets:
1097
+ ```markdown
1098
+ # Header 1
1099
+ {:my-style}
1100
+
1101
+ # Header 2
1102
+ {:my-style}
1103
+
1104
+ {:my-style: #section-title .important .highlight lang="en"}
1105
+ ```
1106
+
1107
+ **ALD references can be combined with additional attributes** in the same IAL. Additional attributes override or extend the ALD:
1108
+
1109
+ ```markdown
1110
+ {:base-style: #main .class1 .class2}
1111
+
1112
+ # Heading 1
1113
+ {:base-style}
1114
+
1115
+ # Heading 2
1116
+ {:base-style .class3}
1117
+
1118
+ # Heading 3
1119
+ {:base-style #override-id}
1120
+
1121
+ # Heading 4
1122
+ {:base-style .class3 rel="nofollow"}
1123
+ ```
1124
+
1125
+ **Behavior:**
1126
+ - **Classes**: Additional classes are appended to the ALD classes
1127
+ - **IDs**: If an ID is specified in the IAL, it overrides the ALD's ID
1128
+ - **Key-value attributes**: If a key exists in both ALD and IAL, the IAL value overrides the ALD value
1129
+
1130
+ For complete documentation with examples, see [Inline Attribute Lists](Inline-Attribute-Lists).
1131
+
1132
+ ## Table of Contents
1133
+
1134
+ Multiple marker formats:
1135
+
1136
+ ```markdown
1137
+ <!--TOC--> # Basic TOC
1138
+ <!--TOC max2 min1--> # With depth control
1139
+ {{TOC}} # MMD style
1140
+ {{TOC:2-4}} # With range
1141
+ {:toc} # Kramdown IAL marker (uses same TOC engine)
1142
+ ```
1143
+
1144
+ Headings with the `.no_toc` class are excluded from the generated TOC:
1145
+
1146
+ ```markdown
1147
+ # Contents
1148
+ {:.no_toc}
1149
+
1150
+ {:toc}
1151
+ ```
1152
+
1153
+ ## Smart Typography
1154
+
1155
+ Automatic conversion:
1156
+
1157
+ - `"text"` → `"text"` (smart quotes)
1158
+ - `'text'` → `'text'` (smart apostrophes)
1159
+ - `--` → `–` (en dash)
1160
+ - `---` → `—` (em dash)
1161
+ - `...` → `…` (ellipsis)
1162
+ - `<<` → `«` (left guillemet)
1163
+ - `>>` → `»` (right guillemet)
1164
+
1165
+ ## GitHub Emoji
1166
+
1167
+ ```markdown
1168
+ Success! :rocket: :tada: :sparkles:
1169
+ I :heart: Markdown!
1170
+ ```
1171
+
1172
+ Supports 350+ GitHub emoji, converted to Unicode characters.
1173
+
1174
+ ## Special Markers
1175
+
1176
+ **Page breaks:**
1177
+ ```markdown
1178
+ <!--BREAK--> # HTML comment style
1179
+ {::pagebreak /} # Kramdown style
1180
+ ```
1181
+
1182
+ **Autoscroll pauses:**
1183
+ ```markdown
1184
+ <!--PAUSE:5--> # Pause for 5 seconds
1185
+ ```
1186
+
1187
+ **End-of-block marker:**
1188
+ ```markdown
1189
+ - Item 1
1190
+
1191
+ ^
1192
+
1193
+ - Item 2
1194
+ ```
1195
+
1196
+ Forces list separation.
1197
+
1198
+ ## HTML
1199
+
1200
+ Raw HTML is supported (when `unsafe` option is enabled, which is default):
1201
+
1202
+ ```markdown
1203
+ <div class="custom">
1204
+ <p>This is raw HTML inside Markdown.</p>
1205
+ </div>
1206
+ ```
1207
+
1208
+ ### Markdown Inside HTML Blocks
1209
+
1210
+ By default, Markdown inside HTML blocks is **not** parsed unless the HTML block contains blank lines. This follows the CommonMark specification:
1211
+
1212
+ - **HTML blocks without blank lines**: Content is treated as raw HTML and Markdown is not parsed
1213
+ ```markdown
1214
+ <div>**This is not bold**</div>
1215
+ ```
1216
+ Output: `<div>**This is not bold**</div>`
1217
+
1218
+ - **HTML blocks with blank lines**: Content can be parsed as Markdown
1219
+ ```markdown
1220
+ <div>
1221
+
1222
+ **This is bold**
1223
+
1224
+ </div>
1225
+ ```
1226
+ Output: `<div><p><strong>This is bold</strong></p></div>`
1227
+
1228
+ To explicitly enable Markdown parsing inside HTML blocks, use the `markdown` attribute (GFM extension):
1229
+
1230
+ ```markdown
1231
+ <div markdown="1">
1232
+ ## This is a heading
1233
+ - List item
1234
+ </div>
1235
+ ```
1236
+
1237
+ The `markdown` attribute accepts:
1238
+ - `markdown="1"` or `markdown="block"` - Parse block-level Markdown
1239
+ - `markdown="span"` - Parse inline Markdown only
1240
+
1241
+ ### Pandoc Fenced Divs
1242
+
1243
+ Apex supports Pandoc's fenced divs extension, which allows you to create HTML `<div>` elements with attributes using a special fence syntax. This feature is available in **unified mode only** and is enabled by default.
1244
+
1245
+ **Basic syntax:**
1246
+ ```markdown
1247
+ ::::: {#special .sidebar}
1248
+ Here is a paragraph.
1249
+
1250
+ And another.
1251
+ :::::
1252
+ ```
1253
+
1254
+ **Opening fences:**
1255
+ - Must contain at least 3 consecutive colons (`:::`)
1256
+ - Must have attributes (ID, classes, or custom attributes)
1257
+ - Attributes can optionally be followed by another string of consecutive colons
1258
+
1259
+ **Closing fences:**
1260
+ - Must contain at least 3 consecutive colons (`:::`)
1261
+ - No attributes needed
1262
+ - Number of colons doesn't need to match the opening fence
1263
+
1264
+ **Attributes:**
1265
+ Attributes use the same syntax as fenced code blocks:
1266
+ - `{#id}` - ID attribute
1267
+ - `{.class}` - Class attribute (can have multiple)
1268
+ - `key="value"` - Custom attributes with quoted values
1269
+ - `key='value'` - Custom attributes with single quotes
1270
+ - Single unbraced word is treated as a class name
1271
+
1272
+ **Examples:**
1273
+ ```markdown
1274
+ ::: {#mydiv .container}
1275
+ Content here
1276
+ :::
1277
+
1278
+ ::: sidebar
1279
+ Single unbraced word becomes a class
1280
+ :::
1281
+
1282
+ ::::: {#special .warning .important key="value"}
1283
+ Div with ID, multiple classes, and custom attribute
1284
+ :::::
1285
+
1286
+ ::::: {#special .sidebar} ::::
1287
+ Trailing colons after attributes are allowed
1288
+ ::::::::::::::::::
1289
+ ```
1290
+
1291
+ **Nested divs:**
1292
+ Fenced divs can be nested. Opening fences must have attributes:
1293
+ ```markdown
1294
+ ::: Warning ::::::
1295
+ This is a warning.
1296
+
1297
+ ::: Danger
1298
+ This is a warning within a warning.
1299
+ :::
1300
+ ::::::::::::::::::
1301
+ ```
1302
+
1303
+ **Block types:**
1304
+ By default, fenced divs create `<div>` elements. You can specify different HTML block elements using the `>blocktype` syntax:
1305
+
1306
+ ```markdown
1307
+ ::: >aside {.sidebar}
1308
+ This creates an <aside> element instead of a <div>.
1309
+ :::
1310
+
1311
+ ::: >article {#post .main}
1312
+ This creates an <article> element.
1313
+ :::
1314
+
1315
+ ::: >section {.container}
1316
+ This creates a <section> element.
1317
+ :::
1318
+ ```
1319
+
1320
+ **Common block types:**
1321
+ - `>div` - Default, creates a `<div>` element
1322
+ - `>aside` - Creates an `<aside>` element (sidebars, callouts)
1323
+ - `>article` - Creates an `<article>` element (main content)
1324
+ - `>section` - Creates a `<section>` element (document sections)
1325
+ - `>details` - Creates a `<details>` element (collapsible content)
1326
+ - `>summary` - Creates a `<summary>` element (for use inside `<details>`)
1327
+
1328
+ **Nested block types:**
1329
+ You can nest different block types:
1330
+ ```markdown
1331
+ ::: >details {.warning} :::
1332
+ :::: >summary
1333
+ This is a summary
1334
+ ::::
1335
+ This is the content of the details block
1336
+ :::
1337
+
1338
+ ::: >section {.outer}
1339
+ Outer section content.
1340
+
1341
+ ::: >aside {.inner}
1342
+ Inner aside content.
1343
+ :::
1344
+
1345
+ More outer content.
1346
+ :::
1347
+ ```
1348
+
1349
+ **Block type with unbraced class:**
1350
+ The block type syntax works with unbraced class names:
1351
+ ```markdown
1352
+ ::: >aside Warning :::
1353
+ Warning content here
1354
+ :::
1355
+ ```
1356
+ This creates `<aside class="Warning">...</aside>`.
1357
+
1358
+ **Note:** Fenced divs should be separated by blank lines from preceding and following blocks for best results.
1359
+
1360
+ **Control:**
1361
+ - Fenced divs are enabled by default in unified mode
1362
+ - Disable **Settings->Processor->Fenced Divs** to disable fenced divs processing
1363
+
1364
+ ## Related
1365
+
1366
+ - [Modes](Modes) - Which syntax is available in each mode
1367
+ - [Header IDs](Header-IDs) - Automatic header ID generation