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.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/ext/apex_ext/apex_ext.c +260 -91
- data/ext/apex_ext/apex_src/CHANGELOG.md +440 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +15 -1
- data/ext/apex_ext/apex_src/Formula/apex.rb +7 -2
- data/ext/apex_ext/apex_src/Package.swift +15 -4
- data/ext/apex_ext/apex_src/README.md +94 -35
- data/ext/apex_ext/apex_src/VERSION +1 -1
- data/ext/apex_ext/apex_src/apex-debug.log +4 -0
- data/ext/apex_ext/apex_src/apex.code-workspace +38 -0
- data/ext/apex_ext/apex_src/apex.taskpaper +12 -0
- data/ext/apex_ext/apex_src/apex_deflist_debug.log +25 -0
- data/ext/apex_ext/apex_src/buildnotes.md +1435 -0
- data/ext/apex_ext/apex_src/cli/main.c +262 -33
- data/ext/apex_ext/apex_src/debug.log +7 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +274 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +749 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +744 -0
- data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +382 -0
- data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +351 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +745 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +829 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +1148 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +161 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +184 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +211 -0
- data/ext/apex_ext/apex_src/documentation/app-settings-table.md +67 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +340 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +11 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +234 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +516 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +461 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +193 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +201 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +678 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +1367 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +6 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +774 -300
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +1194 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +416 -216
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3544 -1094
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +371 -97
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +153 -23
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +358 -124
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +1656 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +1226 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +201 -56
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +279 -109
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +200 -53
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +2327 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +690 -271
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +201 -55
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +238 -68
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +421 -221
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +340 -78
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +251 -86
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +1362 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +277 -90
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +673 -346
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +1405 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +1902 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +1939 -1698
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +1781 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +315 -140
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +307 -113
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +1132 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +1754 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +872 -376
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +8746 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +20 -15
- data/ext/apex_ext/apex_src/documentation/transform_for_app.md +55 -0
- data/ext/apex_ext/apex_src/escaping-repro.md +103 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +8 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +547 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/README.md +33 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +92 -6
- data/ext/apex_ext/apex_src/include/apex/ast_rtf.h +23 -0
- data/ext/apex_ext/apex_src/include/apex/ast_terminal.h +6 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +5 -0
- data/ext/apex_ext/apex_src/include/apex/plugins.h +105 -0
- data/ext/apex_ext/apex_src/include/apexc.h +1 -0
- data/ext/apex_ext/apex_src/man/apex.1 +82 -78
- data/ext/apex_ext/apex_src/man/apex.1.md +81 -4
- data/ext/apex_ext/apex_src/objc/Apex.swift +73 -0
- data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +79 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +83 -5
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +244 -1
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +76 -0
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +169 -0
- data/ext/apex_ext/apex_src/output.html +87 -0
- data/ext/apex_ext/apex_src/plans/quarto-mode.md +442 -0
- data/ext/apex_ext/apex_src/src/_README.md +85 -32
- data/ext/apex_ext/apex_src/src/apex.c +770 -200
- data/ext/apex_ext/apex_src/src/ast_rtf.c +848 -0
- data/ext/apex_ext/apex_src/src/ast_terminal.c +184 -7
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +10 -3
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +7 -11
- data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.c +467 -0
- data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.h +27 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +400 -4
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +15 -5
- data/ext/apex_ext/apex_src/src/extensions/citations.c +26 -5
- data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.c +632 -0
- data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.h +22 -0
- data/ext/apex_ext/apex_src/src/extensions/concordance.c +632 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +129 -15
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1050 -121
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +569 -16
- data/ext/apex_ext/apex_src/src/extensions/ial.c +502 -52
- data/ext/apex_ext/apex_src/src/extensions/ial.h +2 -1
- data/ext/apex_ext/apex_src/src/extensions/includes.c +532 -33
- data/ext/apex_ext/apex_src/src/extensions/includes.h +7 -1
- data/ext/apex_ext/apex_src/src/extensions/index.c +1427 -140
- data/ext/apex_ext/apex_src/src/extensions/index.h +28 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +200 -161
- data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.c +251 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.h +22 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_lists.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_lists.h +35 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_polish.c +264 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_polish.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.c +307 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.h +21 -0
- data/ext/apex_ext/apex_src/src/extensions/raw_content.c +351 -0
- data/ext/apex_ext/apex_src/src/extensions/raw_content.h +20 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +117 -3
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +53 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +23 -1
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +83 -92
- data/ext/apex_ext/apex_src/src/extensions/toc.c +446 -25
- data/ext/apex_ext/apex_src/src/extensions/toc.h +26 -1
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +28 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +387 -17
- data/ext/apex_ext/apex_src/src/plugin_catalog.c +517 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +88 -14
- data/ext/apex_ext/apex_src/src/plugins_remote.h +34 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +6 -1
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +21 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +10 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +19 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +46 -0
- data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +47 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +19 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +81 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +47 -0
- data/ext/apex_ext/apex_src/tests/fixtures/speed.md +192 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +37 -0
- data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +16 -0
- data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +301 -0
- data/ext/apex_ext/apex_src/tests/test_concordance.tsv +4 -0
- data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +82 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +821 -1
- data/ext/apex_ext/apex_src/tests/test_ial.c +7 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +25 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +129 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +568 -2
- data/ext/apex_ext/apex_src/tests/test_runner.c +11 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +420 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +1 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +77 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +135 -5
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +56 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +1 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +69 -0
- data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +74 -0
- data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +22 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +44 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +128 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +5118 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +99 -0
- data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +452 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +52 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +55 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +2455 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +171 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +55 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +220 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +43 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +7 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +76 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +10 -0
- data/ext/apex_ext/extconf.rb +35 -0
- data/lib/apex/version.rb +2 -2
- metadata +117 -2
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
|
@@ -42,7 +42,17 @@ If \fR$APEX_PAGER\f[] is set and non\-empty, Apex uses its value as the pager.
|
|
|
42
42
|
Otherwise, if \fR$PAGER\f[] is set and non\-empty, Apex uses that.
|
|
43
43
|
|
|
44
44
|
.IP \(bu 2
|
|
45
|
-
Otherwise, Apex falls back to \fRless \-R\f[]. Pagination is ignored when the output format is not a terminal format or when \fR\-o/\-\-output\f[] is used to write to a file. You can also enable pagination via metadata or config by setting \fRpaginate: true\f[].
|
|
45
|
+
Otherwise, Apex falls back to \fRless \-R\f[]. Pagination is ignored when the output format is not a terminal format or when \fR\-o/\-\-output\f[] is used to write to a file. You can also enable pagination via metadata or config by setting \fRpaginate: true\f[]. When pagination is enabled and the rendered output contains inline terminal graphics (iTerm \f[B]imgcat\f[] / OSC 1337 sequences or Kitty graphics), Apex automatically skips the pager and writes directly to stdout, because \f[B]\fRless \-R\f[]\f[] and most pagers only support ANSI color, not inline image protocols. A short notice is printed to stderr.
|
|
46
|
+
|
|
47
|
+
.TP
|
|
48
|
+
\f[B]\-\-paginate\-symbols\f[]
|
|
49
|
+
Page terminal output (same pager selection as \f[B]\-\-paginate\f[]) and render
|
|
50
|
+
Markdown images as \f[B]chafa\f[] ANSI block art (\fRchafa \-f symbols\f[]) so images display correctly in \f[B]\fRless \-R\f[]\f[]. Requires \f[B]chafa\f[] on \f[B]PATH\f[]. With \f[B]\-\-to terminal256\f[], Apex passes \fR\-c 256\f[] to chafa; with \f[B]\-\-to terminal\f[], \fR\-c 16\f[]. Equivalent to metadata \fRpaginate: symbols\f[]. Implies pagination is enabled.
|
|
51
|
+
|
|
52
|
+
.TP
|
|
53
|
+
\f[B]\-\-no\-paginate\f[]
|
|
54
|
+
Do not page terminal output. Overrides \f[B]\-p\f[] / \f[B]\-\-paginate\f[] and
|
|
55
|
+
\fRpaginate: true\f[] or \fRpaginate: symbols\f[] from metadata or config.
|
|
46
56
|
|
|
47
57
|
.TP
|
|
48
58
|
\f[B]\-\-theme\f[] NAME
|
|
@@ -54,7 +64,20 @@ Disable inline terminal rendering of Markdown images for \f[B]\-\-to terminal\f[
|
|
|
54
64
|
|
|
55
65
|
.TP
|
|
56
66
|
\f[B]\-\-terminal\-image\-width\f[] N
|
|
57
|
-
Maximum width in character cells passed to the image viewer (default: 50).
|
|
67
|
+
Maximum width in character cells passed to the image viewer (default: 50).
|
|
68
|
+
When \f[B]stdout\f[] is a TTY and inline images are enabled, Apex selects a viewer on \f[B]PATH\f[] as follows:
|
|
69
|
+
|
|
70
|
+
.IP \(bu 2
|
|
71
|
+
\f[B]imgcat\f[] \[em] only when \f[B]TERM_PROGRAM\f[] indicates iTerm2 (iTerm inline\-image protocol).
|
|
72
|
+
|
|
73
|
+
.IP \(bu 2
|
|
74
|
+
\f[B]chafa\f[] \[em] otherwise, if available (\fR\-f\f[] format depends on terminal: \f[B]iterm\f[] on iTerm/WezTerm, \f[B]kitty\f[] on Kitty, \f[B]symbols\f[] on other terminals).
|
|
75
|
+
|
|
76
|
+
.IP \(bu 2
|
|
77
|
+
\f[B]catimg\f[] \[em] if chafa is not found.
|
|
78
|
+
|
|
79
|
+
.IP \(bu 2
|
|
80
|
+
\f[B]viu\f[] \[em] if neither chafa nor catimg is found. For \fRhttp://\f[] and \fRhttps://\f[] image URLs, Apex downloads with \f[B]curl\f[] (60 second timeout, 10 MiB maximum size) to a file under \f[B]$TMPDIR\f[] or \fR/tmp\f[], then displays it. If \f[B]curl\f[] is missing, download fails, no viewer is found, \f[B]stdout\f[] is not a TTY, or \f[B]\-\-no\-terminal\-images\f[] is set, images are emitted as styled link text and URL (like hyperlinks), not as Markdown \fR\f[] syntax. When \f[B]\-\-paginate\-symbols\f[] or \fRpaginate: symbols\f[] is active, Apex always uses \f[B]chafa\f[] with \fR\-f symbols\f[] for images so pager output remains compatible with \f[B]less \-R\f[].
|
|
58
81
|
|
|
59
82
|
.TP
|
|
60
83
|
\f[B]\-\-code\-highlight\f[] TOOL
|
|
@@ -92,14 +115,13 @@ Pretty\-print HTML with indentation and whitespace.
|
|
|
92
115
|
.TP
|
|
93
116
|
\f[B]\-\-aria\f[]
|
|
94
117
|
Add ARIA labels and accessibility attributes to HTML
|
|
95
|
-
output. When enabled, adds: \fRaria\-label="Table of contents"\f[] to TOC navigation elements (\fR<nav class="toc">\f[]) \- \fRrole="figure"\f[] to \fR<figure>\f[] elements \- \fRrole="table"\f[] to \fR<table>\f[] elements table figures (if missing)
|
|
118
|
+
output. When enabled, adds: \fRaria\-label="Table of contents"\f[] to TOC navigation elements (\fR<nav class="toc">\f[]) \- \fRrole="figure"\f[] to \fR<figure>\f[] elements \- \fRrole="table"\f[] to \fR<table>\f[] elements \- \fRid\f[] attributes to \fR<figcaption>\f[] elements within table figures (if missing)
|
|
96
119
|
|
|
97
120
|
.PP
|
|
98
121
|
.nf
|
|
99
122
|
\fR
|
|
100
|
-
\- `id` attributes to `<figcaption>` elements within
|
|
101
|
-
to their captions
|
|
102
123
|
\- `aria\-describedby` attributes to tables linking them
|
|
124
|
+
to their captions
|
|
103
125
|
|
|
104
126
|
\f[]
|
|
105
127
|
.fi
|
|
@@ -126,6 +148,9 @@ Output format. One of:
|
|
|
126
148
|
.IP \(bu 2
|
|
127
149
|
\f[B]markdown\f[], \f[B]md\f[], \f[B]mmd\f[], \f[B]commonmark\f[], \f[B]cmark\f[], \f[B]kramdown\f[], \f[B]gfm\f[] \- Markdown variants
|
|
128
150
|
|
|
151
|
+
.IP \(bu 2
|
|
152
|
+
\f[B]toc\f[] \- Markdown unordered list of heading links only (default depth \f[B]#\f[]\-\-\f[B]###\f[])
|
|
153
|
+
|
|
129
154
|
.IP \(bu 2
|
|
130
155
|
\f[B]terminal\f[], \f[B]cli\f[], \f[B]terminal256\f[] \- ANSI\-colored output for TTYs and terminal emulators
|
|
131
156
|
|
|
@@ -133,7 +158,15 @@ Output format. One of:
|
|
|
133
158
|
\f[B]man\f[] \- Man page roff source (.TH, .SH, etc.)
|
|
134
159
|
|
|
135
160
|
.IP \(bu 2
|
|
136
|
-
\f[B]man\-html\f[] \- Styled HTML man page (use \f[B]\-\-standalone\f[] for full page with nav sidebar)
|
|
161
|
+
\f[B]man\-html\f[] \- Styled HTML man page (use \f[B]\-\-standalone\f[] for full page with nav sidebar)
|
|
162
|
+
|
|
163
|
+
.IP \(bu 2
|
|
164
|
+
\f[B]rtf\f[] \- Rich Text Format (native writer; write to a \fR.rtf\f[] file for best results) When using a terminal format, Apex emits ANSI\-colored output suitable for TTYs and terminal emulators.
|
|
165
|
+
|
|
166
|
+
.TP
|
|
167
|
+
\f[B]\-\-toc\-min\-max\f[] MIN,MAX
|
|
168
|
+
Inclusive heading depth for \f[B]\-\-to toc\f[] and for HTML TOC markers without an
|
|
169
|
+
explicit range. The default is \f[B]1,3\f[], which includes headings from \f[B]#\f[] through \f[B]###\f[]. Marker syntax with an explicit range, such as \fR{{TOC:2\-5}}\f[], overrides this setting. Values must satisfy \fR1 <= MIN <= MAX <= 6\f[].
|
|
137
170
|
|
|
138
171
|
.SS Feature Flags
|
|
139
172
|
|
|
@@ -248,10 +281,7 @@ Enable relaxed table parsing (no separator rows required).
|
|
|
248
281
|
.SS HTML and Links
|
|
249
282
|
|
|
250
283
|
.PP
|
|
251
|
-
\fRdash\f[] \- Convert spaces to dashes: \fR[[Home Page]]\f[] → \fRhref="Home\-Page"\f[] \fRnone\f[] \- Remove spaces: \fR[[Home Page]]\f[] → \fRhref="HomePage"\f[] \fRunderscore\f[] \- Convert spaces to underscores: \fR[[Home Page]]\f[] → \fRhref="Home_Page"\f[] Default: \fRdash\f[].
|
|
252
|
-
|
|
253
|
-
.PP
|
|
254
|
-
\fRspace\f[] \- Keep spaces (rendered as \fR%%20\f[] in HTML): \fR[[Home Page]]\f[] → \fRhref="Home%20Page"\f[]
|
|
284
|
+
\fRdash\f[] \- Convert spaces to dashes: \fR[[Home Page]]\f[] → \fRhref="Home\-Page"\f[] \fRnone\f[] \- Remove spaces: \fR[[Home Page]]\f[] → \fRhref="HomePage"\f[] \fRunderscore\f[] \- Convert spaces to underscores: \fR[[Home Page]]\f[] → \fRhref="Home_Page"\f[] \fRspace\f[] \- Keep spaces (rendered as \fR%%20\f[] in HTML): \fR[[Home Page]]\f[] → \fRhref="Home%20Page"\f[] Default: \fRdash\f[].
|
|
255
285
|
|
|
256
286
|
.TP
|
|
257
287
|
\f[B]\-\-wikilink\-sanitize\f[], \f[B]\-\-no\-wikilink\-sanitize\f[]
|
|
@@ -283,15 +313,7 @@ Removes leading and trailing space\-mode characters For example, with \fR\-\-wik
|
|
|
283
313
|
.SS Path Resolution
|
|
284
314
|
|
|
285
315
|
.PP
|
|
286
|
-
\f[B]\-\-base\-dir\f[] \f[I]DIR\f[] : Base directory for resolving relative paths. Used for: \- Image embedding (with \f[B]\-\-embed\-images\f[]) \- File includes/transclusions when the working directory differs from the document location
|
|
287
|
-
|
|
288
|
-
.PP
|
|
289
|
-
.nf
|
|
290
|
-
\fR
|
|
291
|
-
\- Relative path resolution when reading from stdin or
|
|
292
|
-
|
|
293
|
-
\f[]
|
|
294
|
-
.fi
|
|
316
|
+
\f[B]\-\-base\-dir\f[] \f[I]DIR\f[] : Base directory for resolving relative paths. Used for: \- Image embedding (with \f[B]\-\-embed\-images\f[]) \- File includes/transclusions \- Relative path resolution when reading from stdin or when the working directory differs from the document location
|
|
295
317
|
|
|
296
318
|
.PP
|
|
297
319
|
If not specified and reading from a file, the base directory is automatically set to the input file's directory. When reading from stdin, this flag must be used to resolve relative paths.
|
|
@@ -307,7 +329,7 @@ If not specified and reading from a file, the base directory is automatically se
|
|
|
307
329
|
aside {.sidebar} … :::\fRcreates an\f[]` element instead). Opening fences must have at least 3 colons and attributes; closing fences need at least 3 colons. Fenced divs can be nested, including different block types. Default: enabled in unified mode only.
|
|
308
330
|
|
|
309
331
|
|
|
310
|
-
\f[B]\-\-spans\f[], \f[B]\-\-no\-spans\f[] : Enable or disable Pandoc\-style bracketed spans syntax (\fR[text]{#id .class key="val"}\f[]). Bracketed spans allow you to create HTML \fR<span>\f[] elements with attributes. The text inside the brackets is processed as markdown. If the bracketed text matches a reference link definition, it will be treated as a link instead of a span. Default: enabled in unified mode only.
|
|
332
|
+
\f[B]\-\-py\-callouts\f[], \f[B]\-\-no\-py\-callouts\f[] : Enable or disable Python\-Markdown callout syntax (\fR!!! note "Optional Title"\f[] followed by indented content) and markdown\-callouts label syntax (\fRNOTE: ...\f[], \fR>? NOTE: ...\f[] for collapsed callouts). Disabled by default to avoid ambiguity with regular markdown prose. \f[B]\-\-quarto\-callouts\f[], \f[B]\-\-no\-quarto\-callouts\f[] : Enable or disable Quarto callout syntax using fenced div markers (\fR::: {.callout\-note}\f[] ... \fR:::\f[]). When enabled, recognized Quarto callout blocks bypass generic fenced\-div conversion and are rendered as callouts; non\-callout fenced divs continue to be processed as regular Pandoc fenced divs. \f[B]\-\-spans\f[], \f[B]\-\-no\-spans\f[] : Enable or disable Pandoc\-style bracketed spans syntax (\fR[text]{#id .class key="val"}\f[]). Bracketed spans allow you to create HTML \fR<span>\f[] elements with attributes. The text inside the brackets is processed as markdown. If the bracketed text matches a reference link definition, it will be treated as a link instead of a span. Default: enabled in unified mode only.
|
|
311
333
|
|
|
312
334
|
.SS Citations and Bibliography
|
|
313
335
|
|
|
@@ -326,13 +348,16 @@ mmark: \fR[@RFC1234]\f[] Bibliography is inserted at the \fR<!\-\- REFERENCES \-
|
|
|
326
348
|
.SS Indices
|
|
327
349
|
|
|
328
350
|
.PP
|
|
329
|
-
\f[B]\-\-
|
|
351
|
+
\f[B]\-\-concordance\f[] \f[I]FILE\f[] : TextIndex concordance file (tab\-separated). Searches the document for each rule's column\-1 pattern and inserts \fR[match]{^col2}\f[] index marks before TextIndex processing. Can be specified multiple times. Enables indices and TextIndex syntax when used. Matches inside existing index marks, \fR{index}\f[] directives, and HTML tags are skipped. See https://mattgemmell.scot/textindex/#concordance\-files (https://mattgemmell.scot/textindex/#concordance\-files) for the concordance file format.
|
|
352
|
+
|
|
353
|
+
.PP
|
|
354
|
+
\f[B]\-\-indices\f[] : Enable index processing. Supports both mmark and TextIndex syntax. Default: enabled in MultiMarkdown and unified modes.
|
|
330
355
|
|
|
331
356
|
.PP
|
|
332
|
-
|
|
357
|
+
\f[B]\-\-no\-indices\f[] : Disable index processing. \f[B]\-\-no\-index\f[] : Suppress index generation at the end of the document. Index markers are still created in the document, but the index section is not generated.
|
|
333
358
|
|
|
334
359
|
.PP
|
|
335
|
-
|
|
360
|
+
Index syntax is supported in MultiMarkdown and unified modes:
|
|
336
361
|
|
|
337
362
|
.IP \(bu 2
|
|
338
363
|
\f[B]mmark syntax\f[]: \fR(!item)\f[], \fR(!item, subitem)\f[], \fR(!!item, subitem)\f[] for primary entries
|
|
@@ -343,126 +368,100 @@ mmark: \fR[@RFC1234]\f[] Bibliography is inserted at the \fR<!\-\- REFERENCES \-
|
|
|
343
368
|
.SS AST Filters
|
|
344
369
|
|
|
345
370
|
.PP
|
|
346
|
-
\f[B]\-\-filter\f[] \f[I]NAME\f[] (\fR$XDG_CONFIG_HOME/apex/filters\f[] or \fR~/.config/apex/filters\f[]). \f[I]NAME\f[] is the basename of an executable that reads Pandoc JSON from stdin and writes Pandoc JSON to stdout.
|
|
371
|
+
\f[B]\-\-filter\f[] \f[I]NAME\f[] : Run a single AST filter from the user filters directory (\fR$XDG_CONFIG_HOME/apex/filters\f[] or \fR~/.config/apex/filters\f[]). \f[I]NAME\f[] is the basename of an executable that reads Pandoc JSON from stdin and writes Pandoc JSON to stdout.
|
|
347
372
|
|
|
348
373
|
.PP
|
|
349
|
-
: Run
|
|
374
|
+
\f[B]\-\-filters\f[] : Run all executable files in the user filters directory, in sorted filename order. Directory filters run first if \f[B]\-\-filter\f[] is also used.
|
|
350
375
|
|
|
351
376
|
.PP
|
|
352
|
-
: Run
|
|
377
|
+
\f[B]\-\-lua\-filter\f[] \f[I]FILE\f[] : Run a Lua script as an AST filter. Apex invokes the system \f[B]lua\f[] interpreter with \f[I]FILE\f[]. The script reads a Pandoc JSON document from stdin and must write a Pandoc JSON document to stdout. A JSON library (e.g. dkjson) is required; see the Filters documentation for details.
|
|
353
378
|
|
|
354
379
|
.PP
|
|
355
|
-
|
|
380
|
+
\f[B]\-\-no\-strict\-filters\f[] : Do not abort when a filter fails or returns invalid JSON; log a warning and continue with the previous AST. Default: abort on error.
|
|
356
381
|
|
|
357
382
|
.PP
|
|
358
|
-
|
|
383
|
+
\f[B]\-\-list\-filters\f[] : List installed filters and available filters from the central apex\-filters directory. Shows filter IDs; available filters show title, author, description, and homepage.
|
|
359
384
|
|
|
360
385
|
.PP
|
|
361
|
-
|
|
386
|
+
\f[B]\-\-install\-filter\f[] \f[I]ID\-or\-URL\f[] : Install an AST filter into the user filters directory. \f[I]ID\-or\-URL\f[] may be a filter ID from the central apex\-filters directory (e.g. \f[B]unwrap\f[]) or a Git URL / GitHub shorthand. When installing from a URL, Apex may prompt for confirmation.
|
|
362
387
|
|
|
363
388
|
.PP
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
.PP
|
|
367
|
-
: Uninstall a filter by ID. Removes the filter (file or directory)
|
|
389
|
+
\f[B]\-\-uninstall\-filter\f[] \f[I]ID\f[] : Uninstall a filter by ID. Removes the filter (file or directory) from the user filters directory. Apex prompts for confirmation.
|
|
368
390
|
|
|
369
391
|
.SS Plugins
|
|
370
392
|
|
|
371
393
|
.PP
|
|
372
|
-
\f[B]\-\-plugins\f[], \f[B]\-\-no\-plugins\f[] extend Apex with custom processing capabilities.
|
|
394
|
+
\f[B]\-\-plugins\f[], \f[B]\-\-no\-plugins\f[] : Enable or disable external/plugin processing. Plugins extend Apex with custom processing capabilities.
|
|
373
395
|
|
|
374
396
|
.PP
|
|
375
|
-
|
|
397
|
+
\f[B]\-\-list\-plugins\f[] : List installed plugins and available plugins from the remote directory. Shows both locally installed plugins and plugins available for installation from the Apex plugin directory.
|
|
376
398
|
|
|
377
399
|
.PP
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
.PP
|
|
381
|
-
: Uninstall a plugin by ID. Removes the plugin directory
|
|
400
|
+
\f[B]\-\-install\-plugin\f[] \f[I]ID\f[] : Install a plugin by ID from the remote directory, or by Git URL/GitHub shorthand (user/repo). Plugins are installed to \fR$XDG_CONFIG_HOME/apex/plugins\f[] (or \fR<sub>/</sub>.config/apex/plugins\f[] when \fRXDG_CONFIG_HOME\f[] is not set). When installing from a URL or GitHub shorthand, Apex will prompt for confirmation since plugins execute unverified code. \f[B]\-\-uninstall\-plugin\f[] \f[I]ID\f[] : Uninstall a plugin by ID. Removes the plugin directory from the plugins folder. Apex will prompt for confirmation before removing the plugin.
|
|
382
401
|
|
|
383
402
|
.SS General Options
|
|
384
403
|
|
|
385
404
|
.PP
|
|
386
405
|
\f[B]\-h\f[], \f[B]\-\-help\f[] : Show help message and exit. \f[B]\-v\f[], \f[B]\-\-version\f[] : Show version information and exit. \f[B]\-\-progress\f[], \f[B]\-\-no\-progress\f[] : Show progress indicator during processing. Default: enabled when stderr is a TTY.
|
|
387
406
|
|
|
388
|
-
.PP
|
|
389
|
-
\f[B]\-i\f[], \f[B]\-\-info\f[] : Print version, merged config metadata (global and project \fRconfig.yml\f[], plus \f[B]\-\-meta\-file\f[] and \f[B]\-\-meta\f[] when given) as YAML, and the plugin IDs that would load when plugins are enabled. Without input files, writes to stdout and exits. With files or \f[B]\-\-combine\f[]/\f[B]\-\-mmd\-merge\f[], writes to stderr first, then continues.
|
|
390
|
-
|
|
391
|
-
.PP
|
|
392
|
-
\f[B]\-\-extract\-meta\f[] : Merge document metadata from input files in order (later overrides; respects \f[B]\-\-mode\f[]), print YAML to stdout, and exit. Requires at least one file (\f[B]\-\-combine\f[] file list counts). Incompatible with \f[B]\-\-mmd\-merge\f[].
|
|
393
|
-
|
|
394
|
-
.PP
|
|
395
|
-
\f[B]\-e\f[], \f[B]\-\-extract\-meta\-value\f[] \f[I]KEY\f[] : Same merge as \f[B]\-\-extract\-meta\f[] but print only the value for \f[I]KEY\f[]. Exit status is non\-zero if the key is absent.
|
|
396
|
-
|
|
397
407
|
.SS Multi\-file Utilities
|
|
398
408
|
|
|
399
409
|
.PP
|
|
400
|
-
\f[B]\-\-combine\f[] \f[I]files...\f[] Markdown stream, expanding all supported include syntaxes. When a \fRSUMMARY.md\f[] file is provided, Apex treats it as a GitBook\-style index and combines the linked files in order. Output is raw Markdown suitable for piping back into Apex.
|
|
401
|
-
|
|
402
|
-
.PP
|
|
403
|
-
: Concatenate one or more Markdown files into a single \f[B]\-\-mmd\-merge\f[] \f[I]index files...\f[] apex \-\-mmd\-merge index.txt | apex \-\-mode mmd \-\-standalone \-o book.html
|
|
410
|
+
\f[B]\-\-combine\f[] \f[I]files...\f[] : Concatenate one or more Markdown files into a single Markdown stream, expanding all supported include syntaxes. When a \fRSUMMARY.md\f[] file is provided, Apex treats it as a GitBook\-style index and combines the linked files in order. Output is raw Markdown suitable for piping back into Apex.
|
|
404
411
|
|
|
405
412
|
.PP
|
|
406
|
-
: Merge files from one or more MultiMarkdown \fRmmd_merge\f[]\-style index files into a single Markdown stream. Each non\-empty, non\-comment line in an index file specifies a document to include. Lines whose first non\-whitespace character is \fR#\f[] are treated as comments and ignored. Indentation (tabs or groups of four spaces) before the filename increases the header level of the included document (each indent level shifts all Markdown headings in that file down one level). Output is raw Markdown suitable for piping into Apex, for example:
|
|
413
|
+
\f[B]\-\-mmd\-merge\f[] \f[I]index files...\f[] : Merge files from one or more MultiMarkdown \fRmmd_merge\f[]\-style index files into a single Markdown stream. Each non\-empty, non\-comment line in an index file specifies a document to include. Lines whose first non\-whitespace character is \fR#\f[] are treated as comments and ignored. Indentation (tabs or groups of four spaces) before the filename increases the header level of the included document (each indent level shifts all Markdown headings in that file down one level). Output is raw Markdown suitable for piping into Apex, for example: apex \-\-mmd\-merge index.txt | apex \-\-mode mmd \-\-standalone \-o book.html
|
|
407
414
|
|
|
408
415
|
.SH EXAMPLES
|
|
409
416
|
|
|
410
417
|
.PP
|
|
411
|
-
.
|
|
412
|
-
\fR
|
|
413
|
-
apex input.md
|
|
414
|
-
|
|
415
|
-
\f[]
|
|
416
|
-
.fi
|
|
417
|
-
|
|
418
|
-
.PP
|
|
419
|
-
Process a markdown file: apex input.md \-o output.html
|
|
418
|
+
Process a markdown file: apex input.md
|
|
420
419
|
|
|
421
420
|
.PP
|
|
422
|
-
Output to a file: apex input.md
|
|
421
|
+
Output to a file: apex input.md \-o output.html
|
|
423
422
|
|
|
424
423
|
.PP
|
|
425
|
-
Generate standalone HTML document: apex input.md \-\-
|
|
424
|
+
Generate standalone HTML document: apex input.md \-\-standalone \-\-title "My Document"
|
|
426
425
|
|
|
427
426
|
.PP
|
|
428
|
-
Pretty\-print HTML output: apex input.md \-\-
|
|
427
|
+
Pretty\-print HTML output: apex input.md \-\-pretty
|
|
429
428
|
|
|
430
429
|
.PP
|
|
431
|
-
Use GFM mode: apex
|
|
430
|
+
Use GFM mode: apex input.md \-\-mode gfm
|
|
432
431
|
|
|
433
432
|
.PP
|
|
434
|
-
Process document with citations and bibliography: apex document.md
|
|
433
|
+
Process document with citations and bibliography: apex document.md \-\-bibliography refs.bib
|
|
435
434
|
|
|
436
435
|
.PP
|
|
437
|
-
Use metadata to specify bibliography:
|
|
436
|
+
Use metadata to specify bibliography: apex document.md
|
|
438
437
|
|
|
439
438
|
.PP
|
|
440
|
-
Use Kramdown mode with relaxed tables:
|
|
439
|
+
(With bibliography specified in YAML front matter) Use Kramdown mode with relaxed tables: apex input.md \-\-mode kramdown
|
|
441
440
|
|
|
442
441
|
.PP
|
|
443
|
-
Process from stdin:
|
|
442
|
+
Process from stdin: echo "# Hello" | apex
|
|
444
443
|
|
|
445
444
|
.SH PROCESSING MODES
|
|
446
445
|
|
|
447
446
|
.PP
|
|
448
|
-
\f[B]commonmark\f[] compatibility.
|
|
447
|
+
\f[B]commonmark\f[] : Pure CommonMark specification. Minimal features, maximum compatibility.
|
|
449
448
|
|
|
450
449
|
.PP
|
|
451
|
-
|
|
450
|
+
\f[B]gfm\f[] : GitHub Flavored Markdown. Includes tables, strikethrough, task lists, autolinks, and more.
|
|
452
451
|
|
|
453
452
|
.PP
|
|
454
|
-
|
|
453
|
+
\f[B]mmd\f[], \f[B]multimarkdown\f[] : MultiMarkdown compatibility. Includes metadata, definition lists, footnotes, and more.
|
|
455
454
|
|
|
456
455
|
.PP
|
|
457
|
-
:
|
|
456
|
+
\f[B]kramdown\f[] : Kramdown compatibility. Includes relaxed tables, IAL (Inline Attribute Lists) for adding HTML attributes to elements, and more.
|
|
458
457
|
|
|
459
458
|
.PP
|
|
460
|
-
|
|
459
|
+
\f[B]unified\f[] (default) : All features enabled. Combines features from all modes.
|
|
461
460
|
|
|
462
461
|
.SH METADATA CONTROL OF OPTIONS
|
|
463
462
|
|
|
464
463
|
.PP
|
|
465
|
-
Most command\-line options can be controlled via document metadata, allowing different files to be processed with different settings when processing batches. This enables per\-document configuration without needing separate command\-line invocations. \f[B]Boolean options\f[] accept \fRtrue\f[]/\fRfalse\f[], \fRyes\f[]/\fRno\f[], or \fR1\f[]/\fR0\f[] (case\-insensitive). \f[B]String options\f[] use the value directly. \f[B]Supported boolean options:\f[] \fRindices\f[], \fRwikilinks\f[], \fRwikilink\-sanitize\f[], \fRincludes\f[], \fRrelaxed\-tables\f[], \fRper\-cell\-alignment\f[], \fRalpha\-lists\f[], \fRmixed\-lists\f[], \fRsup\-sub\f[], \fRstrikethrough\f[], \fRautolink\f[], \fRtransforms\f[], \fRunsafe\f[], \fRtables\f[], \fRfootnotes\f[], \fRsmart\f[], \fRmath\f[], \fRids\f[], \fRheader\-anchors\f[], \fRembed\-images\f[], \fRimage\-captions\f[], \fRlink\-citations\f[], \fRshow\-tooltips\f[], \fRsuppress\-bibliography\f[], \fRsuppress\-index\f[], \fRgroup\-index\-by\-letter\f[], \fRobfuscate\-emails\f[], \fRpretty\f[], \fRstandalone\f[], \fRhardbreaks\f[], \fRplugins\f[], \fRemoji\-autocorrect\f[], \fRcode\-line\-numbers\f[], \fRhighlight\-language\-only\f[], \fRmarkdown\-in\-html\f[] \f[B]Supported string options:\f[] \fRbibliography\f[], \fRcsl\f[], \fRtitle\f[], \fRstyle\f[] (or \fRcss\f[]), \fRid\-format\f[], \fRbase\-dir\f[], \fRmode\f[], \fRwikilink\-space\f[], \fRwikilink\-extension\f[] \f[B]Terminal output metadata\f[] (for \f[B]\-\-to terminal\f[] / \f[B]terminal256\f[]): \fRterminal.theme\f[] (\fRterminal_theme\f[]), \fRterminal.width\f[] (\fRterminal_width\f[], wrap width), \fRterminal.inline_images\f[] (\fRterminal_inline_images\f[], boolean), \fRterminal.image_width\f[] (\fRterminal_image_width\f[], viewer width in character cells), \fRterminal.paginate\f[] (\fRterminal_paginate\f[]), \fRpaginate\f[], \fRcode\-highlight\f[], \fRcode\-highlight\-theme\f[].
|
|
464
|
+
Most command\-line options can be controlled via document metadata, allowing different files to be processed with different settings when processing batches. This enables per\-document configuration without needing separate command\-line invocations. \f[B]Boolean options\f[] accept \fRtrue\f[]/\fRfalse\f[], \fRyes\f[]/\fRno\f[], or \fR1\f[]/\fR0\f[] (case\-insensitive). \f[B]String options\f[] use the value directly. \f[B]Supported boolean options:\f[] \fRindices\f[], \fRwikilinks\f[], \fRwikilink\-sanitize\f[], \fRincludes\f[], \fRrelaxed\-tables\f[], \fRper\-cell\-alignment\f[], \fRalpha\-lists\f[], \fRmixed\-lists\f[], \fRsup\-sub\f[], \fRstrikethrough\f[], \fRautolink\f[], \fRtransforms\f[], \fRunsafe\f[], \fRtables\f[], \fRfootnotes\f[], \fRsmart\f[], \fRmath\f[], \fRcallouts\f[], \fRpy\-callouts\f[], \fRquarto\-callouts\f[], \fRdivs\f[], \fRspans\f[], \fRids\f[], \fRheader\-anchors\f[], \fRembed\-images\f[], \fRimage\-captions\f[], \fRlink\-citations\f[], \fRshow\-tooltips\f[], \fRsuppress\-bibliography\f[], \fRsuppress\-index\f[], \fRgroup\-index\-by\-letter\f[], \fRobfuscate\-emails\f[], \fRpretty\f[], \fRstandalone\f[], \fRhardbreaks\f[], \fRplugins\f[], \fRemoji\-autocorrect\f[], \fRcode\-line\-numbers\f[], \fRhighlight\-language\-only\f[], \fRmarkdown\-in\-html\f[] \f[B]Supported string options:\f[] \fRbibliography\f[], \fRcsl\f[], \fRtitle\f[], \fRstyle\f[] (or \fRcss\f[]), \fRid\-format\f[], \fRtoc\-min\-max\f[], \fRbase\-dir\f[], \fRmode\f[], \fRwikilink\-space\f[], \fRwikilink\-extension\f[] \f[B]Terminal output metadata\f[] (for \f[B]\-\-to terminal\f[] / \f[B]terminal256\f[]): \fRterminal.theme\f[] (\fRterminal_theme\f[]), \fRterminal.width\f[] (\fRterminal_width\f[], wrap width), \fRterminal.inline_images\f[] (\fRterminal_inline_images\f[], boolean), \fRterminal.image_width\f[] (\fRterminal_image_width\f[], viewer width in character cells), \fRterminal.paginate\f[] (\fRterminal_paginate\f[]), \fRpaginate\f[] (\fRtrue\f[], \fRfalse\f[], or \fRsymbols\f[] for pager\-friendly chafa ANSI images), \fRcode\-highlight\f[], \fRcode\-highlight\-theme\f[]. \f[B]Example YAML front matter:\f[]
|
|
466
465
|
|
|
467
466
|
.PP
|
|
468
467
|
.nf
|
|
@@ -480,7 +479,7 @@ standalone: true
|
|
|
480
479
|
.fi
|
|
481
480
|
|
|
482
481
|
.PP
|
|
483
|
-
\f[B]Example
|
|
482
|
+
\f[B]Example MultiMarkdown metadata:\f[]
|
|
484
483
|
|
|
485
484
|
.PP
|
|
486
485
|
.nf
|
|
@@ -494,7 +493,7 @@ title: My Research Paper
|
|
|
494
493
|
.fi
|
|
495
494
|
|
|
496
495
|
.PP
|
|
497
|
-
|
|
496
|
+
When processing multiple files with \fRapex *.md\f[], each file can use its own configuration via metadata. You can also use \fR\-\-meta\-file\f[] to specify a shared configuration file that applies to all processed files. \f[B]Note:\f[] If \fRmode\f[] is specified in metadata, it resets all options to that mode's defaults before applying other metadata options.
|
|
498
497
|
|
|
499
498
|
.SH FEATURES
|
|
500
499
|
|
|
@@ -558,6 +557,11 @@ Apex supports a wide range of Markdown extensions:
|
|
|
558
557
|
.IP \(bu 2
|
|
559
558
|
\f[B]Inline Attribute Lists (IAL)\f[]: Kramdown\-style syntax for adding HTML attributes (IDs, classes, key\-value pairs) to block\-level and inline elements. Supports Attribute List Definitions (ALDs) for reusable attribute sets. Available in kramdown and unified modes. See Inline Attribute Lists (https://github.com/ttscoff/apex/wiki/Inline\-Attribute\-Lists) for complete documentation
|
|
560
559
|
|
|
560
|
+
.SH ENVIRONMENT
|
|
561
|
+
|
|
562
|
+
.PP
|
|
563
|
+
\f[B]APEX_PAGER\f[] : When set and non\-empty, used as the pager command for \f[B]\-p\f[] / \f[B]\-\-paginate\f[] and \f[B]\-\-paginate\-symbols\f[] before \f[B]$PAGER\f[]. \f[B]PAGER\f[] : Fallback pager command when \f[B]APEX_PAGER\f[] is unset. \f[B]APEX_DEBUG_TERMINAL\f[] : When set to any non\-empty value, Apex prints terminal rendering diagnostics to stderr: selected image viewer, full viewer command lines, \f[B]TERM_PROGRAM\f[], pagination mode, and syntax highlighter commands. \f[B]TMPDIR\f[] : Directory for temporary files when downloading remote images for terminal display (falls back to \fR/tmp\f[] when unset).
|
|
564
|
+
|
|
561
565
|
.SH SEE ALSO
|
|
562
566
|
|
|
563
567
|
.PP
|
|
@@ -77,6 +77,24 @@ Pagination is ignored when the output format is not a terminal format or when
|
|
|
77
77
|
`-o/--output` is used to write to a file. You can also enable pagination via
|
|
78
78
|
metadata or config by setting `paginate: true`.
|
|
79
79
|
|
|
80
|
+
When pagination is enabled and the rendered output contains inline terminal
|
|
81
|
+
graphics (iTerm **imgcat** / OSC 1337 sequences or Kitty graphics), Apex
|
|
82
|
+
automatically skips the pager and writes directly to stdout, because **`less -R`**
|
|
83
|
+
and most pagers only support ANSI color, not inline image protocols. A short
|
|
84
|
+
notice is printed to stderr.
|
|
85
|
+
|
|
86
|
+
**--paginate-symbols**
|
|
87
|
+
: Page terminal output (same pager selection as **--paginate**) and render
|
|
88
|
+
Markdown images as **chafa** ANSI block art (`chafa -f symbols`) so images
|
|
89
|
+
display correctly in **`less -R`**. Requires **chafa** on **PATH**. With
|
|
90
|
+
**--to terminal256**, Apex passes `-c 256` to chafa; with **--to terminal**,
|
|
91
|
+
`-c 16`. Equivalent to metadata `paginate: symbols`. Implies pagination is
|
|
92
|
+
enabled.
|
|
93
|
+
|
|
94
|
+
**--no-paginate**
|
|
95
|
+
: Do not page terminal output. Overrides **-p** / **--paginate** and
|
|
96
|
+
`paginate: true` or `paginate: symbols` from metadata or config.
|
|
97
|
+
|
|
80
98
|
**--theme** *NAME*
|
|
81
99
|
: Terminal theme name for **--to terminal** / **--to terminal256**. Themes are YAML files under `~/.config/apex/terminal/themes/` (see the Apex wiki).
|
|
82
100
|
|
|
@@ -84,7 +102,24 @@ metadata or config by setting `paginate: true`.
|
|
|
84
102
|
: Disable inline terminal rendering of Markdown images for **--to terminal** / **--to terminal256**. Default is to render when **stdout** is a TTY, a supported viewer exists on **PATH**, and inline images are enabled (see **METADATA CONTROL OF OPTIONS** for `terminal.inline_images`).
|
|
85
103
|
|
|
86
104
|
**--terminal-image-width** *N*
|
|
87
|
-
: Maximum width in character cells passed to the image viewer (default: 50).
|
|
105
|
+
: Maximum width in character cells passed to the image viewer (default: 50).
|
|
106
|
+
When **stdout** is a TTY and inline images are enabled, Apex selects a viewer
|
|
107
|
+
on **PATH** as follows:
|
|
108
|
+
|
|
109
|
+
- **imgcat** — only when **TERM_PROGRAM** indicates iTerm2 (iTerm inline-image protocol).
|
|
110
|
+
- **chafa** — otherwise, if available (`-f` format depends on terminal: **iterm** on iTerm/WezTerm, **kitty** on Kitty, **symbols** on other terminals).
|
|
111
|
+
- **catimg** — if chafa is not found.
|
|
112
|
+
- **viu** — if neither chafa nor catimg is found.
|
|
113
|
+
|
|
114
|
+
For `http://` and `https://` image URLs, Apex downloads with **curl** (60 second
|
|
115
|
+
timeout, 10 MiB maximum size) to a file under **$TMPDIR** or `/tmp`, then
|
|
116
|
+
displays it. If **curl** is missing, download fails, no viewer is found,
|
|
117
|
+
**stdout** is not a TTY, or **--no-terminal-images** is set, images are emitted
|
|
118
|
+
as styled link text and URL (like hyperlinks), not as Markdown `` syntax.
|
|
119
|
+
|
|
120
|
+
When **--paginate-symbols** or `paginate: symbols` is active, Apex always uses
|
|
121
|
+
**chafa** with `-f symbols` for images so pager output remains compatible with
|
|
122
|
+
**less -R**.
|
|
88
123
|
|
|
89
124
|
**--code-highlight** *TOOL*
|
|
90
125
|
: Use external tool for syntax highlighting of code blocks.
|
|
@@ -154,13 +189,21 @@ output more accessible. Default: disabled.
|
|
|
154
189
|
- **strict-xhtml** - Same as **html** with **`--strict-xhtml`** (polyglot XHTML when used with **--standalone**). Alias; **`--strict-xhtml`** remains valid.
|
|
155
190
|
- **json**, **json-filtered**, **ast-json**, **ast** - JSON output (before or after filters)
|
|
156
191
|
- **markdown**, **md**, **mmd**, **commonmark**, **cmark**, **kramdown**, **gfm** - Markdown variants
|
|
192
|
+
- **toc** - Markdown unordered list of heading links only (default depth **#**–**###**)
|
|
157
193
|
- **terminal**, **cli**, **terminal256** - ANSI-colored output for TTYs and terminal emulators
|
|
158
194
|
- **man** - Man page roff source (.TH, .SH, etc.)
|
|
159
195
|
- **man-html** - Styled HTML man page (use **--standalone** for full page with nav sidebar)
|
|
196
|
+
- **rtf** - Rich Text Format (native writer; write to a `.rtf` file for best results)
|
|
160
197
|
|
|
161
198
|
When using a terminal format, Apex emits ANSI-colored output suitable for TTYs and
|
|
162
199
|
terminal emulators.
|
|
163
200
|
|
|
201
|
+
**--toc-min-max** *MIN,MAX*
|
|
202
|
+
:: Inclusive heading depth for **--to toc** and for HTML TOC markers without an
|
|
203
|
+
explicit range. The default is **1,3**, which includes headings from **#**
|
|
204
|
+
through **###**. Marker syntax with an explicit range, such as `{{TOC:2-5}}`,
|
|
205
|
+
overrides this setting. Values must satisfy `1 <= MIN <= MAX <= 6`.
|
|
206
|
+
|
|
164
207
|
## Feature Flags
|
|
165
208
|
|
|
166
209
|
**--accept**
|
|
@@ -395,6 +438,12 @@ relative paths.
|
|
|
395
438
|
**--divs**, **--no-divs**
|
|
396
439
|
: Enable or disable Pandoc fenced divs syntax (`:::: {#id .class} ... :::::`). Fenced divs allow you to create HTML block elements with attributes using a special fence syntax. By default, fenced divs create `<div>` elements, but you can specify different block types using the `>blocktype` syntax (e.g., `:: >aside {.sidebar} ... :::` creates an `<aside>` element instead). Opening fences must have at least 3 colons and attributes; closing fences need at least 3 colons. Fenced divs can be nested, including different block types. Default: enabled in unified mode only.
|
|
397
440
|
|
|
441
|
+
**--py-callouts**, **--no-py-callouts**
|
|
442
|
+
: Enable or disable Python-Markdown callout syntax (`!!! note "Optional Title"` followed by indented content) and markdown-callouts label syntax (`NOTE: ...`, `>? NOTE: ...` for collapsed callouts). Disabled by default to avoid ambiguity with regular markdown prose.
|
|
443
|
+
|
|
444
|
+
**--quarto-callouts**, **--no-quarto-callouts**
|
|
445
|
+
: Enable or disable Quarto callout syntax using fenced div markers (`::: {.callout-note}` ... `:::`). When enabled, recognized Quarto callout blocks bypass generic fenced-div conversion and are rendered as callouts; non-callout fenced divs continue to be processed as regular Pandoc fenced divs.
|
|
446
|
+
|
|
398
447
|
**--spans**, **--no-spans**
|
|
399
448
|
: Enable or disable Pandoc-style bracketed spans syntax (`[text]{#id .class key="val"}`). Bracketed spans allow you to create HTML `<span>` elements with attributes. The text inside the brackets is processed as markdown. If the bracketed text matches a reference link definition, it will be treated as a link instead of a span. Default: enabled in unified mode only.
|
|
400
449
|
|
|
@@ -439,6 +488,16 @@ found.
|
|
|
439
488
|
|
|
440
489
|
## Indices
|
|
441
490
|
|
|
491
|
+
**--concordance** *FILE*
|
|
492
|
+
: TextIndex concordance file (tab-separated). Searches the
|
|
493
|
+
document for each rule's column-1 pattern and inserts
|
|
494
|
+
`[match]{^col2}` index marks before TextIndex processing.
|
|
495
|
+
Can be specified multiple times. Enables indices and
|
|
496
|
+
TextIndex syntax when used. Matches inside existing index
|
|
497
|
+
marks, `{index}` directives, and HTML tags are skipped.
|
|
498
|
+
See https://mattgemmell.scot/textindex/#concordance-files
|
|
499
|
+
for the concordance file format.
|
|
500
|
+
|
|
442
501
|
**--indices**
|
|
443
502
|
: Enable index processing. Supports both mmark and TextIndex
|
|
444
503
|
syntax. Default: enabled in MultiMarkdown and unified modes.
|
|
@@ -620,14 +679,14 @@ command-line invocations.
|
|
|
620
679
|
directly.
|
|
621
680
|
|
|
622
681
|
**Supported boolean options:**
|
|
623
|
-
`indices`, `wikilinks`, `wikilink-sanitize`, `includes`, `relaxed-tables`, `per-cell-alignment`, `alpha-lists`, `mixed-lists`, `sup-sub`, `strikethrough`, `autolink`, `transforms`, `unsafe`, `tables`, `footnotes`, `smart`, `math`, `ids`, `header-anchors`, `embed-images`, `image-captions`, `link-citations`, `show-tooltips`, `suppress-bibliography`, `suppress-index`, `group-index-by-letter`, `obfuscate-emails`, `pretty`, `standalone`, `hardbreaks`, `plugins`, `emoji-autocorrect`, `code-line-numbers`, `highlight-language-only`, `markdown-in-html`
|
|
682
|
+
`indices`, `wikilinks`, `wikilink-sanitize`, `includes`, `relaxed-tables`, `per-cell-alignment`, `alpha-lists`, `mixed-lists`, `sup-sub`, `strikethrough`, `autolink`, `transforms`, `unsafe`, `tables`, `footnotes`, `smart`, `math`, `callouts`, `py-callouts`, `quarto-callouts`, `divs`, `spans`, `ids`, `header-anchors`, `embed-images`, `image-captions`, `link-citations`, `show-tooltips`, `suppress-bibliography`, `suppress-index`, `group-index-by-letter`, `obfuscate-emails`, `pretty`, `standalone`, `hardbreaks`, `plugins`, `emoji-autocorrect`, `code-line-numbers`, `highlight-language-only`, `markdown-in-html`
|
|
624
683
|
|
|
625
684
|
**Supported string options:**
|
|
626
685
|
`bibliography`, `csl`, `title`, `style` (or `css`),
|
|
627
|
-
`id-format`, `base-dir`, `mode`, `wikilink-space`,
|
|
686
|
+
`id-format`, `toc-min-max`, `base-dir`, `mode`, `wikilink-space`,
|
|
628
687
|
`wikilink-extension`
|
|
629
688
|
|
|
630
|
-
**Terminal output metadata** (for **--to terminal** / **terminal256**): `terminal.theme` (`terminal_theme`), `terminal.width` (`terminal_width`, wrap width), `terminal.inline_images` (`terminal_inline_images`, boolean), `terminal.image_width` (`terminal_image_width`, viewer width in character cells), `terminal.paginate` (`terminal_paginate`), `paginate`, `code-highlight`, `code-highlight-theme`.
|
|
689
|
+
**Terminal output metadata** (for **--to terminal** / **terminal256**): `terminal.theme` (`terminal_theme`), `terminal.width` (`terminal_width`, wrap width), `terminal.inline_images` (`terminal_inline_images`, boolean), `terminal.image_width` (`terminal_image_width`, viewer width in character cells), `terminal.paginate` (`terminal_paginate`), `paginate` (`true`, `false`, or `symbols` for pager-friendly chafa ANSI images), `code-highlight`, `code-highlight-theme`.
|
|
631
690
|
|
|
632
691
|
**Example YAML front matter:**
|
|
633
692
|
```
|
|
@@ -704,6 +763,24 @@ Apex supports a wide range of Markdown extensions:
|
|
|
704
763
|
for complete documentation
|
|
705
764
|
|
|
706
765
|
|
|
766
|
+
# ENVIRONMENT
|
|
767
|
+
|
|
768
|
+
**APEX_PAGER**
|
|
769
|
+
: When set and non-empty, used as the pager command for **-p** / **--paginate**
|
|
770
|
+
and **--paginate-symbols** before **$PAGER**.
|
|
771
|
+
|
|
772
|
+
**PAGER**
|
|
773
|
+
: Fallback pager command when **APEX_PAGER** is unset.
|
|
774
|
+
|
|
775
|
+
**APEX_DEBUG_TERMINAL**
|
|
776
|
+
: When set to any non-empty value, Apex prints terminal rendering diagnostics
|
|
777
|
+
to stderr: selected image viewer, full viewer command lines, **TERM_PROGRAM**,
|
|
778
|
+
pagination mode, and syntax highlighter commands.
|
|
779
|
+
|
|
780
|
+
**TMPDIR**
|
|
781
|
+
: Directory for temporary files when downloading remote images for terminal
|
|
782
|
+
display (falls back to `/tmp` when unset).
|
|
783
|
+
|
|
707
784
|
# SEE ALSO
|
|
708
785
|
|
|
709
786
|
**apex-config**(5), **apex-plugins**(7), **pandoc**(1), **markdown**(7)
|
|
@@ -8,6 +8,12 @@ import Foundation
|
|
|
8
8
|
@_exported import ApexObjC
|
|
9
9
|
@_exported import ApexC
|
|
10
10
|
|
|
11
|
+
#if canImport(AppKit)
|
|
12
|
+
import AppKit
|
|
13
|
+
#elseif canImport(UIKit)
|
|
14
|
+
import UIKit
|
|
15
|
+
#endif
|
|
16
|
+
|
|
11
17
|
/// Apex processor mode
|
|
12
18
|
/// Type-safe enum for processor modes
|
|
13
19
|
public enum ApexMode: String, CaseIterable {
|
|
@@ -16,6 +22,7 @@ public enum ApexMode: String, CaseIterable {
|
|
|
16
22
|
case multimarkdown = "multimarkdown"
|
|
17
23
|
case kramdown = "kramdown"
|
|
18
24
|
case unified = "unified"
|
|
25
|
+
case quarto = "quarto"
|
|
19
26
|
|
|
20
27
|
/// Convert to NSString for Objective-C API
|
|
21
28
|
internal var nsString: NSString {
|
|
@@ -23,6 +30,14 @@ public enum ApexMode: String, CaseIterable {
|
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
|
|
33
|
+
/// Preferred document type when building NSAttributedString from Markdown.
|
|
34
|
+
public enum ApexAttributedSource: String {
|
|
35
|
+
/// Use Apex RTF output (NSRTFTextDocumentType). Preferred for AppKit fidelity.
|
|
36
|
+
case rtf
|
|
37
|
+
/// Use Apex HTML output (NSHTMLTextDocumentType).
|
|
38
|
+
case html
|
|
39
|
+
}
|
|
40
|
+
|
|
26
41
|
/// Apex conversion options
|
|
27
42
|
/// Swift struct for configuring conversion options
|
|
28
43
|
public struct ApexOptions {
|
|
@@ -56,6 +71,15 @@ public struct ApexOptions {
|
|
|
56
71
|
/// Embed local images as base64 data URLs
|
|
57
72
|
public var embedImages: Bool = false
|
|
58
73
|
|
|
74
|
+
/// Enable external plugin processing during conversion.
|
|
75
|
+
public var enablePlugins: Bool = false
|
|
76
|
+
|
|
77
|
+
/// Autolink bare URLs and emails. `nil` leaves the mode default unchanged.
|
|
78
|
+
public var enableAutolink: Bool? = nil
|
|
79
|
+
|
|
80
|
+
/// Output format: "html" (default) or "rtf"
|
|
81
|
+
public var outputFormat: String? = nil
|
|
82
|
+
|
|
59
83
|
/// Default initializer
|
|
60
84
|
public init() {}
|
|
61
85
|
|
|
@@ -96,6 +120,15 @@ public struct ApexOptions {
|
|
|
96
120
|
if embedImages {
|
|
97
121
|
dict["embedImages"] = true
|
|
98
122
|
}
|
|
123
|
+
if enablePlugins {
|
|
124
|
+
dict["enablePlugins"] = true
|
|
125
|
+
}
|
|
126
|
+
if let enableAutolink {
|
|
127
|
+
dict["enableAutolink"] = enableAutolink
|
|
128
|
+
}
|
|
129
|
+
if let outputFormat = outputFormat {
|
|
130
|
+
dict["outputFormat"] = outputFormat
|
|
131
|
+
}
|
|
99
132
|
|
|
100
133
|
return dict
|
|
101
134
|
}
|
|
@@ -173,6 +206,32 @@ extension String {
|
|
|
173
206
|
pretty: pretty
|
|
174
207
|
)
|
|
175
208
|
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Convert Markdown to RTF using Apex.
|
|
212
|
+
*/
|
|
213
|
+
public func apexRTF(mode: ApexMode = .unified, options: ApexOptions = .default) -> String {
|
|
214
|
+
var opts = options
|
|
215
|
+
opts.outputFormat = "rtf"
|
|
216
|
+
return NSString.convert(withApex: self, mode: mode.rawValue, options: opts.toDictionary())
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
#if canImport(AppKit) || canImport(UIKit)
|
|
220
|
+
/**
|
|
221
|
+
* Convert Markdown to NSAttributedString.
|
|
222
|
+
* Defaults to the RTF pipeline; pass source: .html for the HTML importer.
|
|
223
|
+
*/
|
|
224
|
+
public func apexAttributedString(
|
|
225
|
+
mode: ApexMode = .unified,
|
|
226
|
+
options: ApexOptions = .default,
|
|
227
|
+
source: ApexAttributedSource = .rtf
|
|
228
|
+
) -> NSAttributedString? {
|
|
229
|
+
let dict = options.toDictionary()
|
|
230
|
+
let useHTML = (source == .html)
|
|
231
|
+
return (self as NSString).apexAttributedString(
|
|
232
|
+
withMode: mode.rawValue, options: dict.isEmpty ? nil : dict, usingHTML: useHTML)
|
|
233
|
+
}
|
|
234
|
+
#endif
|
|
176
235
|
}
|
|
177
236
|
|
|
178
237
|
/// Static Apex converter
|
|
@@ -206,6 +265,20 @@ public struct Apex {
|
|
|
206
265
|
return markdown.apexHTML(mode: mode, options: options)
|
|
207
266
|
}
|
|
208
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Convert Markdown to HTML using Apex with source file URL for includes
|
|
270
|
+
*/
|
|
271
|
+
public static func convert(
|
|
272
|
+
_ markdown: String, mode: ApexMode = .unified, sourceURL: URL, enableAutolink: Bool = true
|
|
273
|
+
) -> String {
|
|
274
|
+
return NSString.convert(
|
|
275
|
+
withApex: markdown,
|
|
276
|
+
mode: mode.rawValue,
|
|
277
|
+
sourceURL: sourceURL,
|
|
278
|
+
enableAutolink: enableAutolink
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
|
|
209
282
|
/**
|
|
210
283
|
* Convert Markdown to HTML using Apex with standalone document options
|
|
211
284
|
*/
|