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
|
@@ -5,8 +5,97 @@
|
|
|
5
5
|
|
|
6
6
|
<meta charset="UTF-8">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<meta name="generator" content="Apex
|
|
8
|
+
<meta name="generator" content="Apex 1.1.12">
|
|
9
9
|
<title>Document</title>
|
|
10
|
+
<style>
|
|
11
|
+
/* GitHub-style syntax highlighting for Pygments and Skylighting */
|
|
12
|
+
/* Don't apply background to wrapper when code highlighting is enabled - let default styles handle it */
|
|
13
|
+
.code-highlighted .highlight, .code-highlighted .sourceCode { background: inherit; border-radius: 6px; padding: 16px; overflow-x: auto; }
|
|
14
|
+
.highlight pre, .sourceCode pre { margin: 0; padding: 0; background: transparent; }
|
|
15
|
+
.highlight code, .sourceCode code { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 12px; line-height: 1.45; }
|
|
16
|
+
/* Pygments classes */
|
|
17
|
+
.highlight .k { color: #d73a49; font-weight: 600; } /* Keyword */
|
|
18
|
+
.highlight .kt { color: #d73a49; } /* Keyword.Type */
|
|
19
|
+
.highlight .kd { color: #d73a49; font-weight: 600; } /* Keyword.Declaration */
|
|
20
|
+
.highlight .kn { color: #d73a49; } /* Keyword.Namespace */
|
|
21
|
+
.highlight .kp { color: #d73a49; } /* Keyword.Pseudo */
|
|
22
|
+
.highlight .kr { color: #d73a49; font-weight: 600; } /* Keyword.Reserved */
|
|
23
|
+
.highlight .n { color: #6f42c1; } /* Name */
|
|
24
|
+
.highlight .na { color: #6f42c1; } /* Name.Attribute */
|
|
25
|
+
.highlight .nc { color: #6f42c1; font-weight: 600; } /* Name.Class */
|
|
26
|
+
.highlight .no { color: #005cc5; } /* Name.Constant */
|
|
27
|
+
.highlight .nd { color: #6f42c1; font-weight: 600; } /* Name.Decorator */
|
|
28
|
+
.highlight .ni { color: #800080; } /* Name.Entity */
|
|
29
|
+
.highlight .ne { color: #990000; font-weight: 600; } /* Name.Exception */
|
|
30
|
+
.highlight .nf { color: #6f42c1; font-weight: 600; } /* Name.Function */
|
|
31
|
+
.highlight .nl { color: #6f42c1; } /* Name.Label */
|
|
32
|
+
.highlight .nn { color: #555; } /* Name.Namespace */
|
|
33
|
+
.highlight .nt { color: #22863a; } /* Name.Tag */
|
|
34
|
+
.highlight .nv { color: #e36209; } /* Name.Variable */
|
|
35
|
+
.highlight .s { color: #032f62; } /* String */
|
|
36
|
+
.highlight .sb { color: #032f62; } /* String.Backtick */
|
|
37
|
+
.highlight .sc { color: #032f62; } /* String.Char */
|
|
38
|
+
.highlight .sd { color: #032f62; } /* String.Doc */
|
|
39
|
+
.highlight .s2 { color: #032f62; } /* String.Double */
|
|
40
|
+
.highlight .se { color: #032f62; } /* String.Escape */
|
|
41
|
+
.highlight .sh { color: #032f62; } /* String.Heredoc */
|
|
42
|
+
.highlight .si { color: #032f62; } /* String.Interpol */
|
|
43
|
+
.highlight .sx { color: #032f62; } /* String.Other */
|
|
44
|
+
.highlight .sr { color: #032f62; } /* String.Regex */
|
|
45
|
+
.highlight .s1 { color: #032f62; } /* String.Single */
|
|
46
|
+
.highlight .ss { color: #032f62; } /* String.Symbol */
|
|
47
|
+
.highlight .c { color: #6a737d; font-style: italic; } /* Comment */
|
|
48
|
+
.highlight .c1 { color: #6a737d; font-style: italic; } /* Comment.Single */
|
|
49
|
+
.highlight .cm { color: #6a737d; font-style: italic; } /* Comment.Multiline */
|
|
50
|
+
.highlight .cp { color: #6a737d; font-weight: 600; } /* Comment.Preproc */
|
|
51
|
+
.highlight .cs { color: #6a737d; font-weight: 600; font-style: italic; } /* Comment.Special */
|
|
52
|
+
.highlight .m { color: #005cc5; } /* Literal.Number */
|
|
53
|
+
.highlight .mb { color: #005cc5; } /* Literal.Number.Bin */
|
|
54
|
+
.highlight .mf { color: #005cc5; } /* Literal.Number.Float */
|
|
55
|
+
.highlight .mh { color: #005cc5; } /* Literal.Number.Hex */
|
|
56
|
+
.highlight .mi { color: #005cc5; } /* Literal.Number.Integer */
|
|
57
|
+
.highlight .il { color: #005cc5; } /* Literal.Number.Integer.Long */
|
|
58
|
+
.highlight .mo { color: #005cc5; } /* Literal.Number.Oct */
|
|
59
|
+
.highlight .o { color: #d73a49; } /* Operator */
|
|
60
|
+
.highlight .ow { color: #d73a49; } /* Operator.Word */
|
|
61
|
+
.highlight .p { color: #24292e; } /* Punctuation */
|
|
62
|
+
.highlight .w { color: #e1e4e8; } /* Text.Whitespace */
|
|
63
|
+
/* Skylighting classes */
|
|
64
|
+
.sourceCode .kw { color: #d73a49; font-weight: 600; } /* Keyword */
|
|
65
|
+
.sourceCode .dt { color: #6f42c1; } /* DataType */
|
|
66
|
+
.sourceCode .dv { color: #005cc5; } /* DecVal */
|
|
67
|
+
.sourceCode .bn { color: #005cc5; } /* BaseN */
|
|
68
|
+
.sourceCode .fl { color: #005cc5; } /* Float */
|
|
69
|
+
.sourceCode .ch { color: #032f62; } /* Char */
|
|
70
|
+
.sourceCode .st { color: #032f62; } /* String */
|
|
71
|
+
.sourceCode .co { color: #6a737d; font-style: italic; } /* Comment */
|
|
72
|
+
.sourceCode .ot { color: #22863a; } /* Other */
|
|
73
|
+
.sourceCode .al { color: #e36209; font-weight: 600; } /* Alert */
|
|
74
|
+
.sourceCode .fu { color: #6f42c1; font-weight: 600; } /* Function */
|
|
75
|
+
.sourceCode .re { color: #032f62; } /* RegionMarker */
|
|
76
|
+
.sourceCode .er { color: #d73a49; font-weight: 600; } /* Error */
|
|
77
|
+
.sourceCode .cf { color: #d73a49; font-weight: 600; } /* ControlFlow */
|
|
78
|
+
.sourceCode .op { color: #d73a49; } /* Operator */
|
|
79
|
+
.sourceCode .pp { color: #6a737d; } /* Preprocessor */
|
|
80
|
+
.sourceCode .at { color: #005cc5; } /* Attribute */
|
|
81
|
+
.sourceCode .do { color: #6a737d; font-style: italic; } /* Documentation */
|
|
82
|
+
.sourceCode .an { color: #6a737d; font-weight: 600; } /* Annotation */
|
|
83
|
+
.sourceCode .cv { color: #6a737d; font-weight: 600; font-style: italic; } /* CommentVar */
|
|
84
|
+
.sourceCode .in { color: #6a737d; } /* Information */
|
|
85
|
+
.sourceCode .wa { color: #e36209; font-weight: 600; } /* Warning */
|
|
86
|
+
.sourceCode .im { color: #d73a49; } /* Import */
|
|
87
|
+
.sourceCode .bu { color: #005cc5; } /* BuiltIn */
|
|
88
|
+
.sourceCode .ex { color: #6f42c1; } /* Extension */
|
|
89
|
+
.sourceCode .va { color: #e36209; } /* Variable */
|
|
90
|
+
.sourceCode .ss { color: #032f62; } /* SpecialString */
|
|
91
|
+
.sourceCode .sc { color: #032f62; } /* SpecialChar */
|
|
92
|
+
.sourceCode .vs { color: #032f62; } /* VerbatimString */
|
|
93
|
+
.sourceCode .il { color: #005cc5; } /* Special */
|
|
94
|
+
/* Line numbers (Skylighting) */
|
|
95
|
+
.sourceCode.numberSource .sourceCode { counter-reset: line; }
|
|
96
|
+
.sourceCode.numberSource .sourceCode > span { position: relative; left: -4em; counter-increment: line; }
|
|
97
|
+
.sourceCode.numberSource .sourceCode > span > a:first-child::before { content: counter(line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; min-width: 1em; padding-right: 0.5em; color: #aaa; }
|
|
98
|
+
</style>
|
|
10
99
|
<style>
|
|
11
100
|
body {
|
|
12
101
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
|
|
@@ -35,10 +124,52 @@
|
|
|
35
124
|
ins { background: #d4fcbc; text-decoration: none; }
|
|
36
125
|
del { background: #fbb6c2; text-decoration: line-through; }
|
|
37
126
|
mark { background: #fff3cd; }
|
|
127
|
+
.smallcaps { font-variant: small-caps; }
|
|
128
|
+
.underline { text-decoration: underline; }
|
|
129
|
+
span.mark { background: #fff3cd; }
|
|
130
|
+
.hidden { display: none; }
|
|
131
|
+
.quarto-xref { font-variant: normal; }
|
|
38
132
|
.critic.comment { background: #e7e7e7; color: #666; font-style: italic; }
|
|
133
|
+
.mkhashtag { color: #666; }
|
|
134
|
+
.mkstyledtag {
|
|
135
|
+
display: inline-block;
|
|
136
|
+
background: #e0e0e0;
|
|
137
|
+
padding: 3px 9px;
|
|
138
|
+
border-radius: 20px;
|
|
139
|
+
font-size: 0.9em;
|
|
140
|
+
line-height: 1.4;
|
|
141
|
+
color: #333;
|
|
142
|
+
margin: 0 2px;
|
|
143
|
+
}
|
|
39
144
|
</style>
|
|
145
|
+
<meta name="paginate" content="symbols"/>
|
|
146
|
+
<meta name="highlight-language-only" content="true"/>
|
|
147
|
+
<meta name="code-line-numbers" content="false"/>
|
|
148
|
+
<meta name="code-highlight" content="pygments"/>
|
|
149
|
+
<meta name="sup-sub" content="true"/>
|
|
150
|
+
<meta name="relaxed-tables" content="true"/>
|
|
151
|
+
<meta name="includes" content="true"/>
|
|
152
|
+
<meta name="autolink" content="true"/>
|
|
153
|
+
<meta name="pretty" content="false"/>
|
|
154
|
+
<meta name="standalone" content="false"/>
|
|
155
|
+
<meta name="mode" content="unified"/>
|
|
156
|
+
<meta name="markdown-in-html" content="true"/>
|
|
157
|
+
<meta name="image-captions" content="true"/>
|
|
158
|
+
<meta name="wikilink-extension" content="html"/>
|
|
159
|
+
<meta name="wikilink-space" content="hyphen"/>
|
|
160
|
+
<meta name="wikilinks" content="true"/>
|
|
161
|
+
<meta name="widont" content="true"/>
|
|
162
|
+
<meta name="plugins" content="true"/>
|
|
163
|
+
<meta name="id-format" content="gfm"/>
|
|
164
|
+
|
|
40
165
|
<style>
|
|
41
|
-
|
|
166
|
+
:root {
|
|
167
|
+
/* border-box width of the fixed sidebar; body offset includes a small gap */
|
|
168
|
+
--sidebar-width: 250px;
|
|
169
|
+
--sidebar-offset: 270px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Base styles — override Apex standalone centering (max-width + margin: auto) */
|
|
42
173
|
body {
|
|
43
174
|
-webkit-font-smoothing: antialiased;
|
|
44
175
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -48,6 +179,11 @@ body {
|
|
|
48
179
|
line-height: 1.65;
|
|
49
180
|
color: #1e293b;
|
|
50
181
|
background-color: #fff;
|
|
182
|
+
max-width: none;
|
|
183
|
+
width: auto;
|
|
184
|
+
margin: 2rem 2rem 2rem var(--sidebar-offset);
|
|
185
|
+
padding: 0 1rem;
|
|
186
|
+
box-sizing: border-box;
|
|
51
187
|
}
|
|
52
188
|
|
|
53
189
|
/* Sidebar / Main TOC - wider on larger screens */
|
|
@@ -56,9 +192,10 @@ body {
|
|
|
56
192
|
position: fixed;
|
|
57
193
|
left: 0;
|
|
58
194
|
top: 0;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
195
|
+
box-sizing: border-box;
|
|
196
|
+
width: var(--sidebar-width);
|
|
197
|
+
min-width: var(--sidebar-width);
|
|
198
|
+
max-width: var(--sidebar-width);
|
|
62
199
|
height: 100vh;
|
|
63
200
|
overflow-y: auto;
|
|
64
201
|
background: #1e293b;
|
|
@@ -67,7 +204,6 @@ body {
|
|
|
67
204
|
padding: 24px 20px 130px;
|
|
68
205
|
font-size: 14px;
|
|
69
206
|
z-index: 100;
|
|
70
|
-
margin-right: 1rem;
|
|
71
207
|
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
|
|
72
208
|
transition: transform 0.3s ease;
|
|
73
209
|
}
|
|
@@ -116,11 +252,6 @@ body {
|
|
|
116
252
|
font-weight: 500;
|
|
117
253
|
}
|
|
118
254
|
|
|
119
|
-
/* Body margin for sidebar */
|
|
120
|
-
body {
|
|
121
|
-
margin-left: 270px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
255
|
/* Hamburger menu button */
|
|
125
256
|
.hamburger-menu {
|
|
126
257
|
display: none;
|
|
@@ -136,6 +267,7 @@ body {
|
|
|
136
267
|
color: rgba(255, 255, 255, 0.9);
|
|
137
268
|
font-size: 20px;
|
|
138
269
|
line-height: 1;
|
|
270
|
+
box-sizing: border-box;
|
|
139
271
|
width: 44px;
|
|
140
272
|
height: 44px;
|
|
141
273
|
align-items: center;
|
|
@@ -153,9 +285,7 @@ body {
|
|
|
153
285
|
|
|
154
286
|
/* Move hamburger to the right of the sidebar when menu is open */
|
|
155
287
|
.hamburger-menu.active {
|
|
156
|
-
left: calc(
|
|
157
|
-
250px + 12px
|
|
158
|
-
); /* Position just to the right of sidebar (max-width 250px + 12px padding) */
|
|
288
|
+
left: calc(var(--sidebar-width) + 12px);
|
|
159
289
|
}
|
|
160
290
|
|
|
161
291
|
.hamburger-menu.active {
|
|
@@ -251,7 +381,7 @@ body {
|
|
|
251
381
|
.floating-toc {
|
|
252
382
|
position: fixed;
|
|
253
383
|
top: 0;
|
|
254
|
-
left:
|
|
384
|
+
left: var(--sidebar-offset);
|
|
255
385
|
right: 0;
|
|
256
386
|
z-index: 50;
|
|
257
387
|
opacity: 0;
|
|
@@ -677,7 +807,7 @@ ol ul {
|
|
|
677
807
|
}
|
|
678
808
|
|
|
679
809
|
body {
|
|
680
|
-
margin
|
|
810
|
+
margin: 2rem 1rem;
|
|
681
811
|
}
|
|
682
812
|
|
|
683
813
|
.floating-toc {
|
|
@@ -687,7 +817,7 @@ ol ul {
|
|
|
687
817
|
|
|
688
818
|
</style></head>
|
|
689
819
|
|
|
690
|
-
<body>
|
|
820
|
+
<body class="code-highlighted">
|
|
691
821
|
<div class="floating-toc" id="floating-toc">
|
|
692
822
|
<div class="floating-toc-container">
|
|
693
823
|
<div class="floating-toc-header">
|
|
@@ -702,12 +832,12 @@ ol ul {
|
|
|
702
832
|
<button class="hamburger-menu" id="hamburger-menu" aria-label="Toggle navigation"></button>
|
|
703
833
|
<div class="mobile-menu-overlay" id="mobile-menu-overlay"></div>
|
|
704
834
|
|
|
705
|
-
<nav class="main-toc"><ul><li><a href="Home.html">Home</a></li><li><a href="Getting-Started.html">Getting Started</a></li><li><a href="Installation.html">Installation</a></li><li><a href="Usage.html">Usage</a></li><li><a href="Syntax.html">Syntax</a></li><li><a href="Inline-Attribute-Lists.html">Inline Attribute Lists</a></li><li><a href="Modes.html">Modes</a></li><li><a href="Command-Line-Options.html">Command Line Options</a></li><li><a href="Multi-File-Documents.html">Multi-file Documents</a></li><li><a href="Citations.html">Citations</a></li><li><a href="Metadata-Transforms.html">Metadata Transforms</a></li><li><a href="Pandoc-Integration.html">Integrating with Pandoc</a></li><li><a href="Header-IDs.html">Header IDs</a></li><li><a href="C-API.html">C API</a></li><li><a href="Xcode-Integration.html">Xcode Integration</a></li><li><a href="Examples.html">Examples</a></li><li><a href="Plugins.html">Plugins</a></li><li><a href="Troubleshooting.html">Troubleshooting</a></li><li><a href="Credits.html">Credits</a></li></ul></nav>
|
|
835
|
+
<nav class="main-toc"><ul><li><a href="Home.html">Home</a></li><li><a href="Getting-Started.html">Getting Started</a></li><li><a href="Installation.html">Installation</a></li><li><a href="Usage.html">Usage</a></li><li><a href="Syntax.html">Syntax</a></li><li><a href="Callouts.html">Callouts</a></li><li><a href="Tables.html">Tables</a></li><li><a href="Inline-Attribute-Lists.html">Inline Attribute Lists</a></li><li><a href="Modes.html">Modes</a></li><li><a href="Quarto-Mode.html">Quarto Mode</a></li><li><a href="Command-Line-Options.html">Command Line Options</a></li><li><a href="Rendering-Markdown-In-Terminal.html">Rendering Markdown in the Terminal</a></li><li><a href="Generating-Man-Pages.html">Generating Man Pages</a></li><li><a href="Multi-File-Documents.html">Multi-file Documents</a></li><li><a href="Citations.html">Citations</a></li><li><a href="Indices.html">Indices</a></li><li><a href="Metadata-Transforms.html">Metadata Transforms</a></li><li><a href="Pandoc-Integration.html">Integrating with Pandoc</a></li><li><a href="Using-Apex-with-Jekyll.html">Using Apex with Jekyll</a></li><li><a href="Header-IDs.html">Header IDs</a></li><li><a href="C-API.html">C API</a></li><li><a href="Writing-Tests.html">Writing Tests</a></li><li><a href="Xcode-Integration.html">Xcode Integration</a></li><li><a href="Examples.html">Examples</a></li><li><a href="Plugins.html">Plugins</a></li><li><a href="Filters.html">Filters</a></li><li><a href="Troubleshooting.html">Troubleshooting</a></li><li><a href="Credits.html">Credits</a></li></ul></nav>
|
|
706
836
|
|
|
707
837
|
<h1 id="plugins">
|
|
708
838
|
Plugins
|
|
709
839
|
</h1>
|
|
710
|
-
<nav class="page-toc" id="page-toc-top"><ul><li><a href="#plugins">Plugins</a><ul><li><a href="#enabling-and-disabling-plugins">Enabling and disabling
|
|
840
|
+
<nav class="page-toc" id="page-toc-top"><ul><li><a href="#plugins">Plugins</a><ul><li><a href="#enabling-and-disabling-plugins">Enabling and disabling plugins</a></li><li><a href="#where-plugins-live">Where plugins live</a></li><li><a href="#disabling-a-global-plugin-within-a-project-shadowno-op">Disabling a global plugin within a project (shadow/no-op)</a></li><li><a href="#processing-phases">Processing phases</a></li><li><a href="#plugin-manifest-pluginyml">Plugin manifest: plugin.yml</a><ul><li><a href="#metadata-fields-for-directories-and-installers">Metadata fields for directories and installers</a></li><li><a href="#post-install-hooks-postinstall">Post-install hooks (post_install)</a></li></ul></li><li><a href="#plugin-bundles-bundle-key">Plugin bundles (bundle key)</a><ul><li><a href="#bundle-structure">Bundle structure</a></li><li><a href="#inheritance-and-overrides">Inheritance and overrides</a></li><li><a href="#behavior-and-limitations">Behavior and limitations</a></li></ul></li><li><a href="#external-handler-plugins-scriptscommands">External handler plugins (scripts/commands)</a><ul><li><a href="#manifest-fields">Manifest fields</a></li><li><a href="#json-protocol">JSON protocol</a></li></ul></li><li><a href="#declarative-regex-plugins-no-scripting">Declarative regex plugins (no scripting)</a><ul><li><a href="#manifest-fields">Manifest fields</a></li></ul></li><li><a href="#support-directory-and-environment-variables">Support directory and environment variables</a><ul><li><a href="#support-directory-apexsupportdir">Support directory (APEX_SUPPORT_DIR)</a></li><li><a href="#environment-variables-for-external-plugins">Environment variables for external plugins</a></li></ul></li><li><a href="#installing-plugins-from-the-directory">Installing plugins from the directory</a><ul><li><a href="#listing-available-plugins">Listing available plugins</a></li><li><a href="#installing-a-plugin">Installing a plugin</a><ul><li><a href="#security-confirmation-for-direct-installs">Security confirmation for direct installs</a></li><li><a href="#installation-process">Installation process</a></li></ul></li><li><a href="#uninstalling-a-plugin">Uninstalling a plugin</a></li></ul></li><li><a href="#share-your-plugin">Share Your Plugin</a></li><li><a href="#example-kbd-liquid-tag-plugin">Example: kbd liquid tag plugin</a><ul><li><a href="#directory-layout">Directory layout</a></li><li><a href="#pluginyml">plugin.yml</a></li><li><a href="#kbdpluginrb-simplified-shape">kbd_plugin.rb (simplified shape)</a></li></ul></li><li><a href="#example-emoji-span-plugin-declarative">Example: :emoji: span plugin (declarative)</a><ul><li><a href="#directory-layout">Directory layout</a></li><li><a href="#pluginyml">plugin.yml</a></li></ul></li><li><a href="#putting-it-all-together">Putting it all together</a></li></ul></li></ul></nav>
|
|
711
841
|
|
|
712
842
|
<p>
|
|
713
843
|
Apex supports a lightweight plugin system that lets you add new syntax and post‑processing behavior <strong>without patching the core</strong>. Plugins can be small scripts (Ruby, Python, etc.) or simple declarative regex rules defined in YAML.
|
|
@@ -720,54 +850,58 @@ ol ul {
|
|
|
720
850
|
<ul>
|
|
721
851
|
|
|
722
852
|
<li>
|
|
723
|
-
<strong>
|
|
853
|
+
<strong>Where plugins live</strong>
|
|
724
854
|
</li>
|
|
725
855
|
|
|
726
856
|
<li>
|
|
727
|
-
<strong>
|
|
857
|
+
<strong>How to enable/disable plugins</strong>
|
|
728
858
|
</li>
|
|
729
859
|
|
|
730
860
|
<li>
|
|
731
|
-
<strong>
|
|
861
|
+
<strong>Processing phases</strong>
|
|
732
862
|
</li>
|
|
733
863
|
|
|
734
864
|
<li>
|
|
735
|
-
<strong>
|
|
865
|
+
<strong>Plugin manifest format (<code>plugin.yml</code>)</strong>
|
|
736
866
|
</li>
|
|
737
867
|
|
|
738
868
|
<li>
|
|
739
|
-
<strong>
|
|
869
|
+
<strong>External handler plugins (scripts/commands)</strong>
|
|
740
870
|
</li>
|
|
741
871
|
|
|
742
872
|
<li>
|
|
743
|
-
<strong>
|
|
873
|
+
<strong>Declarative regex plugins (pure YAML)</strong>
|
|
744
874
|
</li>
|
|
745
875
|
|
|
746
876
|
<li>
|
|
747
|
-
<strong>
|
|
877
|
+
<strong>Plugin bundles (<code>bundle</code> key)</strong>
|
|
748
878
|
</li>
|
|
749
879
|
|
|
750
880
|
<li>
|
|
751
|
-
<strong>
|
|
881
|
+
<strong>Support directory and environment variables</strong>
|
|
752
882
|
</li>
|
|
753
883
|
|
|
754
884
|
<li>
|
|
755
|
-
<strong>
|
|
885
|
+
<strong>Plugin metadata for directories and installers</strong>
|
|
756
886
|
</li>
|
|
757
887
|
|
|
758
888
|
<li>
|
|
759
|
-
<strong>
|
|
889
|
+
<strong>Installing plugins from the directory or a Git URL</strong>
|
|
760
890
|
</li>
|
|
761
891
|
|
|
762
892
|
<li>
|
|
763
|
-
<strong>
|
|
893
|
+
<strong>Examples: <code>kbd</code> liquid tag and <code><span class=\"emoji\">:emoji:</span></code> spans</strong>
|
|
764
894
|
</li>
|
|
765
895
|
|
|
766
896
|
</ul>
|
|
767
897
|
|
|
898
|
+
<p>
|
|
899
|
+
If you are using plugins from Swift/Xcode, see <a href="Xcode-Integration#apexoptions-vs-apex_options">Xcode Integration</a> for guidance on when to use high-level <code>ApexOptions</code> vs low-level <code>apex_options</code> and required imports (<code>Apex</code> + <code>ApexC</code>) for direct C struct field access.
|
|
900
|
+
</p>
|
|
901
|
+
|
|
768
902
|
<hr />
|
|
769
903
|
<h2 id="enabling-and-disabling-plugins">
|
|
770
|
-
Enabling and disabling
|
|
904
|
+
Enabling and disabling plugins
|
|
771
905
|
</h2>
|
|
772
906
|
|
|
773
907
|
<p>
|
|
@@ -779,17 +913,17 @@ ol ul {
|
|
|
779
913
|
<li>
|
|
780
914
|
|
|
781
915
|
<p>
|
|
782
|
-
<strong>
|
|
916
|
+
<strong>CLI flags</strong>
|
|
783
917
|
</p>
|
|
784
918
|
|
|
785
919
|
<ul>
|
|
786
920
|
|
|
787
921
|
<li>
|
|
788
|
-
<strong>
|
|
922
|
+
<strong>Enable plugins</strong>: <code>apex --plugins input.md</code>
|
|
789
923
|
</li>
|
|
790
924
|
|
|
791
925
|
<li>
|
|
792
|
-
<strong>
|
|
926
|
+
<strong>Disable plugins</strong>: <code>apex --no-plugins input.md</code>
|
|
793
927
|
</li>
|
|
794
928
|
|
|
795
929
|
</ul>
|
|
@@ -799,7 +933,7 @@ ol ul {
|
|
|
799
933
|
<li>
|
|
800
934
|
|
|
801
935
|
<p>
|
|
802
|
-
<strong>
|
|
936
|
+
<strong>Metadata keys</strong> (in the document’s front matter)
|
|
803
937
|
</p>
|
|
804
938
|
|
|
805
939
|
<ul>
|
|
@@ -834,11 +968,13 @@ ol ul {
|
|
|
834
968
|
Example:
|
|
835
969
|
</p>
|
|
836
970
|
|
|
837
|
-
<
|
|
838
|
-
<span
|
|
839
|
-
<span class="
|
|
971
|
+
<div class="highlight">
|
|
972
|
+
<pre><span></span><span class="nn">---</span>
|
|
973
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Plugin demo</span>
|
|
974
|
+
<span class="nt">plugins</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
|
840
975
|
<span class="nn">---</span>
|
|
841
|
-
</
|
|
976
|
+
</pre>
|
|
977
|
+
</div>
|
|
842
978
|
|
|
843
979
|
</li>
|
|
844
980
|
|
|
@@ -849,7 +985,7 @@ ol ul {
|
|
|
849
985
|
<li>
|
|
850
986
|
|
|
851
987
|
<p>
|
|
852
|
-
<strong>
|
|
988
|
+
<strong>Precedence</strong>
|
|
853
989
|
</p>
|
|
854
990
|
|
|
855
991
|
<ul>
|
|
@@ -886,11 +1022,11 @@ ol ul {
|
|
|
886
1022
|
|
|
887
1023
|
<hr />
|
|
888
1024
|
<h2 id="where-plugins-live">
|
|
889
|
-
Where plugins
|
|
1025
|
+
Where plugins live
|
|
890
1026
|
</h2>
|
|
891
1027
|
|
|
892
1028
|
<p>
|
|
893
|
-
Plugins are discovered from <strong>
|
|
1029
|
+
Plugins are discovered from <strong>project</strong> and <strong>user</strong> locations, in this order:
|
|
894
1030
|
</p>
|
|
895
1031
|
|
|
896
1032
|
<ul>
|
|
@@ -898,13 +1034,13 @@ ol ul {
|
|
|
898
1034
|
<li>
|
|
899
1035
|
|
|
900
1036
|
<p>
|
|
901
|
-
<strong>
|
|
1037
|
+
<strong>Project-local plugins (current directory)</strong>
|
|
902
1038
|
</p>
|
|
903
1039
|
|
|
904
1040
|
<ul>
|
|
905
1041
|
|
|
906
1042
|
<li>
|
|
907
|
-
Directory: <code>.apex/plugins/</code>
|
|
1043
|
+
Directory: <code>.apex/plugins/</code> under the <strong>current working directory</strong>.
|
|
908
1044
|
</li>
|
|
909
1045
|
|
|
910
1046
|
<li>
|
|
@@ -934,7 +1070,59 @@ ol ul {
|
|
|
934
1070
|
<li>
|
|
935
1071
|
|
|
936
1072
|
<p>
|
|
937
|
-
<strong>
|
|
1073
|
+
<strong>Project-local plugins (base directory)</strong>
|
|
1074
|
+
</p>
|
|
1075
|
+
|
|
1076
|
+
<ul>
|
|
1077
|
+
|
|
1078
|
+
<li>
|
|
1079
|
+
If Apex knows a <code>base_directory</code> (from <code>--base-dir</code>, metadata, or the input file’s directory), it also looks in:
|
|
1080
|
+
<ul>
|
|
1081
|
+
|
|
1082
|
+
<li>
|
|
1083
|
+
<code><base_directory>/.apex/plugins/</code>
|
|
1084
|
+
</li>
|
|
1085
|
+
|
|
1086
|
+
</ul>
|
|
1087
|
+
|
|
1088
|
+
</li>
|
|
1089
|
+
|
|
1090
|
+
</ul>
|
|
1091
|
+
|
|
1092
|
+
</li>
|
|
1093
|
+
|
|
1094
|
+
<li>
|
|
1095
|
+
|
|
1096
|
+
<p>
|
|
1097
|
+
<strong>Project-local plugins (Git repository root)</strong>
|
|
1098
|
+
</p>
|
|
1099
|
+
|
|
1100
|
+
<ul>
|
|
1101
|
+
|
|
1102
|
+
<li>
|
|
1103
|
+
If the current directory is inside a Git repository and <code>git rev-parse --show-toplevel</code> succeeds, Apex will also look in:
|
|
1104
|
+
<ul>
|
|
1105
|
+
|
|
1106
|
+
<li>
|
|
1107
|
+
<code><git-top-level>/.apex/plugins/</code>
|
|
1108
|
+
</li>
|
|
1109
|
+
|
|
1110
|
+
</ul>
|
|
1111
|
+
|
|
1112
|
+
</li>
|
|
1113
|
+
|
|
1114
|
+
<li>
|
|
1115
|
+
This is only used when the Git top-level is a parent of (or equal to) the current directory.
|
|
1116
|
+
</li>
|
|
1117
|
+
|
|
1118
|
+
</ul>
|
|
1119
|
+
|
|
1120
|
+
</li>
|
|
1121
|
+
|
|
1122
|
+
<li>
|
|
1123
|
+
|
|
1124
|
+
<p>
|
|
1125
|
+
<strong>Global (user) plugins</strong>
|
|
938
1126
|
</p>
|
|
939
1127
|
|
|
940
1128
|
<ul>
|
|
@@ -994,140 +1182,233 @@ ol ul {
|
|
|
994
1182
|
</ul>
|
|
995
1183
|
|
|
996
1184
|
<p>
|
|
997
|
-
<strong>
|
|
1185
|
+
<strong>Plugin IDs must be unique.</strong> If a project plugin and a global plugin share the same <code>id</code>, the <strong>project plugin wins</strong> and the global one is ignored.
|
|
998
1186
|
</p>
|
|
999
1187
|
|
|
1000
1188
|
<hr />
|
|
1001
|
-
<h2 id="
|
|
1002
|
-
|
|
1189
|
+
<h2 id="disabling-a-global-plugin-within-a-project-shadowno-op">
|
|
1190
|
+
Disabling a global plugin within a project (shadow/no-op)
|
|
1003
1191
|
</h2>
|
|
1004
1192
|
|
|
1005
1193
|
<p>
|
|
1006
|
-
|
|
1194
|
+
Sometimes you may want to <strong>disable</strong> a plugin that is installed globally, but only for a specific project. Apex’s lookup order makes this easy: you can <strong>shadow</strong> a global plugin with a <strong>no-op project plugin</strong> that has the same <code>id</code>.
|
|
1195
|
+
</p>
|
|
1196
|
+
|
|
1197
|
+
<p>
|
|
1198
|
+
Key points:
|
|
1007
1199
|
</p>
|
|
1008
1200
|
|
|
1009
1201
|
<ul>
|
|
1010
1202
|
|
|
1203
|
+
<li>
|
|
1204
|
+
<strong>Project plugins are loaded before global plugins.</strong>
|
|
1205
|
+
</li>
|
|
1206
|
+
|
|
1207
|
+
<li>
|
|
1208
|
+
If two plugins share the same <code>id</code>, the <strong>first one wins</strong> and the later one is ignored.
|
|
1209
|
+
</li>
|
|
1210
|
+
|
|
1211
|
+
<li>
|
|
1212
|
+
A plugin that has <strong>no handler and no regex</strong> is a <strong>true no-op</strong>: it is loaded, but never changes the text.
|
|
1213
|
+
</li>
|
|
1214
|
+
|
|
1215
|
+
</ul>
|
|
1216
|
+
|
|
1217
|
+
<p>
|
|
1218
|
+
To disable a global plugin called <code>emoji-span</code> just for one project:
|
|
1219
|
+
</p>
|
|
1220
|
+
|
|
1221
|
+
<ol>
|
|
1222
|
+
|
|
1011
1223
|
<li>
|
|
1012
1224
|
|
|
1013
1225
|
<p>
|
|
1014
|
-
|
|
1226
|
+
Create a project plugins directory:
|
|
1015
1227
|
</p>
|
|
1016
1228
|
|
|
1017
|
-
<
|
|
1229
|
+
<div class="highlight">
|
|
1230
|
+
<pre><span></span>.apex/
|
|
1231
|
+
plugins/
|
|
1232
|
+
emoji-span/
|
|
1233
|
+
plugin.yml
|
|
1234
|
+
</pre>
|
|
1235
|
+
</div>
|
|
1018
1236
|
|
|
1019
|
-
|
|
1020
|
-
Runs on the <strong>raw Markdown text</strong> <em>before</em> it is parsed.
|
|
1021
|
-
</li>
|
|
1237
|
+
</li>
|
|
1022
1238
|
|
|
1023
|
-
|
|
1024
|
-
Good for:
|
|
1025
|
-
<ul>
|
|
1239
|
+
<li>
|
|
1026
1240
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1241
|
+
<p>
|
|
1242
|
+
Add a minimal <strong>no-op</strong> manifest that declares the same <code>id</code> and a phase, but no handler or pattern:
|
|
1243
|
+
</p>
|
|
1030
1244
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1245
|
+
<div class="highlight">
|
|
1246
|
+
<pre><span></span><span class="nn">---</span>
|
|
1247
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
|
|
1248
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span><span class="w"> </span><span class="c1"># or pre_parse, depending on the original plugin</span>
|
|
1249
|
+
<span class="c1"># No handler.command, pattern, or replacement on purpose:</span>
|
|
1250
|
+
<span class="c1"># this plugin will be loaded, but it does nothing.</span>
|
|
1251
|
+
<span class="nn">---</span>
|
|
1252
|
+
</pre>
|
|
1253
|
+
</div>
|
|
1034
1254
|
|
|
1035
|
-
|
|
1036
|
-
Adding/removing markup before Apex sees it
|
|
1037
|
-
</li>
|
|
1255
|
+
</li>
|
|
1038
1256
|
|
|
1039
|
-
|
|
1257
|
+
</ol>
|
|
1040
1258
|
|
|
1041
|
-
|
|
1259
|
+
<p>
|
|
1260
|
+
When you run Apex with plugins enabled in that project:
|
|
1261
|
+
</p>
|
|
1042
1262
|
|
|
1043
|
-
|
|
1263
|
+
<ul>
|
|
1044
1264
|
|
|
1045
|
-
|
|
1265
|
+
<li>
|
|
1266
|
+
The project-local <code>emoji-span</code> plugin is discovered first.
|
|
1267
|
+
</li>
|
|
1046
1268
|
|
|
1047
|
-
|
|
1269
|
+
<li>
|
|
1270
|
+
Because a plugin with id <code>emoji-span</code> already exists, the <strong>global</strong> <code>emoji-span</code> plugin is <strong>skipped</strong>.
|
|
1271
|
+
</li>
|
|
1048
1272
|
|
|
1049
|
-
|
|
1050
|
-
<strong
|
|
1051
|
-
|
|
1273
|
+
<li>
|
|
1274
|
+
Since the project version has no handler or regex, it is effectively a <strong>no-op</strong>, which means the global plugin is <strong>disabled for this project only</strong>.
|
|
1275
|
+
</li>
|
|
1052
1276
|
|
|
1053
|
-
|
|
1277
|
+
</ul>
|
|
1054
1278
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1279
|
+
<hr />
|
|
1280
|
+
<h2 id="processing-phases">
|
|
1281
|
+
Processing phases
|
|
1282
|
+
</h2>
|
|
1058
1283
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1284
|
+
<p>
|
|
1285
|
+
Apex exposes several <strong>phases</strong> in its pipeline. Plugins can hook into one or more phases; for now, two are wired up:
|
|
1286
|
+
</p>
|
|
1062
1287
|
|
|
1063
|
-
|
|
1064
|
-
Wrapping elements in spans/divs
|
|
1065
|
-
</li>
|
|
1288
|
+
<ul>
|
|
1066
1289
|
|
|
1067
|
-
|
|
1068
|
-
Adding CSS classes
|
|
1069
|
-
</li>
|
|
1290
|
+
<li>
|
|
1070
1291
|
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1292
|
+
<p>
|
|
1293
|
+
<strong><code>pre_parse</code></strong>
|
|
1294
|
+
</p>
|
|
1074
1295
|
|
|
1075
|
-
|
|
1296
|
+
<ul>
|
|
1076
1297
|
|
|
1077
|
-
|
|
1298
|
+
<li>
|
|
1299
|
+
Runs on the <strong>raw Markdown text</strong> <em>before</em> it is parsed.
|
|
1300
|
+
</li>
|
|
1078
1301
|
|
|
1079
|
-
|
|
1302
|
+
<li>
|
|
1303
|
+
Good for:
|
|
1304
|
+
<ul>
|
|
1080
1305
|
|
|
1081
|
-
|
|
1306
|
+
<li>
|
|
1307
|
+
Custom syntax (e.g. <code><span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span></code>)
|
|
1308
|
+
</li>
|
|
1082
1309
|
|
|
1083
|
-
|
|
1310
|
+
<li>
|
|
1311
|
+
Textual rewrites
|
|
1312
|
+
</li>
|
|
1084
1313
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1314
|
+
<li>
|
|
1315
|
+
Adding/removing markup before Apex sees it
|
|
1316
|
+
</li>
|
|
1088
1317
|
|
|
1089
|
-
|
|
1318
|
+
</ul>
|
|
1090
1319
|
|
|
1091
|
-
|
|
1092
|
-
Sorted by <strong>priority</strong> (lower numbers first; default is <code>100</code>).
|
|
1093
|
-
</li>
|
|
1320
|
+
</li>
|
|
1094
1321
|
|
|
1095
|
-
|
|
1096
|
-
Ties broken by <strong>plugin <code>id</code></strong> (lexicographically).
|
|
1097
|
-
</li>
|
|
1322
|
+
</ul>
|
|
1098
1323
|
|
|
1099
|
-
</
|
|
1324
|
+
</li>
|
|
1325
|
+
|
|
1326
|
+
<li>
|
|
1327
|
+
|
|
1328
|
+
<p>
|
|
1329
|
+
<strong><code>post_render</code></strong>
|
|
1330
|
+
</p>
|
|
1331
|
+
|
|
1332
|
+
<ul>
|
|
1333
|
+
|
|
1334
|
+
<li>
|
|
1335
|
+
Runs on the <strong>final HTML output</strong> after Apex finishes rendering.
|
|
1336
|
+
</li>
|
|
1337
|
+
|
|
1338
|
+
<li>
|
|
1339
|
+
Good for:
|
|
1340
|
+
<ul>
|
|
1341
|
+
|
|
1342
|
+
<li>
|
|
1343
|
+
Wrapping elements in spans/divs
|
|
1344
|
+
</li>
|
|
1345
|
+
|
|
1346
|
+
<li>
|
|
1347
|
+
Adding CSS classes
|
|
1348
|
+
</li>
|
|
1349
|
+
|
|
1350
|
+
<li>
|
|
1351
|
+
Simple HTML post-processing (e.g. turning <code><span class=\"emoji\">:emoji:</span></code> into <code><span></code>)
|
|
1352
|
+
</li>
|
|
1353
|
+
|
|
1354
|
+
</ul>
|
|
1355
|
+
|
|
1356
|
+
</li>
|
|
1357
|
+
|
|
1358
|
+
</ul>
|
|
1359
|
+
|
|
1360
|
+
</li>
|
|
1361
|
+
|
|
1362
|
+
</ul>
|
|
1363
|
+
|
|
1364
|
+
<p>
|
|
1365
|
+
Internally, plugins for each phase are run in a <strong>deterministic order</strong>:
|
|
1366
|
+
</p>
|
|
1367
|
+
|
|
1368
|
+
<ol>
|
|
1369
|
+
|
|
1370
|
+
<li>
|
|
1371
|
+
Sorted by <strong>priority</strong> (lower numbers first; default is <code>100</code>).
|
|
1372
|
+
</li>
|
|
1373
|
+
|
|
1374
|
+
<li>
|
|
1375
|
+
Ties broken by <strong>plugin <code>id</code></strong> (lexicographically).
|
|
1376
|
+
</li>
|
|
1377
|
+
|
|
1378
|
+
</ol>
|
|
1100
1379
|
|
|
1101
1380
|
<hr />
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1381
|
+
<h2 id="plugin-manifest-pluginyml">
|
|
1382
|
+
Plugin manifest: <code>plugin.yml</code>
|
|
1383
|
+
</h2>
|
|
1105
1384
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1385
|
+
<p>
|
|
1386
|
+
Each plugin is defined by a <strong>manifest</strong> file:
|
|
1387
|
+
</p>
|
|
1109
1388
|
|
|
1110
|
-
|
|
1389
|
+
<ul>
|
|
1111
1390
|
|
|
1112
|
-
|
|
1391
|
+
<li>
|
|
1113
1392
|
|
|
1114
|
-
|
|
1115
|
-
<strong>
|
|
1116
|
-
|
|
1393
|
+
<p>
|
|
1394
|
+
<strong>File name</strong>: <code>plugin.yml</code>
|
|
1395
|
+
</p>
|
|
1117
1396
|
|
|
1118
|
-
|
|
1397
|
+
</li>
|
|
1119
1398
|
|
|
1120
|
-
|
|
1399
|
+
<li>
|
|
1121
1400
|
|
|
1122
|
-
|
|
1123
|
-
<strong>
|
|
1124
|
-
|
|
1401
|
+
<p>
|
|
1402
|
+
<strong>Location</strong>: inside the plugin’s directory, e.g.:
|
|
1403
|
+
</p>
|
|
1125
1404
|
|
|
1126
|
-
<
|
|
1405
|
+
<div class="highlight">
|
|
1406
|
+
<pre><span></span>.apex/plugins/kbd/plugin.yml
|
|
1127
1407
|
~/.config/apex/plugins/emoji/plugin.yml
|
|
1128
|
-
</
|
|
1408
|
+
</pre>
|
|
1409
|
+
</div>
|
|
1129
1410
|
|
|
1130
|
-
|
|
1411
|
+
</li>
|
|
1131
1412
|
|
|
1132
1413
|
</ul>
|
|
1133
1414
|
|
|
@@ -1135,19 +1416,21 @@ ol ul {
|
|
|
1135
1416
|
At minimum, a plugin needs:
|
|
1136
1417
|
</p>
|
|
1137
1418
|
|
|
1138
|
-
<
|
|
1139
|
-
<span
|
|
1419
|
+
<div class="highlight">
|
|
1420
|
+
<pre><span></span><span class="nn">---</span>
|
|
1421
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-plugin</span>
|
|
1140
1422
|
<span class="c1"># Optional, but strongly recommended metadata:</span>
|
|
1141
1423
|
<span class="c1"># title: Human-friendly name (if omitted, tools may fall back to id)</span>
|
|
1142
1424
|
<span class="c1"># author: Name or handle of the plugin author</span>
|
|
1143
1425
|
<span class="c1"># description: Short, human-readable description of what the plugin does</span>
|
|
1144
1426
|
<span class="c1"># homepage: URL for the plugin landing page or README</span>
|
|
1145
1427
|
<span class="c1"># repo: Canonical Git repository URL used for installation/updates</span>
|
|
1146
|
-
<span class="
|
|
1147
|
-
<span class="
|
|
1148
|
-
<span class="
|
|
1428
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span><span class="w"> </span><span class="c1"># or post_render</span>
|
|
1429
|
+
<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span><span class="w"> </span><span class="c1"># optional, lower runs earlier</span>
|
|
1430
|
+
<span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span><span class="w"> </span><span class="c1"># optional, 0 = no extra timeout logic (best-effort)</span>
|
|
1149
1431
|
<span class="nn">---</span>
|
|
1150
|
-
</
|
|
1432
|
+
</pre>
|
|
1433
|
+
</div>
|
|
1151
1434
|
|
|
1152
1435
|
<p>
|
|
1153
1436
|
From there, you choose <strong>one of two plugin types</strong>:
|
|
@@ -1156,7 +1439,7 @@ ol ul {
|
|
|
1156
1439
|
<ul>
|
|
1157
1440
|
|
|
1158
1441
|
<li>
|
|
1159
|
-
<strong>
|
|
1442
|
+
<strong>External handler plugin</strong>
|
|
1160
1443
|
<ul>
|
|
1161
1444
|
|
|
1162
1445
|
<li>
|
|
@@ -1172,7 +1455,7 @@ ol ul {
|
|
|
1172
1455
|
</li>
|
|
1173
1456
|
|
|
1174
1457
|
<li>
|
|
1175
|
-
<strong>
|
|
1458
|
+
<strong>Declarative regex plugin</strong>
|
|
1176
1459
|
<ul>
|
|
1177
1460
|
|
|
1178
1461
|
<li>
|
|
@@ -1194,7 +1477,7 @@ ol ul {
|
|
|
1194
1477
|
</p>
|
|
1195
1478
|
|
|
1196
1479
|
<h3 id="metadata-fields-for-directories-and-installers">
|
|
1197
|
-
Metadata fields for directories and
|
|
1480
|
+
Metadata fields for directories and installers
|
|
1198
1481
|
</h3>
|
|
1199
1482
|
|
|
1200
1483
|
<p>
|
|
@@ -1204,27 +1487,27 @@ ol ul {
|
|
|
1204
1487
|
<ul>
|
|
1205
1488
|
|
|
1206
1489
|
<li>
|
|
1207
|
-
<strong><code>title</code></strong>: Short, human-friendly name for the plugin (e.g. <code>Keyboard Shortcuts</code>).
|
|
1490
|
+
<strong><code>title</code></strong>: Short, human-friendly name for the plugin (e.g. <code>Keyboard Shortcuts</code>).
|
|
1208
1491
|
</li>
|
|
1209
1492
|
|
|
1210
1493
|
<li>
|
|
1211
|
-
<strong><code>author</code></strong>: Free-form author string (your name, handle, or organization).
|
|
1494
|
+
<strong><code>author</code></strong>: Free-form author string (your name, handle, or organization).
|
|
1212
1495
|
</li>
|
|
1213
1496
|
|
|
1214
1497
|
<li>
|
|
1215
|
-
<strong><code>description</code></strong>: One–two sentence description of what the plugin does. This is already used in examples and is what directory listings will usually display.
|
|
1498
|
+
<strong><code>description</code></strong>: One–two sentence description of what the plugin does. This is already used in examples and is what directory listings will usually display.
|
|
1216
1499
|
</li>
|
|
1217
1500
|
|
|
1218
1501
|
<li>
|
|
1219
|
-
<strong><code>homepage</code></strong>: Informational URL where users can learn more about the plugin—often a README, documentation site, or the GitHub project page. This field is <strong>not</strong> used for cloning, but may be shown in <code>--list-plugins</code> output.
|
|
1502
|
+
<strong><code>homepage</code></strong>: Informational URL where users can learn more about the plugin—often a README, documentation site, or the GitHub project page. This field is <strong>not</strong> used for cloning, but may be shown in <code>--list-plugins</code> output.
|
|
1220
1503
|
</li>
|
|
1221
1504
|
|
|
1222
1505
|
<li>
|
|
1223
|
-
<strong><code>repo</code></strong>: <strong>Canonical Git URL</strong> for the plugin repository, used by Apex when installing plugins from the central directory (for example, <code>https://github.com/ApexMarkdown/apex-kbd-plugin.git</code>). The repository must contain the <code>plugin.yml</code> manifest (and any supporting files) at its root.
|
|
1506
|
+
<strong><code>repo</code></strong>: <strong>Canonical Git URL</strong> for the plugin repository, used by Apex when installing plugins from the central directory (for example, <code>https://github.com/ApexMarkdown/apex-kbd-plugin.git</code>). The repository must contain the <code>plugin.yml</code> manifest (and any supporting files) at its root.
|
|
1224
1507
|
</li>
|
|
1225
1508
|
|
|
1226
1509
|
<li>
|
|
1227
|
-
<strong><code>post_install</code></strong>: Optional command that Apex will run after cloning the plugin during <code>--install-plugin</code>. See “Post-install hooks” below.
|
|
1510
|
+
<strong><code>post_install</code></strong>: Optional command that Apex will run after cloning the plugin during <code>--install-plugin</code>. See “Post-install hooks” below.
|
|
1228
1511
|
</li>
|
|
1229
1512
|
|
|
1230
1513
|
</ul>
|
|
@@ -1234,26 +1517,30 @@ ol ul {
|
|
|
1234
1517
|
</p>
|
|
1235
1518
|
|
|
1236
1519
|
<h3 id="post-install-hooks-postinstall">
|
|
1237
|
-
Post-install hooks
|
|
1520
|
+
Post-install hooks (<code>post_install</code>)
|
|
1238
1521
|
</h3>
|
|
1239
1522
|
|
|
1240
1523
|
<p>
|
|
1241
1524
|
External plugins can define an optional <code>post_install</code> command in <code>plugin.yml</code> that Apex will run immediately after cloning the plugin during <code>--install-plugin</code>:
|
|
1242
1525
|
</p>
|
|
1243
1526
|
|
|
1244
|
-
<
|
|
1245
|
-
<span
|
|
1527
|
+
<div class="highlight">
|
|
1528
|
+
<pre><span></span><span class="nn">---</span>
|
|
1529
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
|
|
1246
1530
|
<span class="c1"># ... other fields ...</span>
|
|
1247
|
-
<span class="
|
|
1531
|
+
<span class="nt">post_install</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">./post_install.sh</span>
|
|
1248
1532
|
<span class="nn">---</span>
|
|
1249
|
-
</
|
|
1533
|
+
</pre>
|
|
1534
|
+
</div>
|
|
1250
1535
|
|
|
1251
1536
|
<p>
|
|
1252
1537
|
When you run:
|
|
1253
1538
|
</p>
|
|
1254
1539
|
|
|
1255
|
-
<
|
|
1256
|
-
|
|
1540
|
+
<div class="highlight">
|
|
1541
|
+
<pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>kbd
|
|
1542
|
+
</pre>
|
|
1543
|
+
</div>
|
|
1257
1544
|
|
|
1258
1545
|
<p>
|
|
1259
1546
|
Apex will:
|
|
@@ -1301,7 +1588,7 @@ ol ul {
|
|
|
1301
1588
|
|
|
1302
1589
|
<hr />
|
|
1303
1590
|
<h2 id="plugin-bundles-bundle-key">
|
|
1304
|
-
Plugin bundles (<code>bundle</code
|
|
1591
|
+
Plugin bundles (<code>bundle</code> key)
|
|
1305
1592
|
</h2>
|
|
1306
1593
|
|
|
1307
1594
|
<p>
|
|
@@ -1311,7 +1598,7 @@ ol ul {
|
|
|
1311
1598
|
<ul>
|
|
1312
1599
|
|
|
1313
1600
|
<li>
|
|
1314
|
-
<code>kbd</code> – expands <code
|
|
1601
|
+
<code>kbd</code> – expands <code><span class="keycombo combined" title="Command-3"><kbd class="mod symbol">&#8984;</kbd><kbd class="key symbol">3</kbd></span></code> keyboard shortcuts
|
|
1315
1602
|
</li>
|
|
1316
1603
|
|
|
1317
1604
|
<li>
|
|
@@ -1329,7 +1616,7 @@ ol ul {
|
|
|
1329
1616
|
</p>
|
|
1330
1617
|
|
|
1331
1618
|
<h3 id="bundle-structure">
|
|
1332
|
-
Bundle
|
|
1619
|
+
Bundle structure
|
|
1333
1620
|
</h3>
|
|
1334
1621
|
|
|
1335
1622
|
<p>
|
|
@@ -1352,39 +1639,41 @@ ol ul {
|
|
|
1352
1639
|
Example:
|
|
1353
1640
|
</p>
|
|
1354
1641
|
|
|
1355
|
-
<
|
|
1356
|
-
<span
|
|
1357
|
-
<span class="
|
|
1358
|
-
<span class="
|
|
1359
|
-
<span class="
|
|
1360
|
-
<span class="
|
|
1361
|
-
<span class="
|
|
1642
|
+
<div class="highlight">
|
|
1643
|
+
<pre><span></span><span class="nn">---</span>
|
|
1644
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">documentation</span>
|
|
1645
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Documentation helpers</span>
|
|
1646
|
+
<span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
|
|
1647
|
+
<span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">A bundle of documentation-related helpers (kbd, menubar, prefpane).</span>
|
|
1648
|
+
<span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-plugin-documentation</span>
|
|
1649
|
+
<span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-plugin-documentation.git</span>
|
|
1362
1650
|
|
|
1363
1651
|
<span class="c1"># Each entry in bundle defines a child plugin</span>
|
|
1364
|
-
<span class="
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1652
|
+
<span class="nt">bundle</span><span class="p">:</span>
|
|
1653
|
+
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
|
|
1654
|
+
<span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
|
|
1655
|
+
<span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render <span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span> key combos to HTML <kbd> elements</span>
|
|
1656
|
+
<span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
|
|
1657
|
+
<span class="w"> </span><span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
|
|
1658
|
+
<span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
|
|
1659
|
+
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">"ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb"</span>
|
|
1660
|
+
|
|
1661
|
+
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">menubar</span>
|
|
1662
|
+
<span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Menubar Paths</span>
|
|
1663
|
+
<span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render {% menubar File, Open %} to a styled menu path</span>
|
|
1664
|
+
<span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
|
|
1665
|
+
<span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
|
|
1666
|
+
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">"ruby</span><span class="nv"> </span><span class="s">menubar_plugin.rb"</span>
|
|
1667
|
+
|
|
1668
|
+
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">prefspane</span>
|
|
1669
|
+
<span class="w"> </span><span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Preferences Pane</span>
|
|
1670
|
+
<span class="w"> </span><span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render {% prefspane Advanced, Processor %} to a styled preference path</span>
|
|
1671
|
+
<span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
|
|
1672
|
+
<span class="w"> </span><span class="nt">handler</span><span class="p">:</span>
|
|
1673
|
+
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">"ruby</span><span class="nv"> </span><span class="s">prefspane_plugin.rb"</span>
|
|
1386
1674
|
<span class="nn">---</span>
|
|
1387
|
-
</
|
|
1675
|
+
</pre>
|
|
1676
|
+
</div>
|
|
1388
1677
|
|
|
1389
1678
|
<p>
|
|
1390
1679
|
Apex will treat this as <strong>three distinct plugins</strong>:
|
|
@@ -1411,7 +1700,7 @@ ol ul {
|
|
|
1411
1700
|
</p>
|
|
1412
1701
|
|
|
1413
1702
|
<h3 id="inheritance-and-overrides">
|
|
1414
|
-
Inheritance and
|
|
1703
|
+
Inheritance and overrides
|
|
1415
1704
|
</h3>
|
|
1416
1705
|
|
|
1417
1706
|
<p>
|
|
@@ -1523,13 +1812,13 @@ ol ul {
|
|
|
1523
1812
|
</p>
|
|
1524
1813
|
|
|
1525
1814
|
<h3 id="behavior-and-limitations">
|
|
1526
|
-
Behavior and
|
|
1815
|
+
Behavior and limitations
|
|
1527
1816
|
</h3>
|
|
1528
1817
|
|
|
1529
1818
|
<ul>
|
|
1530
1819
|
|
|
1531
1820
|
<li>
|
|
1532
|
-
<strong>
|
|
1821
|
+
<strong>Discovery</strong>:
|
|
1533
1822
|
<ul>
|
|
1534
1823
|
|
|
1535
1824
|
<li>
|
|
@@ -1553,7 +1842,7 @@ ol ul {
|
|
|
1553
1842
|
</li>
|
|
1554
1843
|
|
|
1555
1844
|
<li>
|
|
1556
|
-
<strong>
|
|
1845
|
+
<strong>Phases and IDs</strong>:
|
|
1557
1846
|
<ul>
|
|
1558
1847
|
|
|
1559
1848
|
<li>
|
|
@@ -1581,7 +1870,7 @@ ol ul {
|
|
|
1581
1870
|
</li>
|
|
1582
1871
|
|
|
1583
1872
|
<li>
|
|
1584
|
-
<strong>
|
|
1873
|
+
<strong>libyaml requirement</strong>:
|
|
1585
1874
|
<ul>
|
|
1586
1875
|
|
|
1587
1876
|
<li>
|
|
@@ -1600,7 +1889,7 @@ ol ul {
|
|
|
1600
1889
|
|
|
1601
1890
|
<hr />
|
|
1602
1891
|
<h2 id="external-handler-plugins-scriptscommands">
|
|
1603
|
-
External handler plugins
|
|
1892
|
+
External handler plugins (scripts/commands)
|
|
1604
1893
|
</h2>
|
|
1605
1894
|
|
|
1606
1895
|
<p>
|
|
@@ -1608,48 +1897,50 @@ ol ul {
|
|
|
1608
1897
|
</p>
|
|
1609
1898
|
|
|
1610
1899
|
<h3 id="manifest-fields">
|
|
1611
|
-
Manifest
|
|
1900
|
+
Manifest fields
|
|
1612
1901
|
</h3>
|
|
1613
1902
|
|
|
1614
|
-
<
|
|
1615
|
-
<span
|
|
1616
|
-
<span class="
|
|
1617
|
-
<span class="
|
|
1618
|
-
<span class="
|
|
1619
|
-
<span class="
|
|
1620
|
-
<span class="
|
|
1621
|
-
<span class="
|
|
1622
|
-
<span class="
|
|
1623
|
-
<span class="
|
|
1624
|
-
<span class="
|
|
1625
|
-
|
|
1903
|
+
<div class="highlight">
|
|
1904
|
+
<pre><span></span><span class="nn">---</span>
|
|
1905
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
|
|
1906
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
|
|
1907
|
+
<span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
|
|
1908
|
+
<span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render <span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span> key combos to HTML</span>
|
|
1909
|
+
<span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin</span>
|
|
1910
|
+
<span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin.git</span>
|
|
1911
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
|
|
1912
|
+
<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
|
|
1913
|
+
<span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span><span class="w"> </span><span class="c1"># optional</span>
|
|
1914
|
+
<span class="nt">handler</span><span class="p">:</span>
|
|
1915
|
+
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">"ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb"</span>
|
|
1626
1916
|
<span class="nn">---</span>
|
|
1627
|
-
</
|
|
1917
|
+
</pre>
|
|
1918
|
+
</div>
|
|
1628
1919
|
|
|
1629
1920
|
<ul>
|
|
1630
1921
|
|
|
1631
1922
|
<li>
|
|
1632
|
-
<strong><code>id</code></strong>: unique identifier (no spaces recommended).
|
|
1923
|
+
<strong><code>id</code></strong>: unique identifier (no spaces recommended).
|
|
1633
1924
|
</li>
|
|
1634
1925
|
|
|
1635
1926
|
<li>
|
|
1636
|
-
<strong><code>title</code>/<code>author</code>/<code>description</code>/<code>homepage</code>/<code>repo</code></strong>: optional metadata used by listing/installation tools and plugin directories.
|
|
1927
|
+
<strong><code>title</code>/<code>author</code>/<code>description</code>/<code>homepage</code>/<code>repo</code></strong>: optional metadata used by listing/installation tools and plugin directories.
|
|
1637
1928
|
</li>
|
|
1638
1929
|
|
|
1639
1930
|
<li>
|
|
1640
|
-
<strong><code>phase</code></strong>: <code>pre_parse</code> or <code>post_render</code>.
|
|
1931
|
+
<strong><code>phase</code></strong>: <code>pre_parse</code> or <code>post_render</code>.
|
|
1641
1932
|
</li>
|
|
1642
1933
|
|
|
1643
1934
|
<li>
|
|
1644
|
-
<strong><code>priority</code></strong>: integer; lower runs first.
|
|
1935
|
+
<strong><code>priority</code></strong>: integer; lower runs first.
|
|
1645
1936
|
</li>
|
|
1646
1937
|
|
|
1647
1938
|
<li>
|
|
1648
|
-
<strong><code>timeout_ms</code></strong>: optional; host may use this as a soft cap.
|
|
1939
|
+
<strong><code>timeout_ms</code></strong>: optional; host may use this as a soft cap.
|
|
1649
1940
|
</li>
|
|
1650
1941
|
|
|
1651
1942
|
<li>
|
|
1652
|
-
<strong><code>handler.command</code></strong>:
|
|
1943
|
+
<strong><code>handler.command</code></strong>:
|
|
1653
1944
|
<ul>
|
|
1654
1945
|
|
|
1655
1946
|
<li>
|
|
@@ -1667,20 +1958,22 @@ ol ul {
|
|
|
1667
1958
|
</ul>
|
|
1668
1959
|
|
|
1669
1960
|
<h3 id="json-protocol">
|
|
1670
|
-
JSON
|
|
1961
|
+
JSON protocol
|
|
1671
1962
|
</h3>
|
|
1672
1963
|
|
|
1673
1964
|
<p>
|
|
1674
1965
|
For text phases (<code>pre_parse</code>, <code>post_render</code>), Apex sends your command a JSON object on <strong>stdin</strong>:
|
|
1675
1966
|
</p>
|
|
1676
1967
|
|
|
1677
|
-
<
|
|
1678
|
-
|
|
1679
|
-
</span><span class="
|
|
1680
|
-
</span><span class="
|
|
1681
|
-
</span><span class="
|
|
1682
|
-
</span><span class="p">
|
|
1683
|
-
</span
|
|
1968
|
+
<div class="highlight">
|
|
1969
|
+
<pre><span></span><span class="p">{</span>
|
|
1970
|
+
<span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
|
1971
|
+
<span class="w"> </span><span class="nt">"plugin_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"kbd"</span><span class="p">,</span>
|
|
1972
|
+
<span class="w"> </span><span class="nt">"phase"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pre_parse"</span><span class="p">,</span>
|
|
1973
|
+
<span class="w"> </span><span class="nt">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"raw or rendered text here"</span>
|
|
1974
|
+
<span class="p">}</span>
|
|
1975
|
+
</pre>
|
|
1976
|
+
</div>
|
|
1684
1977
|
|
|
1685
1978
|
<p>
|
|
1686
1979
|
Your plugin should:
|
|
@@ -1712,7 +2005,7 @@ ol ul {
|
|
|
1712
2005
|
|
|
1713
2006
|
<hr />
|
|
1714
2007
|
<h2 id="declarative-regex-plugins-no-scripting">
|
|
1715
|
-
Declarative regex plugins (no
|
|
2008
|
+
Declarative regex plugins (no scripting)
|
|
1716
2009
|
</h2>
|
|
1717
2010
|
|
|
1718
2011
|
<p>
|
|
@@ -1720,33 +2013,35 @@ ol ul {
|
|
|
1720
2013
|
</p>
|
|
1721
2014
|
|
|
1722
2015
|
<h3 id="manifest-fields">
|
|
1723
|
-
Manifest
|
|
2016
|
+
Manifest fields
|
|
1724
2017
|
</h3>
|
|
1725
2018
|
|
|
1726
|
-
<
|
|
1727
|
-
<span
|
|
1728
|
-
<span class="
|
|
1729
|
-
<span class="
|
|
1730
|
-
<span class="
|
|
1731
|
-
<span class="
|
|
1732
|
-
<span class="
|
|
1733
|
-
<span class="
|
|
1734
|
-
<span class="
|
|
1735
|
-
<span class="
|
|
1736
|
-
<span class="
|
|
1737
|
-
<span class="
|
|
1738
|
-
<span class="
|
|
2019
|
+
<div class="highlight">
|
|
2020
|
+
<pre><span></span><span class="nn">---</span>
|
|
2021
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
|
|
2022
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Emoji span wrapper</span>
|
|
2023
|
+
<span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
|
|
2024
|
+
<span class="nt">description: Wrap :emoji</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">markers in a span for styling</span>
|
|
2025
|
+
<span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin</span>
|
|
2026
|
+
<span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin.git</span>
|
|
2027
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span>
|
|
2028
|
+
<span class="nt">pattern</span><span class="p">:</span><span class="w"> </span><span class="s">"(:[a-zA-Z0-9_+-]+:)"</span>
|
|
2029
|
+
<span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="s">"<span</span><span class="nv"> </span><span class="s">class=\"emoji\">$1</span>"</span>
|
|
2030
|
+
<span class="nt">flags</span><span class="p">:</span><span class="w"> </span><span class="s">"i"</span><span class="w"> </span><span class="c1"># optional: e.g. i, m, s</span>
|
|
2031
|
+
<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">200</span>
|
|
2032
|
+
<span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
|
|
1739
2033
|
<span class="nn">---</span>
|
|
1740
|
-
</
|
|
2034
|
+
</pre>
|
|
2035
|
+
</div>
|
|
1741
2036
|
|
|
1742
2037
|
<ul>
|
|
1743
2038
|
|
|
1744
2039
|
<li>
|
|
1745
|
-
<strong><code>pattern</code></strong>: POSIX regular expression (compiled via <code>regcomp</code>).
|
|
2040
|
+
<strong><code>pattern</code></strong>: POSIX regular expression (compiled via <code>regcomp</code>).
|
|
1746
2041
|
</li>
|
|
1747
2042
|
|
|
1748
2043
|
<li>
|
|
1749
|
-
<strong><code>replacement</code></strong>:
|
|
2044
|
+
<strong><code>replacement</code></strong>:
|
|
1750
2045
|
<ul>
|
|
1751
2046
|
|
|
1752
2047
|
<li>
|
|
@@ -1762,7 +2057,7 @@ ol ul {
|
|
|
1762
2057
|
</li>
|
|
1763
2058
|
|
|
1764
2059
|
<li>
|
|
1765
|
-
<strong><code>flags</code></strong> (optional):
|
|
2060
|
+
<strong><code>flags</code></strong> (optional):
|
|
1766
2061
|
<ul>
|
|
1767
2062
|
|
|
1768
2063
|
<li>
|
|
@@ -1809,7 +2104,7 @@ ol ul {
|
|
|
1809
2104
|
|
|
1810
2105
|
<hr />
|
|
1811
2106
|
<h2 id="support-directory-and-environment-variables">
|
|
1812
|
-
Support directory and environment
|
|
2107
|
+
Support directory and environment variables
|
|
1813
2108
|
</h2>
|
|
1814
2109
|
|
|
1815
2110
|
<p>
|
|
@@ -1817,7 +2112,7 @@ ol ul {
|
|
|
1817
2112
|
</p>
|
|
1818
2113
|
|
|
1819
2114
|
<h3 id="support-directory-apexsupportdir">
|
|
1820
|
-
Support directory
|
|
2115
|
+
Support directory (<code>APEX_SUPPORT_DIR</code>)
|
|
1821
2116
|
</h3>
|
|
1822
2117
|
|
|
1823
2118
|
<p>
|
|
@@ -1856,15 +2151,17 @@ ol ul {
|
|
|
1856
2151
|
For each plugin, Apex creates:
|
|
1857
2152
|
</p>
|
|
1858
2153
|
|
|
1859
|
-
<
|
|
1860
|
-
|
|
2154
|
+
<div class="highlight">
|
|
2155
|
+
<pre><span></span>APEX_SUPPORT_DIR/<plugin-id>/
|
|
2156
|
+
</pre>
|
|
2157
|
+
</div>
|
|
1861
2158
|
|
|
1862
2159
|
<p>
|
|
1863
2160
|
You can safely write caches, logs, or temporary files there.
|
|
1864
2161
|
</p>
|
|
1865
2162
|
|
|
1866
2163
|
<h3 id="environment-variables-for-external-plugins">
|
|
1867
|
-
Environment variables for external
|
|
2164
|
+
Environment variables for external plugins
|
|
1868
2165
|
</h3>
|
|
1869
2166
|
|
|
1870
2167
|
<p>
|
|
@@ -1876,7 +2173,7 @@ ol ul {
|
|
|
1876
2173
|
<li>
|
|
1877
2174
|
|
|
1878
2175
|
<p>
|
|
1879
|
-
<strong><code>APEX_PLUGIN_DIR</code></strong>
|
|
2176
|
+
<strong><code>APEX_PLUGIN_DIR</code></strong>
|
|
1880
2177
|
</p>
|
|
1881
2178
|
|
|
1882
2179
|
<ul>
|
|
@@ -1896,7 +2193,7 @@ ol ul {
|
|
|
1896
2193
|
<li>
|
|
1897
2194
|
|
|
1898
2195
|
<p>
|
|
1899
|
-
<strong><code>APEX_SUPPORT_DIR</code></strong>
|
|
2196
|
+
<strong><code>APEX_SUPPORT_DIR</code></strong>
|
|
1900
2197
|
</p>
|
|
1901
2198
|
|
|
1902
2199
|
<ul>
|
|
@@ -1916,7 +2213,7 @@ ol ul {
|
|
|
1916
2213
|
<li>
|
|
1917
2214
|
|
|
1918
2215
|
<p>
|
|
1919
|
-
<strong><code>APEX_FILE_PATH</code></strong>
|
|
2216
|
+
<strong><code>APEX_FILE_PATH</code></strong>
|
|
1920
2217
|
</p>
|
|
1921
2218
|
|
|
1922
2219
|
<ul>
|
|
@@ -1957,7 +2254,7 @@ ol ul {
|
|
|
1957
2254
|
|
|
1958
2255
|
<hr />
|
|
1959
2256
|
<h2 id="installing-plugins-from-the-directory">
|
|
1960
|
-
Installing plugins from the
|
|
2257
|
+
Installing plugins from the directory
|
|
1961
2258
|
</h2>
|
|
1962
2259
|
|
|
1963
2260
|
<p>
|
|
@@ -1980,46 +2277,50 @@ ol ul {
|
|
|
1980
2277
|
Each entry in <code>apex-plugins.json</code> looks like this:
|
|
1981
2278
|
</p>
|
|
1982
2279
|
|
|
1983
|
-
<
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
</span><span class="
|
|
1988
|
-
</span><span class="
|
|
1989
|
-
</span><span class="
|
|
1990
|
-
</span><span class="
|
|
1991
|
-
</span><span class="
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
</span
|
|
2280
|
+
<div class="highlight">
|
|
2281
|
+
<pre><span></span><span class="p">{</span>
|
|
2282
|
+
<span class="w"> </span><span class="nt">"plugins"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
|
2283
|
+
<span class="w"> </span><span class="p">{</span>
|
|
2284
|
+
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"kbd"</span><span class="p">,</span>
|
|
2285
|
+
<span class="w"> </span><span class="nt">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Keyboard Shortcuts"</span><span class="p">,</span>
|
|
2286
|
+
<span class="w"> </span><span class="nt">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Renders {% kbd %} tags as <kbd> elements."</span><span class="p">,</span>
|
|
2287
|
+
<span class="w"> </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Brett Terpstra"</span><span class="p">,</span>
|
|
2288
|
+
<span class="w"> </span><span class="nt">"homepage"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://github.com/ApexMarkdown/apex-plugin-kbd"</span><span class="p">,</span>
|
|
2289
|
+
<span class="w"> </span><span class="nt">"repo"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://github.com/ApexMarkdown/apex-plugin-kbd"</span>
|
|
2290
|
+
<span class="w"> </span><span class="p">}</span>
|
|
2291
|
+
<span class="w"> </span><span class="p">]</span>
|
|
2292
|
+
<span class="p">}</span>
|
|
2293
|
+
</pre>
|
|
2294
|
+
</div>
|
|
1996
2295
|
|
|
1997
2296
|
<ul>
|
|
1998
2297
|
|
|
1999
2298
|
<li>
|
|
2000
|
-
<strong><code>id</code></strong> must match the plugin <code>id</code> declared in that repo’s <code>plugin.yml</code>.
|
|
2299
|
+
<strong><code>id</code></strong> must match the plugin <code>id</code> declared in that repo’s <code>plugin.yml</code>.
|
|
2001
2300
|
</li>
|
|
2002
2301
|
|
|
2003
2302
|
<li>
|
|
2004
|
-
<strong><code>repo</code></strong> is the canonical Git URL that Apex will pass to <code>git clone</code>.
|
|
2303
|
+
<strong><code>repo</code></strong> is the canonical Git URL that Apex will pass to <code>git clone</code>.
|
|
2005
2304
|
</li>
|
|
2006
2305
|
|
|
2007
2306
|
<li>
|
|
2008
|
-
<strong><code>title</code></strong>, <strong><code>author</code></strong>, <strong><code>description</code></strong>, and <strong><code>homepage</code></strong> are used for human-readable listings.
|
|
2307
|
+
<strong><code>title</code></strong>, <strong><code>author</code></strong>, <strong><code>description</code></strong>, and <strong><code>homepage</code></strong> are used for human-readable listings.
|
|
2009
2308
|
</li>
|
|
2010
2309
|
|
|
2011
2310
|
</ul>
|
|
2012
2311
|
|
|
2013
2312
|
<h3 id="listing-available-plugins">
|
|
2014
|
-
Listing available
|
|
2313
|
+
Listing available plugins
|
|
2015
2314
|
</h3>
|
|
2016
2315
|
|
|
2017
2316
|
<p>
|
|
2018
2317
|
To see what plugins are available in the central directory, use:
|
|
2019
2318
|
</p>
|
|
2020
2319
|
|
|
2021
|
-
<
|
|
2022
|
-
|
|
2320
|
+
<div class="highlight">
|
|
2321
|
+
<pre><span></span>apex<span class="w"> </span>--list-plugins
|
|
2322
|
+
</pre>
|
|
2323
|
+
</div>
|
|
2023
2324
|
|
|
2024
2325
|
<p>
|
|
2025
2326
|
This command:
|
|
@@ -2041,7 +2342,8 @@ ol ul {
|
|
|
2041
2342
|
|
|
2042
2343
|
</ul>
|
|
2043
2344
|
|
|
2044
|
-
<
|
|
2345
|
+
<div class="highlight">
|
|
2346
|
+
<pre><span></span>## Installed Plugins
|
|
2045
2347
|
|
|
2046
2348
|
kbd - Keyboard Shortcuts (author: Brett Terpstra)
|
|
2047
2349
|
Renders {% kbd %} tags as <kbd> elements.
|
|
@@ -2052,12 +2354,13 @@ kbd - Keyboard Shortcuts (author: Brett Terpstra)
|
|
|
2052
2354
|
## Available Plugins
|
|
2053
2355
|
|
|
2054
2356
|
emoji-span - Emoji span wrapper (author: Brett Terpstra)
|
|
2055
|
-
Wrap
|
|
2357
|
+
Wrap <span class=\"emoji\">:emoji:</span> markers in a span for styling.
|
|
2056
2358
|
homepage: https://github.com/ApexMarkdown/apex-emoji-plugin
|
|
2057
|
-
</
|
|
2359
|
+
</pre>
|
|
2360
|
+
</div>
|
|
2058
2361
|
|
|
2059
2362
|
<h3 id="installing-a-plugin">
|
|
2060
|
-
Installing
|
|
2363
|
+
Installing a plugin
|
|
2061
2364
|
</h3>
|
|
2062
2365
|
|
|
2063
2366
|
<p>
|
|
@@ -2069,11 +2372,13 @@ emoji-span - Emoji span wrapper (author: Brett Terpstra)
|
|
|
2069
2372
|
<li>
|
|
2070
2373
|
|
|
2071
2374
|
<p>
|
|
2072
|
-
<strong>
|
|
2375
|
+
<strong>Plugin ID from the directory</strong> (recommended for curated plugins):
|
|
2073
2376
|
</p>
|
|
2074
2377
|
|
|
2075
|
-
<
|
|
2076
|
-
|
|
2378
|
+
<div class="highlight">
|
|
2379
|
+
<pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>kbd
|
|
2380
|
+
</pre>
|
|
2381
|
+
</div>
|
|
2077
2382
|
|
|
2078
2383
|
<p>
|
|
2079
2384
|
This will:
|
|
@@ -2104,29 +2409,35 @@ emoji-span - Emoji span wrapper (author: Brett Terpstra)
|
|
|
2104
2409
|
<li>
|
|
2105
2410
|
|
|
2106
2411
|
<p>
|
|
2107
|
-
<strong>
|
|
2412
|
+
<strong>Full Git URL</strong> (for plugins not in the directory):
|
|
2108
2413
|
</p>
|
|
2109
2414
|
|
|
2110
|
-
<
|
|
2111
|
-
|
|
2415
|
+
<div class="highlight">
|
|
2416
|
+
<pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>https://github.com/ttscoff/apex-plugin-kbd.git
|
|
2417
|
+
</pre>
|
|
2418
|
+
</div>
|
|
2112
2419
|
|
|
2113
2420
|
<p>
|
|
2114
2421
|
Also works with SSH URLs:
|
|
2115
2422
|
</p>
|
|
2116
2423
|
|
|
2117
|
-
<
|
|
2118
|
-
|
|
2424
|
+
<div class="highlight">
|
|
2425
|
+
<pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>git@github.com:ttscoff/apex-plugin-kbd.git
|
|
2426
|
+
</pre>
|
|
2427
|
+
</div>
|
|
2119
2428
|
|
|
2120
2429
|
</li>
|
|
2121
2430
|
|
|
2122
2431
|
<li>
|
|
2123
2432
|
|
|
2124
2433
|
<p>
|
|
2125
|
-
<strong>
|
|
2434
|
+
<strong>GitHub shorthand</strong> (<code>user/repo</code> format):
|
|
2126
2435
|
</p>
|
|
2127
2436
|
|
|
2128
|
-
<
|
|
2129
|
-
|
|
2437
|
+
<div class="highlight">
|
|
2438
|
+
<pre><span></span>apex<span class="w"> </span>--install-plugin<span class="w"> </span>ttscoff/apex-plugin-kbd
|
|
2439
|
+
</pre>
|
|
2440
|
+
</div>
|
|
2130
2441
|
|
|
2131
2442
|
<p>
|
|
2132
2443
|
This is automatically expanded to <code>https://github.com/ttscoff/apex-plugin-kbd.git</code>.
|
|
@@ -2137,16 +2448,18 @@ emoji-span - Emoji span wrapper (author: Brett Terpstra)
|
|
|
2137
2448
|
</ol>
|
|
2138
2449
|
|
|
2139
2450
|
<h4 id="security-confirmation-for-direct-installs">
|
|
2140
|
-
Security confirmation for direct
|
|
2451
|
+
Security confirmation for direct installs
|
|
2141
2452
|
</h4>
|
|
2142
2453
|
|
|
2143
2454
|
<p>
|
|
2144
2455
|
When installing from a <strong>direct Git URL or GitHub shorthand</strong> (i.e., anything outside the curated directory), Apex will prompt:
|
|
2145
2456
|
</p>
|
|
2146
2457
|
|
|
2147
|
-
<
|
|
2458
|
+
<div class="highlight">
|
|
2459
|
+
<pre><span></span>Apex plugins execute unverified code. Only install plugins from trusted sources.
|
|
2148
2460
|
Continue? (y/n)
|
|
2149
|
-
</
|
|
2461
|
+
</pre>
|
|
2462
|
+
</div>
|
|
2150
2463
|
|
|
2151
2464
|
<ul>
|
|
2152
2465
|
|
|
@@ -2161,11 +2474,11 @@ Continue? (y/n)
|
|
|
2161
2474
|
</ul>
|
|
2162
2475
|
|
|
2163
2476
|
<p>
|
|
2164
|
-
<strong>
|
|
2477
|
+
<strong>Directory ID installs</strong> (like <code>--install-plugin kbd</code> from the curated list) do <strong>not</strong> show this prompt, as those plugins have been reviewed and included in the central directory.
|
|
2165
2478
|
</p>
|
|
2166
2479
|
|
|
2167
2480
|
<h4 id="installation-process">
|
|
2168
|
-
Installation
|
|
2481
|
+
Installation process
|
|
2169
2482
|
</h4>
|
|
2170
2483
|
|
|
2171
2484
|
<p>
|
|
@@ -2255,7 +2568,7 @@ Continue? (y/n)
|
|
|
2255
2568
|
<blockquote>
|
|
2256
2569
|
|
|
2257
2570
|
<p>
|
|
2258
|
-
<strong>
|
|
2571
|
+
<strong>Security note:</strong> Apex plugins execute unverified code. Only install plugins from trusted sources. When installing from a direct Git URL or GitHub repo name, you will be prompted to confirm before the plugin is cloned.
|
|
2259
2572
|
</p>
|
|
2260
2573
|
|
|
2261
2574
|
</blockquote>
|
|
@@ -2297,15 +2610,17 @@ Continue? (y/n)
|
|
|
2297
2610
|
</ul>
|
|
2298
2611
|
|
|
2299
2612
|
<h3 id="uninstalling-a-plugin">
|
|
2300
|
-
Uninstalling
|
|
2613
|
+
Uninstalling a plugin
|
|
2301
2614
|
</h3>
|
|
2302
2615
|
|
|
2303
2616
|
<p>
|
|
2304
2617
|
To remove a locally installed plugin, use:
|
|
2305
2618
|
</p>
|
|
2306
2619
|
|
|
2307
|
-
<
|
|
2308
|
-
|
|
2620
|
+
<div class="highlight">
|
|
2621
|
+
<pre><span></span>apex<span class="w"> </span>--uninstall-plugin<span class="w"> </span>kbd
|
|
2622
|
+
</pre>
|
|
2623
|
+
</div>
|
|
2309
2624
|
|
|
2310
2625
|
<p>
|
|
2311
2626
|
The <code>--uninstall-plugin</code> command:
|
|
@@ -2332,7 +2647,7 @@ Continue? (y/n)
|
|
|
2332
2647
|
</p>
|
|
2333
2648
|
|
|
2334
2649
|
<h2 id="share-your-plugin">
|
|
2335
|
-
Share Your
|
|
2650
|
+
Share Your Plugin
|
|
2336
2651
|
</h2>
|
|
2337
2652
|
|
|
2338
2653
|
<p>
|
|
@@ -2342,11 +2657,11 @@ Continue? (y/n)
|
|
|
2342
2657
|
<ol>
|
|
2343
2658
|
|
|
2344
2659
|
<li>
|
|
2345
|
-
<strong>
|
|
2660
|
+
<strong>Fork</strong> the <code>ApexMarkdown/apex-plugins</code> repository on GitHub to your own account or organization.
|
|
2346
2661
|
</li>
|
|
2347
2662
|
|
|
2348
2663
|
<li>
|
|
2349
|
-
<strong>
|
|
2664
|
+
<strong>Clone</strong> your fork locally and create a new branch for your plugin entry (for example, <code>add-kbd-plugin</code>).
|
|
2350
2665
|
</li>
|
|
2351
2666
|
|
|
2352
2667
|
<li>
|
|
@@ -2401,52 +2716,58 @@ Continue? (y/n)
|
|
|
2401
2716
|
</h2>
|
|
2402
2717
|
|
|
2403
2718
|
<p>
|
|
2404
|
-
This example shows how to support a liquid-style <code
|
|
2719
|
+
This example shows how to support a liquid-style <code><span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span></code> syntax, turning key combos into <code><kbd></code> markup.
|
|
2405
2720
|
</p>
|
|
2406
2721
|
|
|
2407
2722
|
<h3 id="directory-layout">
|
|
2408
|
-
Directory
|
|
2723
|
+
Directory layout
|
|
2409
2724
|
</h3>
|
|
2410
2725
|
|
|
2411
2726
|
<p>
|
|
2412
2727
|
Project-local example:
|
|
2413
2728
|
</p>
|
|
2414
2729
|
|
|
2415
|
-
<
|
|
2730
|
+
<div class="highlight">
|
|
2731
|
+
<pre><span></span>.apex/
|
|
2416
2732
|
plugins/
|
|
2417
2733
|
kbd/
|
|
2418
2734
|
plugin.yml
|
|
2419
2735
|
kbd_plugin.rb
|
|
2420
|
-
</
|
|
2736
|
+
</pre>
|
|
2737
|
+
</div>
|
|
2421
2738
|
|
|
2422
2739
|
<p>
|
|
2423
2740
|
Global example:
|
|
2424
2741
|
</p>
|
|
2425
2742
|
|
|
2426
|
-
<
|
|
2743
|
+
<div class="highlight">
|
|
2744
|
+
<pre><span></span>~/.config/apex/plugins/
|
|
2427
2745
|
kbd/
|
|
2428
2746
|
plugin.yml
|
|
2429
2747
|
kbd_plugin.rb
|
|
2430
|
-
</
|
|
2748
|
+
</pre>
|
|
2749
|
+
</div>
|
|
2431
2750
|
|
|
2432
2751
|
<h3 id="pluginyml">
|
|
2433
2752
|
<code>plugin.yml</code>
|
|
2434
2753
|
</h3>
|
|
2435
2754
|
|
|
2436
|
-
<
|
|
2437
|
-
<span
|
|
2438
|
-
<span class="
|
|
2439
|
-
<span class="
|
|
2440
|
-
<span class="
|
|
2441
|
-
<span class="
|
|
2442
|
-
<span class="
|
|
2443
|
-
<span class="
|
|
2444
|
-
<span class="
|
|
2445
|
-
<span class="
|
|
2446
|
-
<span class="
|
|
2447
|
-
|
|
2755
|
+
<div class="highlight">
|
|
2756
|
+
<pre><span></span><span class="nn">---</span>
|
|
2757
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kbd</span>
|
|
2758
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Keyboard Shortcuts</span>
|
|
2759
|
+
<span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
|
|
2760
|
+
<span class="nt">description</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Render <span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span> key combos to HTML <kbd> elements</span>
|
|
2761
|
+
<span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin</span>
|
|
2762
|
+
<span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-kbd-plugin.git</span>
|
|
2763
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre_parse</span>
|
|
2764
|
+
<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
|
|
2765
|
+
<span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
|
|
2766
|
+
<span class="nt">handler</span><span class="p">:</span>
|
|
2767
|
+
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="s">"ruby</span><span class="nv"> </span><span class="s">kbd_plugin.rb"</span>
|
|
2448
2768
|
<span class="nn">---</span>
|
|
2449
|
-
</
|
|
2769
|
+
</pre>
|
|
2770
|
+
</div>
|
|
2450
2771
|
|
|
2451
2772
|
<h3 id="kbdpluginrb-simplified-shape">
|
|
2452
2773
|
<code>kbd_plugin.rb</code> (simplified shape)
|
|
@@ -2467,7 +2788,7 @@ Continue? (y/n)
|
|
|
2467
2788
|
</li>
|
|
2468
2789
|
|
|
2469
2790
|
<li>
|
|
2470
|
-
Replaces each <code
|
|
2791
|
+
Replaces each <code><span class="keycombo combined" title="..."><kbd class="key symbol">...</kbd></span></code> occurrence with properly formatted <code><kbd></code> HTML.
|
|
2471
2792
|
</li>
|
|
2472
2793
|
|
|
2473
2794
|
<li>
|
|
@@ -2480,68 +2801,74 @@ Continue? (y/n)
|
|
|
2480
2801
|
A very abridged sketch:
|
|
2481
2802
|
</p>
|
|
2482
2803
|
|
|
2483
|
-
<
|
|
2484
|
-
<span
|
|
2804
|
+
<div class="highlight">
|
|
2805
|
+
<pre><span></span><span class="ch">#!/usr/bin/env ruby</span>
|
|
2806
|
+
<span class="nb">require</span><span class="w"> </span><span class="s2">"json"</span>
|
|
2485
2807
|
|
|
2486
|
-
<span class="n">payload</span>
|
|
2487
|
-
<span class="n">text</span>
|
|
2808
|
+
<span class="n">payload</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">JSON</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="vg">$stdin</span><span class="o">.</span><span class="n">read</span><span class="p">)</span>
|
|
2809
|
+
<span class="n">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">payload</span><span class="o">[</span><span class="s2">"text"</span><span class="o">]</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="s2">""</span>
|
|
2488
2810
|
|
|
2489
2811
|
<span class="c1"># ... helper methods for normalizing modifier names, etc. ...</span>
|
|
2490
2812
|
|
|
2491
|
-
<span class="k">def</span>
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2813
|
+
<span class="k">def</span><span class="w"> </span><span class="nf">render_kbd</span><span class="p">(</span><span class="n">markup</span><span class="p">)</span>
|
|
2814
|
+
<span class="w"> </span><span class="c1"># convert markup like "^~@r" to HTML</span>
|
|
2815
|
+
<span class="w"> </span><span class="c1"># returning something like:</span>
|
|
2816
|
+
<span class="w"> </span><span class="c1"># <kbd>⌃</kbd>+<kbd>⌥</kbd>+<kbd>⌘</kbd>+<kbd>R</kbd></span>
|
|
2495
2817
|
<span class="k">end</span>
|
|
2496
2818
|
|
|
2497
|
-
<span class="n">result</span>
|
|
2498
|
-
|
|
2819
|
+
<span class="n">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">text</span><span class="o">.</span><span class="n">gsub</span><span class="p">(</span><span class="sr">/\{%\s*kbd\s+([^%]+)%\}/</span><span class="p">)</span><span class="w"> </span><span class="k">do</span>
|
|
2820
|
+
<span class="w"> </span><span class="n">render_kbd</span><span class="p">(</span><span class="no">Regexp</span><span class="o">.</span><span class="n">last_match</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
|
|
2499
2821
|
<span class="k">end</span>
|
|
2500
2822
|
|
|
2501
|
-
<span class="nb">print</span>
|
|
2502
|
-
</
|
|
2823
|
+
<span class="nb">print</span><span class="w"> </span><span class="n">result</span>
|
|
2824
|
+
</pre>
|
|
2825
|
+
</div>
|
|
2503
2826
|
|
|
2504
2827
|
<p>
|
|
2505
2828
|
You can customize this script as you like; the only requirement is that it obey the stdin JSON / stdout contract.
|
|
2506
2829
|
</p>
|
|
2507
2830
|
|
|
2508
2831
|
<hr />
|
|
2509
|
-
<h2 id="example-
|
|
2510
|
-
Example: <code
|
|
2832
|
+
<h2 id="example-emoji-span-plugin-declarative">
|
|
2833
|
+
Example: <code><span class=\"emoji\">:emoji:</span></code> span plugin (declarative)
|
|
2511
2834
|
</h2>
|
|
2512
2835
|
|
|
2513
2836
|
<p>
|
|
2514
|
-
This plugin turns <code
|
|
2837
|
+
This plugin turns <code><span class=\"emoji\">:emoji:</span></code> tokens in the final HTML into <code><span class="emoji"><span class=\"emoji\">:emoji:</span></span></code>.
|
|
2515
2838
|
</p>
|
|
2516
2839
|
|
|
2517
2840
|
<h3 id="directory-layout">
|
|
2518
|
-
Directory
|
|
2841
|
+
Directory layout
|
|
2519
2842
|
</h3>
|
|
2520
2843
|
|
|
2521
|
-
<
|
|
2844
|
+
<div class="highlight">
|
|
2845
|
+
<pre><span></span>~/.config/apex/plugins/
|
|
2522
2846
|
emoji/
|
|
2523
2847
|
plugin.yml
|
|
2524
|
-
</
|
|
2848
|
+
</pre>
|
|
2849
|
+
</div>
|
|
2525
2850
|
|
|
2526
2851
|
<h3 id="pluginyml">
|
|
2527
2852
|
<code>plugin.yml</code>
|
|
2528
2853
|
</h3>
|
|
2529
2854
|
|
|
2530
|
-
<
|
|
2531
|
-
<span
|
|
2532
|
-
<span class="
|
|
2533
|
-
<span class="
|
|
2534
|
-
<span class="
|
|
2535
|
-
<span class="
|
|
2536
|
-
<span class="
|
|
2537
|
-
<span class="
|
|
2538
|
-
<span class="
|
|
2539
|
-
<span class="
|
|
2540
|
-
<span class="
|
|
2541
|
-
<span class="
|
|
2542
|
-
<span class="
|
|
2855
|
+
<div class="highlight">
|
|
2856
|
+
<pre><span></span><span class="nn">---</span>
|
|
2857
|
+
<span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">emoji-span</span>
|
|
2858
|
+
<span class="nt">title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Emoji span wrapper</span>
|
|
2859
|
+
<span class="nt">author</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Brett Terpstra</span>
|
|
2860
|
+
<span class="nt">description: Wrap :emoji</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">markers in a span for styling</span>
|
|
2861
|
+
<span class="nt">homepage</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin</span>
|
|
2862
|
+
<span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/ApexMarkdown/apex-emoji-plugin.git</span>
|
|
2863
|
+
<span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">post_render</span>
|
|
2864
|
+
<span class="nt">pattern</span><span class="p">:</span><span class="w"> </span><span class="s">"(:[a-zA-Z0-9_+-]+:)"</span>
|
|
2865
|
+
<span class="nt">replacement</span><span class="p">:</span><span class="w"> </span><span class="s">"<span</span><span class="nv"> </span><span class="s">class=\"emoji\">$1</span>"</span>
|
|
2866
|
+
<span class="nt">flags</span><span class="p">:</span><span class="w"> </span><span class="s">"i"</span>
|
|
2867
|
+
<span class="nt">priority</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">200</span>
|
|
2868
|
+
<span class="nt">timeout_ms</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
|
|
2543
2869
|
<span class="nn">---</span>
|
|
2544
|
-
</
|
|
2870
|
+
</pre>
|
|
2871
|
+
</div>
|
|
2545
2872
|
|
|
2546
2873
|
<p>
|
|
2547
2874
|
Because this is a declarative plugin, <strong>no external command is run</strong>. Apex compiles the regex and runs the replacements internally.
|
|
@@ -2549,7 +2876,7 @@ Continue? (y/n)
|
|
|
2549
2876
|
|
|
2550
2877
|
<hr />
|
|
2551
2878
|
<h2 id="putting-it-all-together">
|
|
2552
|
-
Putting it all
|
|
2879
|
+
Putting it all together
|
|
2553
2880
|
</h2>
|
|
2554
2881
|
|
|
2555
2882
|
<p>
|
|
@@ -2561,7 +2888,7 @@ Continue? (y/n)
|
|
|
2561
2888
|
<li>
|
|
2562
2889
|
|
|
2563
2890
|
<p>
|
|
2564
|
-
<strong>
|
|
2891
|
+
<strong>Create a plugin directory</strong>
|
|
2565
2892
|
</p>
|
|
2566
2893
|
|
|
2567
2894
|
<ul>
|
|
@@ -2581,7 +2908,7 @@ Continue? (y/n)
|
|
|
2581
2908
|
<li>
|
|
2582
2909
|
|
|
2583
2910
|
<p>
|
|
2584
|
-
<strong>
|
|
2911
|
+
<strong>Add <code>plugin.yml</code></strong>
|
|
2585
2912
|
</p>
|
|
2586
2913
|
|
|
2587
2914
|
<ul>
|
|
@@ -2621,7 +2948,7 @@ Continue? (y/n)
|
|
|
2621
2948
|
<li>
|
|
2622
2949
|
|
|
2623
2950
|
<p>
|
|
2624
|
-
<strong>
|
|
2951
|
+
<strong>Add code (if external)</strong>
|
|
2625
2952
|
</p>
|
|
2626
2953
|
|
|
2627
2954
|
<ul>
|
|
@@ -2641,7 +2968,7 @@ Continue? (y/n)
|
|
|
2641
2968
|
<li>
|
|
2642
2969
|
|
|
2643
2970
|
<p>
|
|
2644
|
-
<strong>
|
|
2971
|
+
<strong>Enable plugins</strong>
|
|
2645
2972
|
</p>
|
|
2646
2973
|
|
|
2647
2974
|
<ul>
|
|
@@ -2669,7 +2996,7 @@ Continue? (y/n)
|
|
|
2669
2996
|
<li>
|
|
2670
2997
|
|
|
2671
2998
|
<p>
|
|
2672
|
-
<strong>
|
|
2999
|
+
<strong>Test</strong>
|
|
2673
3000
|
</p>
|
|
2674
3001
|
|
|
2675
3002
|
<ul>
|