apex-ruby 1.0.17 → 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,340 @@
1
+ # Citations and Bibliography
2
+
3
+ Apex supports citations and bibliographies with multiple syntax styles and bibliography formats. Citations are processed in **MultiMarkdown** and **unified** modes.
4
+
5
+ ## Quick Start
6
+
7
+ **1. Create a bibliography file:**
8
+
9
+ Create a BibTeX file (`references.bib`):
10
+ ```bibtex
11
+ @article{doe99,
12
+ author = {Doe, John},
13
+ title = {Article Title},
14
+ journal = {Journal Name},
15
+ year = {1999},
16
+ volume = {1},
17
+ pages = {1--10}
18
+ }
19
+
20
+ @book{smith2000,
21
+ author = {Smith, Jane},
22
+ title = {Book Title},
23
+ publisher = {Publisher},
24
+ year = {2000}
25
+ }
26
+ ```
27
+
28
+ **2. Add citations to your document:**
29
+
30
+ ```markdown
31
+ ---
32
+ bibliography: references.bib
33
+ ---
34
+
35
+ See [@doe99] for details. Smith discusses this in [@smith2000].
36
+
37
+ ## References
38
+
39
+ <!-- REFERENCES -->
40
+ ```
41
+
42
+ **3. Configure in Marked:**
43
+
44
+ You can add bibliography files to a list in **Settings->Processor->Citations**, or specify them in document metadata (as shown above). When you open a document with citations, Apex will automatically process them using the configured bibliography files.
45
+
46
+ ## Citation Syntaxes
47
+
48
+ Apex supports three citation syntax styles, automatically detected in unified mode:
49
+
50
+ ### Pandoc Syntax
51
+
52
+ Pandoc-style citations use square brackets with `@` prefix:
53
+
54
+ **Basic citation:**
55
+ ```markdown
56
+ See [@doe99] for details.
57
+ ```
58
+
59
+ **Multiple citations:**
60
+ ```markdown
61
+ See [@doe99; @smith2000; @smith2004] for more information.
62
+ ```
63
+
64
+ **Author in text:**
65
+ ```markdown
66
+ @smith04 says blah.
67
+ ```
68
+
69
+ **Author suppressed (year only):**
70
+ ```markdown
71
+ Smith says blah [-@smith04].
72
+ ```
73
+
74
+ **With locator (page numbers):**
75
+ ```markdown
76
+ @smith04 [p. 33] says blah.
77
+ See @doe99, pp. 33-35 and *passim*.
78
+ ```
79
+
80
+ **Output:**
81
+ ```html
82
+ <p>See <span class="citation" data-cites="doe99">(Doe, John 1999)</span> for details.</p>
83
+ <p>See <span class="citation" data-cites="doe99 smith2000 smith2004">(Doe, John 1999; Smith, Jane 2000, 2004)</span> for more information.</p>
84
+ <p><span class="citation" data-cites="smith04">Smith, John (2004)</span> says blah.</p>
85
+ <p>Smith says blah <span class="citation" data-cites="smith04">(2004)</span>.</p>
86
+ ```
87
+
88
+ ### MultiMarkdown Syntax
89
+
90
+ MultiMarkdown-style citations use `#` prefix:
91
+
92
+ **Basic citation:**
93
+ ```markdown
94
+ This is a statement[#Doe:2006].
95
+ ```
96
+
97
+ **With locator:**
98
+ ```markdown
99
+ This is a statement[p. 23][#Doe:2006].
100
+ ```
101
+
102
+ **Empty locator:**
103
+ ```markdown
104
+ This is a statement[][#Doe:2006].
105
+ ```
106
+
107
+ **Inline citation:**
108
+ ```markdown
109
+ As per Doe.[#John Doe. *A Totally Fake Book 1*. Vanity Press, 2006.]
110
+ ```
111
+
112
+ **Output:**
113
+ ```html
114
+ <p>This is a statement<span class="citation" data-cites="Doe:2006">(Doe:2006)</span>.</p>
115
+ <p>This is a statement[p. 23]<span class="citation" data-cites="Doe:2006">(Doe:2006)</span>.</p>
116
+ ```
117
+
118
+ ### mmark Syntax
119
+
120
+ mmark-style citations use `@` prefix (similar to Pandoc but with different conventions):
121
+
122
+ **Basic citation:**
123
+ ```markdown
124
+ This references [@RFC2535].
125
+ ```
126
+
127
+ **Normative citation:**
128
+ ```markdown
129
+ This references [@!RFC1034] (normative).
130
+ ```
131
+
132
+ **Multiple citations:**
133
+ ```markdown
134
+ Multiple citations: [@RFC1034;@RFC1035].
135
+ ```
136
+
137
+ **Combined reference:**
138
+ ```markdown
139
+ Combined reference: [@RFC1034@STD3].
140
+ ```
141
+
142
+ **Output:**
143
+ ```html
144
+ <p>This references <span class="citation" data-cites="RFC2535">(RFC2535)</span>.</p>
145
+ <p>Multiple citations: <span class="citation" data-cites="RFC1034">(RFC1034)</span>;<span class="citation" data-cites="RFC1035">(RFC1035)</span>.</p>
146
+ ```
147
+
148
+ ## Bibliography Formats
149
+
150
+ Apex supports three bibliography formats:
151
+
152
+ ### BibTeX (`.bib`)
153
+
154
+ Standard BibTeX format:
155
+
156
+ ```bibtex
157
+ @article{doe99,
158
+ author = {Doe, John},
159
+ title = {Article Title},
160
+ journal = {Journal Name},
161
+ year = {1999},
162
+ volume = {1},
163
+ pages = {1--10}
164
+ }
165
+
166
+ @book{smith2000,
167
+ author = {Smith, Jane},
168
+ title = {Book Title},
169
+ publisher = {Publisher},
170
+ year = {2000}
171
+ }
172
+ ```
173
+
174
+ ### CSL JSON (`.json`)
175
+
176
+ Citation Style Language JSON format:
177
+
178
+ ```json
179
+ [
180
+ {
181
+ "id": "doe99",
182
+ "type": "article-journal",
183
+ "title": "Article Title",
184
+ "author": [
185
+ {
186
+ "family": "Doe",
187
+ "given": "John"
188
+ }
189
+ ],
190
+ "container-title": "Journal Name",
191
+ "issued": {
192
+ "date-parts": [[1999]]
193
+ },
194
+ "volume": "1",
195
+ "page": "1-10"
196
+ }
197
+ ]
198
+ ```
199
+
200
+ ### CSL YAML (`.yml`, `.yaml`)
201
+
202
+ Citation Style Language YAML format:
203
+
204
+ ```yaml
205
+ - id: doe99
206
+ type: article-journal
207
+ title: Article Title
208
+ author:
209
+ - family: Doe
210
+ given: John
211
+ container-title: Journal Name
212
+ issued:
213
+ date-parts:
214
+ - - 1999
215
+ volume: 1
216
+ page: 1-10
217
+ ```
218
+
219
+ ## Specifying Bibliography
220
+
221
+ ### Settings Configuration
222
+
223
+ Add bibliography files to a list in **Settings->Processor->Citations**. These files will be available for all documents you process. You can add multiple files, and Apex will search through them when processing citations.
224
+
225
+ ### Document Metadata
226
+
227
+ You can also specify bibliography files in document metadata, which will override or supplement the settings:
228
+
229
+ **YAML front matter:**
230
+ ```markdown
231
+ ---
232
+ bibliography: references.bib
233
+ ---
234
+
235
+ See [@doe99] for details.
236
+ ```
237
+
238
+ **Multiple files:**
239
+ ```markdown
240
+ ---
241
+ bibliography:
242
+ - refs1.bib
243
+ - refs2.bib
244
+ ---
245
+
246
+ See [@doe99] for details.
247
+ ```
248
+
249
+ **MultiMarkdown metadata:**
250
+ ```markdown
251
+ Bibliography: references.bib
252
+
253
+ See [@doe99] for details.
254
+ ```
255
+
256
+ **Pandoc title block:**
257
+ ```markdown
258
+ % Bibliography: references.bib
259
+
260
+ See [@doe99] for details.
261
+ ```
262
+
263
+ ## Bibliography Generation
264
+
265
+ Bibliography is automatically generated from all cited entries and inserted at the `<!-- REFERENCES -->` marker:
266
+
267
+ ```markdown
268
+ See [@doe99] and [@smith2000] for details.
269
+
270
+ ## References
271
+
272
+ <!-- REFERENCES -->
273
+ ```
274
+
275
+ **Output:**
276
+ ```html
277
+ <p>See <span class="citation" data-cites="doe99">(Doe, John 1999)</span> and <span class="citation" data-cites="smith2000">(Smith, Jane 2000)</span> for details.</p>
278
+
279
+ <h2>References</h2>
280
+ <div id="refs" class="references csl-bib-body">
281
+ <div id="ref-doe99" class="csl-entry">Doe, John 1999. <em>Article Title</em>. <em>Journal Name</em> 1: 1--10</div>
282
+ <div id="ref-smith2000" class="csl-entry">Smith, Jane 2000. <em>Book Title</em>. Publisher</div>
283
+ </div>
284
+ ```
285
+
286
+ If no `<!-- REFERENCES -->` marker is found, the bibliography is appended to the end of the document.
287
+
288
+ ## Citation Options
289
+
290
+ ### Link Citations
291
+
292
+ Enable **Settings->Processor->Link Citations** to make citations link to their bibliography entries:
293
+
294
+ **Output:**
295
+ ```html
296
+ <p>See <a href="#ref-doe99" class="citation" data-cites="doe99">(Doe, John 1999)</a> for details.</p>
297
+ ```
298
+
299
+ ### Suppress Bibliography
300
+
301
+ Enable **Settings->Processor->Suppress Bibliography** to suppress bibliography output while still processing citations.
302
+
303
+ ### Citation Style (CSL)
304
+
305
+ Specify a Citation Style Language file in **Settings->Processor->CSL File** to control citation and bibliography formatting.
306
+
307
+ CSL files can also be specified in metadata:
308
+ ```markdown
309
+ ---
310
+ bibliography: refs.bib
311
+ csl: apa.csl
312
+ ---
313
+ ```
314
+
315
+ ## Mode Support
316
+
317
+ **Unified mode:**
318
+ - All citation syntaxes supported (auto-detected)
319
+ - All bibliography formats supported
320
+ - Citations enabled by default when bibliography is provided
321
+
322
+ **MultiMarkdown mode:**
323
+ - MultiMarkdown citation syntax (`[#key]`)
324
+ - All bibliography formats supported
325
+ - Citations enabled by default when bibliography is provided
326
+
327
+ **CommonMark/GFM modes:**
328
+ - Citations disabled (pure CommonMark/GFM)
329
+
330
+ **Kramdown mode:**
331
+ - Citations disabled (Kramdown uses different citation system)
332
+
333
+ ## Performance
334
+
335
+ Citations are only processed when a bibliography is actually provided (via settings or metadata). This ensures no performance impact when citations aren't being used.
336
+
337
+ ## Related
338
+
339
+ - [Syntax](Syntax) - Citation syntax reference
340
+ - [Modes](Modes) - Mode-specific citation support
@@ -0,0 +1,11 @@
1
+ # Credits
2
+
3
+ Apex builds upon the work of several excellent Markdown projects:
4
+
5
+ - [CommonMark](https://commonmark.org) - Specification and reference implementation for a standardized Markdown syntax
6
+ - [cmark-gfm](https://github.com/github/cmark-gfm) - GitHub's fork of cmark with GitHub Flavored Markdown extensions
7
+ - [Kramdown](https://kramdown.gettalong.org) - A fast and extensible Markdown processor
8
+ - [MultiMarkdown 6](https://fletcher.github.io/MultiMarkdown-6) - An extension of the Markdown syntax
9
+ - [TextIndex](https://mattgemmell.scot/) by Matt Gemmell, a syntax for creating indices
10
+
11
+ Apex brings together the best features from all of these projects into a unified, high-performance processor.
@@ -0,0 +1,234 @@
1
+ # Header IDs
2
+
3
+ Apex automatically generates unique IDs for all headers, making it easy to link to specific sections. Different processor modes use different ID generation rules.
4
+
5
+ ## Automatic Generation
6
+
7
+ By default, Apex generates header IDs automatically. You can disable this in **Settings->Processor->Generate Header IDs**.
8
+
9
+ ## ID Formats
10
+
11
+ Apex supports three ID formats, each matching the behavior of different Markdown processors. You can select the format in **Settings->Processor->Header ID Format**:
12
+
13
+ ### GFM Format (Default)
14
+
15
+ Used by default in unified and GFM modes. Matches GitHub's header ID generation:
16
+
17
+ **Rules:**
18
+ - Spaces become single dashes
19
+ - Em dashes (—) and en dashes (–) are removed
20
+ - Punctuation is removed
21
+ - Other whitespace is removed
22
+ - Diacritics are normalized to ASCII equivalents (é → e, ñ → n, etc.)
23
+ - **Emojis are converted to their textual names** (e.g., 😄 → "smile", 🚀 → "rocket")
24
+ - Leading and trailing dashes are trimmed
25
+ - Result is lowercased
26
+
27
+ **Examples:**
28
+ ```markdown
29
+ # Emoji Support
30
+ → id="emoji-support"
31
+
32
+ # 😄 Emoji Support
33
+ → id="smile-emoji-support"
34
+
35
+ # 🚀
36
+ → id="rocket"
37
+
38
+ # 👍 👎
39
+ → id="thumbsup-thumbsdown"
40
+
41
+ # Hello—World
42
+ → id="helloworld"
43
+
44
+ # C++ Programming
45
+ → id="c-programming"
46
+
47
+ # Déjà Vu
48
+ → id="deja-vu"
49
+ ```
50
+
51
+ **Note:** Emoji-to-name conversion matches Pandoc's GFM behavior, ensuring emojis in headers are represented as readable text in IDs. This only applies to GFM format; MMD and Kramdown formats preserve emojis as-is or remove them according to their respective rules.
52
+
53
+ ### MultiMarkdown Format
54
+
55
+ Used in MultiMarkdown mode. Preserves dashes and diacritics:
56
+
57
+ **Rules:**
58
+ - Spaces are removed (not converted to dashes)
59
+ - All dash types (regular, em, en) are preserved
60
+ - Diacritics are preserved (UTF-8)
61
+ - Punctuation is removed
62
+ - Leading and trailing dashes are preserved
63
+ - Result is lowercased
64
+
65
+ **Examples:**
66
+ ```markdown
67
+ # Header—One
68
+ → id="header—one"
69
+
70
+ # Hello World
71
+ → id="helloworld"
72
+
73
+ # Déjà Vu
74
+ → id="déjà-vu"
75
+ ```
76
+
77
+ ### Kramdown Format
78
+
79
+ Used in Kramdown mode. More aggressive punctuation handling:
80
+
81
+ **Rules:**
82
+ - Spaces become single dashes (one dash per space)
83
+ - Em dashes (—) and en dashes (–) are removed
84
+ - Diacritics are removed (not normalized)
85
+ - Punctuation becomes dashes (except trailing punctuation is removed)
86
+ - If punctuation is followed by a space, the space is skipped
87
+ - Leading dashes are trimmed
88
+ - Trailing dashes are preserved
89
+ - Result is lowercased
90
+
91
+ **Examples:**
92
+ ```markdown
93
+ # Hello, World!
94
+ → id="hello-world"
95
+
96
+ # C++ Programming
97
+ → id="c-programming"
98
+
99
+ # Test (Example)
100
+ → id="test-example"
101
+ ```
102
+
103
+ ## Setting ID Format
104
+
105
+ ### By Mode
106
+
107
+ Each mode automatically sets the appropriate ID format:
108
+ - GFM mode → GFM format
109
+ - MultiMarkdown mode → MultiMarkdown format
110
+ - Kramdown mode → Kramdown format
111
+ - Unified mode → GFM format (default)
112
+
113
+ ### Override in Unified Mode
114
+
115
+ In unified mode, you can override the default GFM format by selecting a different option in **Settings->Processor->Header ID Format**:
116
+
117
+ - GFM format (default)
118
+ - MultiMarkdown format
119
+ - Kramdown format
120
+
121
+ ## Manual Header IDs
122
+
123
+ You can manually specify header IDs using several syntaxes:
124
+
125
+ ### MultiMarkdown Syntax
126
+
127
+ ```markdown
128
+ ### Heading 1 [heading1]
129
+ ```
130
+
131
+ ### Kramdown Syntax
132
+
133
+ ```markdown
134
+ ### Heading 1 {#heading1}
135
+ ```
136
+
137
+ ### Inline Attribute List (IAL)
138
+
139
+ ```markdown
140
+ ### Heading 1 {: #heading1}
141
+ ```
142
+
143
+ Manual IDs take precedence over auto-generated IDs.
144
+
145
+ ## Anchor Tags vs. IDs
146
+
147
+ By default, Apex adds `id` attributes directly to header elements:
148
+
149
+ ```html
150
+ <h1 id="my-header">My Header</h1>
151
+ ```
152
+
153
+ You can generate `<a>` anchor tags instead by enabling **Settings->Processor->Header Anchors**:
154
+
155
+ This produces:
156
+
157
+ ```html
158
+ <h1><a id="my-header" href="#my-header">My Header</a></h1>
159
+ ```
160
+
161
+ This format is compatible with some Markdown processors that use anchor tags.
162
+
163
+ ## Examples
164
+
165
+ ### GFM Format
166
+
167
+ ```markdown
168
+ # Getting Started with Apex
169
+ # Advanced Features
170
+ # C++ Integration
171
+ ```
172
+
173
+ Becomes:
174
+
175
+ ```html
176
+ <h1 id="getting-started-with-apex">Getting Started with Apex</h1>
177
+ <h1 id="advanced-features">Advanced Features</h1>
178
+ <h1 id="c-integration">C Integration</h1>
179
+ ```
180
+
181
+ ### MultiMarkdown Format
182
+
183
+ ```markdown
184
+ # Getting Started with Apex
185
+ # Advanced Features
186
+ # C++ Integration
187
+ ```
188
+
189
+ With MultiMarkdown format selected:
190
+
191
+ ```html
192
+ <h1 id="gettingstartedwithapex">Getting Started with Apex</h1>
193
+ <h1 id="advancedfeatures">Advanced Features</h1>
194
+ <h1 id="cintegration">C Integration</h1>
195
+ ```
196
+
197
+ ### Kramdown Format
198
+
199
+ ```markdown
200
+ # Getting Started with Apex
201
+ # Advanced Features
202
+ # C++ Integration
203
+ ```
204
+
205
+ With Kramdown format selected:
206
+
207
+ ```html
208
+ <h1 id="getting-started-with-apex">Getting Started with Apex</h1>
209
+ <h1 id="advanced-features">Advanced Features</h1>
210
+ <h1 id="c-integration">C Integration</h1>
211
+ ```
212
+
213
+ ## Linking to Headers
214
+
215
+ Once headers have IDs, you can link to them:
216
+
217
+ ```markdown
218
+ [Link to section](#getting-started-with-apex)
219
+ ```
220
+
221
+ Or with wiki links (requires wiki links to be enabled in **Settings->Processor->Wiki Links**):
222
+
223
+ ```markdown
224
+ [[Document#getting-started-with-apex]]
225
+ ```
226
+
227
+ ## Table of Contents
228
+
229
+ Apex's TOC generation automatically uses the same ID format as your headers. See [Syntax](Syntax) for TOC details.
230
+
231
+ ## Related
232
+
233
+ - [Modes](Modes) - How modes affect ID generation
234
+ - [Syntax](Syntax) - Manual ID syntax