apex-ruby 1.0.6
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 +7 -0
- data/README.md +119 -0
- data/apex-ruby.gemspec +31 -0
- data/ext/apex_ext/apex_ext.c +215 -0
- data/ext/apex_ext/apex_src/BENCHMARK.md +32 -0
- data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +67 -0
- data/ext/apex_ext/apex_src/CHANGELOG.md +2454 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +454 -0
- data/ext/apex_ext/apex_src/Dockerfile.linux-build +15 -0
- data/ext/apex_ext/apex_src/Formula/apex.rb +38 -0
- data/ext/apex_ext/apex_src/Info.plist.in +27 -0
- data/ext/apex_ext/apex_src/LICENSE +21 -0
- data/ext/apex_ext/apex_src/Package.swift +160 -0
- data/ext/apex_ext/apex_src/PackageSupport/README.md +17 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_export.h +20 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_version.h +14 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +4 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/config.h +41 -0
- data/ext/apex_ext/apex_src/README.md +452 -0
- data/ext/apex_ext/apex_src/VERSION +1 -0
- data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
- data/ext/apex_ext/apex_src/apex-plugins.json.example +20 -0
- data/ext/apex_ext/apex_src/apex.pc.in +11 -0
- data/ext/apex_ext/apex_src/cli/main.c +2720 -0
- data/ext/apex_ext/apex_src/debug_test.sh +22 -0
- data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +451 -0
- data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +166 -0
- data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +220 -0
- data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +501 -0
- data/ext/apex_ext/apex_src/docs/DEBUGGING.md +73 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +391 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +237 -0
- data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +456 -0
- data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +210 -0
- data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +344 -0
- data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +144 -0
- data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +278 -0
- data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +321 -0
- data/ext/apex_ext/apex_src/docs/PROGRESS.md +167 -0
- data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +174 -0
- data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +243 -0
- data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +316 -0
- data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +803 -0
- data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +91 -0
- data/ext/apex_ext/apex_src/documentation/README.md +160 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +365 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +24 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +1737 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +1420 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3574 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +1603 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +910 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +1003 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +1308 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +1078 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +1622 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +1698 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +1531 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +1980 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +1368 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +1151 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +2861 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +3981 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +1454 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +1200 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +2066 -0
- 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/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +22 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +914 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +399 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +772 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +678 -0
- data/ext/apex_ext/apex_src/documentation/generate_docset.rb +873 -0
- data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +733 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +17073 -0
- data/ext/apex_ext/apex_src/documentation/shared_scripts.js +64 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +646 -0
- data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +260 -0
- data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +119 -0
- data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +11 -0
- data/ext/apex_ext/apex_src/examples/example.html +53 -0
- data/ext/apex_ext/apex_src/examples/example.md +85 -0
- data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +158 -0
- data/ext/apex_ext/apex_src/examples/kbd.md +8 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +250 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +9 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +247 -0
- data/ext/apex_ext/apex_src/include/apex/buffer.h +93 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +16 -0
- data/ext/apex_ext/apex_src/include/apex/parser.h +150 -0
- data/ext/apex_ext/apex_src/include/apex/renderer.h +39 -0
- data/ext/apex_ext/apex_src/man/apex-config.5 +374 -0
- data/ext/apex_ext/apex_src/man/apex-config.5.md +260 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7 +456 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7.md +365 -0
- data/ext/apex_ext/apex_src/man/apex.1 +828 -0
- data/ext/apex_ext/apex_src/man/apex.1.md +643 -0
- data/ext/apex_ext/apex_src/man/apex.1.new +338 -0
- data/ext/apex_ext/apex_src/objc/Apex.swift +237 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +117 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +332 -0
- data/ext/apex_ext/apex_src/src/_README.md +358 -0
- data/ext/apex_ext/apex_src/src/apex.c +6326 -0
- data/ext/apex_ext/apex_src/src/buffer.c +93 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +362 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.h +45 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.c +184 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.h +50 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +1897 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +215 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +53 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.c +2042 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.h +163 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.c +329 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.h +48 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +1670 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.c +710 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.h +38 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji_data.h +942 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.c +925 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.h +43 -0
- data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +869 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1121 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.h +33 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.c +626 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.h +60 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.c +135 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +408 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.c +4084 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.h +145 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.c +1536 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.h +54 -0
- data/ext/apex_ext/apex_src/src/extensions/index.c +967 -0
- data/ext/apex_ext/apex_src/src/extensions/index.h +90 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +205 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.c +332 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.h +13 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.c +248 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.h +18 -0
- data/ext/apex_ext/apex_src/src/extensions/math.c +279 -0
- data/ext/apex_ext/apex_src/src/extensions/math.h +32 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +3046 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.h +125 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +1297 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.h +39 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +194 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.h +29 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +405 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +468 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +44 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +2679 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.c +255 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.h +58 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +2762 -0
- data/ext/apex_ext/apex_src/src/html_renderer.h +126 -0
- data/ext/apex_ext/apex_src/src/parser.c +227 -0
- data/ext/apex_ext/apex_src/src/plugins.c +895 -0
- data/ext/apex_ext/apex_src/src/plugins.h +39 -0
- data/ext/apex_ext/apex_src/src/plugins_env.c +187 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +263 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +358 -0
- data/ext/apex_ext/apex_src/src/renderer.c +241 -0
- data/ext/apex_ext/apex_src/src/utf8.c +56 -0
- data/ext/apex_ext/apex_src/test-linux-build.sh +20 -0
- data/ext/apex_ext/apex_src/test.html +103 -0
- data/ext/apex_ext/apex_src/test_coverage.sh +121 -0
- data/ext/apex_ext/apex_src/test_ial_fenced.md +6 -0
- data/ext/apex_ext/apex_src/test_math_norm.py +79 -0
- data/ext/apex_ext/apex_src/test_pandoc_output.html +48 -0
- data/ext/apex_ext/apex_src/test_spm.sh +107 -0
- data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +50 -0
- data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +229 -0
- data/ext/apex_ext/apex_src/tests/CMakeLists.txt +24 -0
- data/ext/apex_ext/apex_src/tests/README.md +146 -0
- data/ext/apex_ext/apex_src/tests/benchmark.sh +113 -0
- data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +166 -0
- data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +31 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +25 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +24 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +33 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +26 -0
- data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +260 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +6 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +9 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +620 -0
- data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +177 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +74 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +60 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +16 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +1094 -0
- data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +96 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +43 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +53 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +37 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +93 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +38 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +15 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +15 -0
- data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +105 -0
- data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +143 -0
- data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +96 -0
- data/ext/apex_ext/apex_src/tests/gh_api_test.md +6 -0
- data/ext/apex_ext/apex_src/tests/ial_demo.html +186 -0
- data/ext/apex_ext/apex_src/tests/include_code.py +19 -0
- data/ext/apex_ext/apex_src/tests/include_snippet.md +15 -0
- data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +64 -0
- data/ext/apex_ext/apex_src/tests/sample_data.csv +7 -0
- data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +4 -0
- data/ext/apex_ext/apex_src/tests/test_basic.c +74 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +2116 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.c +183 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.h +91 -0
- data/ext/apex_ext/apex_src/tests/test_ial.c +282 -0
- data/ext/apex_ext/apex_src/tests/test_links.c +418 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +265 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +908 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +1118 -0
- data/ext/apex_ext/apex_src/tests/test_plugins.c +219 -0
- data/ext/apex_ext/apex_src/tests/test_refs.bib +31 -0
- data/ext/apex_ext/apex_src/tests/test_runner.c +244 -0
- data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +198 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +862 -0
- data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +9 -0
- data/ext/apex_ext/apex_src/tests/yaml_test.md +13 -0
- data/ext/apex_ext/apex_src/tests.rb +39 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +48 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/COPYING +170 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +74 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +206 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +30 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +111 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +1169 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +21 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +3 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +23 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +18 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +595 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +19 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +1245 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +1495 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +119 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +508 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/cmark-gfm-core-extensions.h +54 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/core-extensions.c +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.c +879 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +92 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.c +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.h +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +917 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.h +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.c +60 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.c +156 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +91 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +110 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +28 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +133 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +78 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +1041 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +1 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +230 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/arena.c +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +1622 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.c +278 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.h +116 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/case_fold_switch.inc +4327 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/chunk.h +135 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm-extension_api.h +737 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm.h +833 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +7 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark.c +55 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.c +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.h +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/commonmark.c +514 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +76 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/entities.inc +2138 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini.h +57 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_href_e.c +100 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_e.c +66 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_u.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.c +502 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.c +1788 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.h +29 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.c +159 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/latex.c +468 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/linked_list.c +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +328 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/man.c +274 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.c +129 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.h +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.c +1045 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.h +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/parser.h +59 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plaintext.c +218 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.c +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.c +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.c +213 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.h +62 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.c +14056 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.h +70 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +365 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.c +317 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/xml.c +182 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +114 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +49 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +58 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +105 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +920 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +194 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +160 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +375 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +50 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +4 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +177 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +10212 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +152 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +41 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +319 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +80 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +6 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +208 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +109 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +160 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Changes +372 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/License +20 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +51 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +46 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +89 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +73 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +222 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +24 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +14 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +1999 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +77 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +32 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +23 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +1393 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +394 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +2358 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +544 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +1416 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +469 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +3598 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +141 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +684 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +27 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +9 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +800 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +1127 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +217 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +202 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +314 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +290 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +327 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +196 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +88 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +354 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +16 -0
- data/ext/apex_ext/extconf.rb +103 -0
- data/lib/apex/configurable.rb +46 -0
- data/lib/apex/document.rb +66 -0
- data/lib/apex/version.rb +15 -0
- data/lib/apex.rb +28 -0
- metadata +544 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file syntax_highlight.c
|
|
3
|
+
* @brief External syntax highlighting support for code blocks
|
|
4
|
+
*
|
|
5
|
+
* Implements integration with external syntax highlighting tools
|
|
6
|
+
* (Pygments, Skylighting) to produce colorized HTML output.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#include "syntax_highlight.h"
|
|
10
|
+
#include <stdlib.h>
|
|
11
|
+
#include <string.h>
|
|
12
|
+
#include <stdio.h>
|
|
13
|
+
#include <ctype.h>
|
|
14
|
+
#include <unistd.h>
|
|
15
|
+
#include <fcntl.h>
|
|
16
|
+
#include <sys/types.h>
|
|
17
|
+
#include <sys/wait.h>
|
|
18
|
+
#include <errno.h>
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get the binary name for a syntax highlighting tool.
|
|
22
|
+
*/
|
|
23
|
+
static const char *get_tool_binary(const char *tool) {
|
|
24
|
+
if (strcmp(tool, "pygments") == 0) {
|
|
25
|
+
return "pygmentize";
|
|
26
|
+
} else if (strcmp(tool, "skylighting") == 0) {
|
|
27
|
+
return "skylighting";
|
|
28
|
+
}
|
|
29
|
+
return NULL;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Check if a syntax highlighting tool is available in PATH.
|
|
34
|
+
*/
|
|
35
|
+
bool apex_syntax_highlighter_available(const char *tool) {
|
|
36
|
+
const char *binary = get_tool_binary(tool);
|
|
37
|
+
if (!binary) return false;
|
|
38
|
+
|
|
39
|
+
/* Use 'which' to check if the binary exists */
|
|
40
|
+
char cmd[256];
|
|
41
|
+
snprintf(cmd, sizeof(cmd), "which %s >/dev/null 2>&1", binary);
|
|
42
|
+
return system(cmd) == 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Unescape HTML entities in code content.
|
|
47
|
+
* Converts < > & " back to their original characters.
|
|
48
|
+
*/
|
|
49
|
+
static char *unescape_html(const char *html, size_t len) {
|
|
50
|
+
char *result = malloc(len + 1);
|
|
51
|
+
if (!result) return NULL;
|
|
52
|
+
|
|
53
|
+
const char *read = html;
|
|
54
|
+
const char *end = html + len;
|
|
55
|
+
char *write = result;
|
|
56
|
+
|
|
57
|
+
while (read < end) {
|
|
58
|
+
if (*read == '&') {
|
|
59
|
+
if (strncmp(read, "<", 4) == 0) {
|
|
60
|
+
*write++ = '<';
|
|
61
|
+
read += 4;
|
|
62
|
+
} else if (strncmp(read, ">", 4) == 0) {
|
|
63
|
+
*write++ = '>';
|
|
64
|
+
read += 4;
|
|
65
|
+
} else if (strncmp(read, "&", 5) == 0) {
|
|
66
|
+
*write++ = '&';
|
|
67
|
+
read += 5;
|
|
68
|
+
} else if (strncmp(read, """, 6) == 0) {
|
|
69
|
+
*write++ = '"';
|
|
70
|
+
read += 6;
|
|
71
|
+
} else if (strncmp(read, "'", 5) == 0 || strncmp(read, "'", 6) == 0) {
|
|
72
|
+
*write++ = '\'';
|
|
73
|
+
read += (read[2] == '3') ? 5 : 6;
|
|
74
|
+
} else {
|
|
75
|
+
*write++ = *read++;
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
*write++ = *read++;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
*write = '\0';
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Run an external command with input on stdin and capture stdout.
|
|
87
|
+
* Returns newly allocated string with output, or NULL on failure.
|
|
88
|
+
*/
|
|
89
|
+
static char *run_command(const char *cmd, const char *input) {
|
|
90
|
+
if (!cmd || !input) return NULL;
|
|
91
|
+
|
|
92
|
+
int in_pipe[2];
|
|
93
|
+
int out_pipe[2];
|
|
94
|
+
if (pipe(in_pipe) == -1 || pipe(out_pipe) == -1) {
|
|
95
|
+
return NULL;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
pid_t pid = fork();
|
|
99
|
+
if (pid == -1) {
|
|
100
|
+
close(in_pipe[0]); close(in_pipe[1]);
|
|
101
|
+
close(out_pipe[0]); close(out_pipe[1]);
|
|
102
|
+
return NULL;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (pid == 0) {
|
|
106
|
+
/* Child: stdin from in_pipe[0], stdout to out_pipe[1] */
|
|
107
|
+
dup2(in_pipe[0], STDIN_FILENO);
|
|
108
|
+
dup2(out_pipe[1], STDOUT_FILENO);
|
|
109
|
+
/* Redirect stderr to /dev/null to suppress tool warnings */
|
|
110
|
+
int devnull = open("/dev/null", O_WRONLY);
|
|
111
|
+
if (devnull != -1) {
|
|
112
|
+
dup2(devnull, STDERR_FILENO);
|
|
113
|
+
close(devnull);
|
|
114
|
+
}
|
|
115
|
+
close(in_pipe[0]); close(in_pipe[1]);
|
|
116
|
+
close(out_pipe[0]); close(out_pipe[1]);
|
|
117
|
+
|
|
118
|
+
execl("/bin/sh", "sh", "-c", cmd, (char *)NULL);
|
|
119
|
+
_exit(127);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Parent */
|
|
123
|
+
close(in_pipe[0]);
|
|
124
|
+
close(out_pipe[1]);
|
|
125
|
+
|
|
126
|
+
/* Write input to child stdin */
|
|
127
|
+
size_t input_len = strlen(input);
|
|
128
|
+
ssize_t to_write = (ssize_t)input_len;
|
|
129
|
+
const char *p = input;
|
|
130
|
+
while (to_write > 0) {
|
|
131
|
+
ssize_t written = write(in_pipe[1], p, (size_t)to_write);
|
|
132
|
+
if (written <= 0) break;
|
|
133
|
+
p += written;
|
|
134
|
+
to_write -= written;
|
|
135
|
+
}
|
|
136
|
+
close(in_pipe[1]);
|
|
137
|
+
|
|
138
|
+
/* Read all of child's stdout */
|
|
139
|
+
size_t cap = 8192;
|
|
140
|
+
size_t size = 0;
|
|
141
|
+
char *buf = malloc(cap);
|
|
142
|
+
if (!buf) {
|
|
143
|
+
close(out_pipe[0]);
|
|
144
|
+
int status;
|
|
145
|
+
waitpid(pid, &status, 0);
|
|
146
|
+
return NULL;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
for (;;) {
|
|
150
|
+
if (size + 4096 > cap) {
|
|
151
|
+
cap *= 2;
|
|
152
|
+
char *nb = realloc(buf, cap);
|
|
153
|
+
if (!nb) {
|
|
154
|
+
free(buf);
|
|
155
|
+
close(out_pipe[0]);
|
|
156
|
+
int status;
|
|
157
|
+
waitpid(pid, &status, 0);
|
|
158
|
+
return NULL;
|
|
159
|
+
}
|
|
160
|
+
buf = nb;
|
|
161
|
+
}
|
|
162
|
+
ssize_t n = read(out_pipe[0], buf + size, 4096);
|
|
163
|
+
if (n < 0) {
|
|
164
|
+
if (errno == EINTR) continue;
|
|
165
|
+
free(buf);
|
|
166
|
+
close(out_pipe[0]);
|
|
167
|
+
int status;
|
|
168
|
+
waitpid(pid, &status, 0);
|
|
169
|
+
return NULL;
|
|
170
|
+
}
|
|
171
|
+
if (n == 0) break;
|
|
172
|
+
size += (size_t)n;
|
|
173
|
+
}
|
|
174
|
+
close(out_pipe[0]);
|
|
175
|
+
|
|
176
|
+
/* Reap child */
|
|
177
|
+
int status;
|
|
178
|
+
waitpid(pid, &status, 0);
|
|
179
|
+
|
|
180
|
+
/* Check if command succeeded */
|
|
181
|
+
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
|
182
|
+
free(buf);
|
|
183
|
+
return NULL;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
buf[size] = '\0';
|
|
187
|
+
return buf;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Highlight a single code block using the specified tool.
|
|
192
|
+
* Returns newly allocated HTML, or NULL on failure.
|
|
193
|
+
*/
|
|
194
|
+
static char *highlight_code_block(const char *code, const char *language,
|
|
195
|
+
const char *tool, bool line_numbers) {
|
|
196
|
+
char cmd[512];
|
|
197
|
+
const char *binary = get_tool_binary(tool);
|
|
198
|
+
if (!binary) return NULL;
|
|
199
|
+
|
|
200
|
+
if (strcmp(tool, "pygments") == 0) {
|
|
201
|
+
/* Pygments: pygmentize -l LANG -f html [-O linenos=1] */
|
|
202
|
+
if (language && *language) {
|
|
203
|
+
if (line_numbers) {
|
|
204
|
+
snprintf(cmd, sizeof(cmd), "%s -l %s -f html -O linenos=1", binary, language);
|
|
205
|
+
} else {
|
|
206
|
+
snprintf(cmd, sizeof(cmd), "%s -l %s -f html", binary, language);
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
/* Use -g for auto-detection when no language specified */
|
|
210
|
+
if (line_numbers) {
|
|
211
|
+
snprintf(cmd, sizeof(cmd), "%s -g -f html -O linenos=1", binary);
|
|
212
|
+
} else {
|
|
213
|
+
snprintf(cmd, sizeof(cmd), "%s -g -f html", binary);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
} else if (strcmp(tool, "skylighting") == 0) {
|
|
217
|
+
/* Skylighting: skylighting --syntax LANG -f html -r [-n]
|
|
218
|
+
* -r = fragment mode (no full HTML document wrapper) */
|
|
219
|
+
if (language && *language) {
|
|
220
|
+
if (line_numbers) {
|
|
221
|
+
snprintf(cmd, sizeof(cmd), "%s --syntax %s -f html -r -n", binary, language);
|
|
222
|
+
} else {
|
|
223
|
+
snprintf(cmd, sizeof(cmd), "%s --syntax %s -f html -r", binary, language);
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
/* Skylighting without syntax tries to auto-detect, but may fail */
|
|
227
|
+
if (line_numbers) {
|
|
228
|
+
snprintf(cmd, sizeof(cmd), "%s -f html -r -n", binary);
|
|
229
|
+
} else {
|
|
230
|
+
snprintf(cmd, sizeof(cmd), "%s -f html -r", binary);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
} else {
|
|
234
|
+
return NULL;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return run_command(cmd, code);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Apply syntax highlighting to code blocks in HTML.
|
|
242
|
+
*/
|
|
243
|
+
char *apex_apply_syntax_highlighting(const char *html, const char *tool, bool line_numbers, bool language_only) {
|
|
244
|
+
if (!html || !tool) return html ? strdup(html) : NULL;
|
|
245
|
+
|
|
246
|
+
/* Check if tool is available */
|
|
247
|
+
if (!apex_syntax_highlighter_available(tool)) {
|
|
248
|
+
const char *binary = get_tool_binary(tool);
|
|
249
|
+
/* Suppress warning if APEX_SUPPRESS_HIGHLIGHT_WARNINGS is set (e.g., during tests) */
|
|
250
|
+
if (!getenv("APEX_SUPPRESS_HIGHLIGHT_WARNINGS")) {
|
|
251
|
+
fprintf(stderr, "Warning: Syntax highlighting tool '%s' not found in PATH. "
|
|
252
|
+
"Code blocks will not be highlighted.\n", binary ? binary : tool);
|
|
253
|
+
}
|
|
254
|
+
return strdup(html);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
size_t html_len = strlen(html);
|
|
258
|
+
/* Allocate generous buffer for output (highlighted code can be larger) */
|
|
259
|
+
size_t cap = html_len * 3 + 1024;
|
|
260
|
+
char *output = malloc(cap);
|
|
261
|
+
if (!output) return strdup(html);
|
|
262
|
+
|
|
263
|
+
const char *read = html;
|
|
264
|
+
char *write = output;
|
|
265
|
+
size_t remaining = cap;
|
|
266
|
+
|
|
267
|
+
while (*read) {
|
|
268
|
+
/* Look for <pre pattern (handles both <pre><code and <pre lang="XXX"><code) */
|
|
269
|
+
if (strncmp(read, "<pre", 4) == 0 && (read[4] == '>' || read[4] == ' ')) {
|
|
270
|
+
const char *pre_start = read;
|
|
271
|
+
|
|
272
|
+
/* Find end of <pre ...> tag */
|
|
273
|
+
const char *pre_tag_end = strchr(read, '>');
|
|
274
|
+
if (!pre_tag_end) {
|
|
275
|
+
/* Malformed, copy as-is */
|
|
276
|
+
if (remaining > 0) {
|
|
277
|
+
*write++ = *read++;
|
|
278
|
+
remaining--;
|
|
279
|
+
} else {
|
|
280
|
+
read++;
|
|
281
|
+
}
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Check if <code follows */
|
|
286
|
+
const char *after_pre = pre_tag_end + 1;
|
|
287
|
+
/* Skip whitespace/newlines between <pre> and <code> */
|
|
288
|
+
while (*after_pre && (*after_pre == ' ' || *after_pre == '\t' || *after_pre == '\n' || *after_pre == '\r')) {
|
|
289
|
+
after_pre++;
|
|
290
|
+
}
|
|
291
|
+
if (strncmp(after_pre, "<code", 5) != 0) {
|
|
292
|
+
/* Not a code block, copy <pre and continue */
|
|
293
|
+
if (remaining > 0) {
|
|
294
|
+
*write++ = *read++;
|
|
295
|
+
remaining--;
|
|
296
|
+
} else {
|
|
297
|
+
read++;
|
|
298
|
+
}
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const char *code_tag = after_pre;
|
|
303
|
+
const char *code_tag_end = strchr(code_tag, '>');
|
|
304
|
+
if (!code_tag_end) {
|
|
305
|
+
/* Malformed, copy as-is */
|
|
306
|
+
if (remaining > 0) {
|
|
307
|
+
*write++ = *read++;
|
|
308
|
+
remaining--;
|
|
309
|
+
} else {
|
|
310
|
+
read++;
|
|
311
|
+
}
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Extract language - check both formats:
|
|
316
|
+
* 1. <pre lang="XXX"><code> (cmark-gfm format)
|
|
317
|
+
* 2. <pre><code class="language-XXX"> (standard format)
|
|
318
|
+
*/
|
|
319
|
+
char language[64] = {0};
|
|
320
|
+
|
|
321
|
+
/* First check for lang= attribute on <pre> tag */
|
|
322
|
+
const char *lang_attr = strstr(pre_start, "lang=\"");
|
|
323
|
+
if (lang_attr && lang_attr < pre_tag_end) {
|
|
324
|
+
const char *lang_start = lang_attr + 6;
|
|
325
|
+
const char *lang_end = strchr(lang_start, '"');
|
|
326
|
+
if (lang_end && lang_end < pre_tag_end) {
|
|
327
|
+
size_t lang_len = lang_end - lang_start;
|
|
328
|
+
if (lang_len < sizeof(language)) {
|
|
329
|
+
memcpy(language, lang_start, lang_len);
|
|
330
|
+
language[lang_len] = '\0';
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* If no lang= on pre, check for class="language-XXX" on code tag */
|
|
336
|
+
if (!language[0]) {
|
|
337
|
+
const char *class_attr = strstr(code_tag, "class=\"");
|
|
338
|
+
if (class_attr && class_attr < code_tag_end) {
|
|
339
|
+
const char *class_start = class_attr + 7;
|
|
340
|
+
const char *lang_prefix = strstr(class_start, "language-");
|
|
341
|
+
if (lang_prefix && lang_prefix < code_tag_end) {
|
|
342
|
+
const char *lang_start = lang_prefix + 9;
|
|
343
|
+
const char *lang_end = lang_start;
|
|
344
|
+
while (lang_end < code_tag_end && *lang_end != '"' && *lang_end != ' ') {
|
|
345
|
+
lang_end++;
|
|
346
|
+
}
|
|
347
|
+
size_t lang_len = lang_end - lang_start;
|
|
348
|
+
if (lang_len < sizeof(language)) {
|
|
349
|
+
memcpy(language, lang_start, lang_len);
|
|
350
|
+
language[lang_len] = '\0';
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* If language_only is set and no language was found, skip this block */
|
|
357
|
+
if (language_only && !language[0]) {
|
|
358
|
+
/* Copy the original block as-is */
|
|
359
|
+
const char *block_end = strstr(code_tag_end + 1, "</code></pre>");
|
|
360
|
+
if (block_end) {
|
|
361
|
+
size_t block_len = (block_end + 13) - pre_start;
|
|
362
|
+
if (block_len <= remaining) {
|
|
363
|
+
memcpy(write, pre_start, block_len);
|
|
364
|
+
write += block_len;
|
|
365
|
+
remaining -= block_len;
|
|
366
|
+
}
|
|
367
|
+
read = block_end + 13;
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/* Find </code></pre> */
|
|
373
|
+
const char *code_content_start = code_tag_end + 1;
|
|
374
|
+
const char *code_end = strstr(code_content_start, "</code></pre>");
|
|
375
|
+
if (!code_end) {
|
|
376
|
+
/* Malformed, copy as-is */
|
|
377
|
+
if (remaining > 0) {
|
|
378
|
+
*write++ = *read++;
|
|
379
|
+
remaining--;
|
|
380
|
+
} else {
|
|
381
|
+
read++;
|
|
382
|
+
}
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* Extract and unescape code content */
|
|
387
|
+
size_t code_len = code_end - code_content_start;
|
|
388
|
+
char *code = unescape_html(code_content_start, code_len);
|
|
389
|
+
if (!code) {
|
|
390
|
+
/* Failed to unescape, copy as-is */
|
|
391
|
+
size_t block_len = (code_end + 13) - pre_start;
|
|
392
|
+
if (block_len <= remaining) {
|
|
393
|
+
memcpy(write, pre_start, block_len);
|
|
394
|
+
write += block_len;
|
|
395
|
+
remaining -= block_len;
|
|
396
|
+
}
|
|
397
|
+
read = code_end + 13;
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* Run syntax highlighter */
|
|
402
|
+
char *highlighted = highlight_code_block(code, language, tool, line_numbers);
|
|
403
|
+
free(code);
|
|
404
|
+
|
|
405
|
+
if (highlighted && *highlighted) {
|
|
406
|
+
/* Use highlighted output */
|
|
407
|
+
size_t hl_len = strlen(highlighted);
|
|
408
|
+
|
|
409
|
+
/* Ensure we have enough space */
|
|
410
|
+
if (hl_len >= remaining) {
|
|
411
|
+
size_t written = write - output;
|
|
412
|
+
size_t new_cap = (written + hl_len + 1) * 2;
|
|
413
|
+
char *new_output = realloc(output, new_cap);
|
|
414
|
+
if (!new_output) {
|
|
415
|
+
free(highlighted);
|
|
416
|
+
free(output);
|
|
417
|
+
return strdup(html);
|
|
418
|
+
}
|
|
419
|
+
output = new_output;
|
|
420
|
+
write = output + written;
|
|
421
|
+
remaining = new_cap - written;
|
|
422
|
+
cap = new_cap;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
memcpy(write, highlighted, hl_len);
|
|
426
|
+
write += hl_len;
|
|
427
|
+
remaining -= hl_len;
|
|
428
|
+
free(highlighted);
|
|
429
|
+
} else {
|
|
430
|
+
/* Highlighting failed, copy original block */
|
|
431
|
+
size_t block_len = (code_end + 13) - pre_start;
|
|
432
|
+
if (block_len <= remaining) {
|
|
433
|
+
memcpy(write, pre_start, block_len);
|
|
434
|
+
write += block_len;
|
|
435
|
+
remaining -= block_len;
|
|
436
|
+
}
|
|
437
|
+
if (highlighted) free(highlighted);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
read = code_end + 13; /* Skip past </code></pre> */
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* Copy character */
|
|
445
|
+
if (remaining > 1) {
|
|
446
|
+
*write++ = *read++;
|
|
447
|
+
remaining--;
|
|
448
|
+
} else {
|
|
449
|
+
/* Need more space */
|
|
450
|
+
size_t written = write - output;
|
|
451
|
+
size_t new_cap = cap * 2;
|
|
452
|
+
char *new_output = realloc(output, new_cap);
|
|
453
|
+
if (!new_output) {
|
|
454
|
+
free(output);
|
|
455
|
+
return strdup(html);
|
|
456
|
+
}
|
|
457
|
+
output = new_output;
|
|
458
|
+
write = output + written;
|
|
459
|
+
remaining = new_cap - written;
|
|
460
|
+
cap = new_cap;
|
|
461
|
+
*write++ = *read++;
|
|
462
|
+
remaining--;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
*write = '\0';
|
|
467
|
+
return output;
|
|
468
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file syntax_highlight.h
|
|
3
|
+
* @brief External syntax highlighting support for code blocks
|
|
4
|
+
*
|
|
5
|
+
* Provides integration with external syntax highlighting tools like
|
|
6
|
+
* Pygments and Skylighting to produce colorized HTML output for
|
|
7
|
+
* fenced code blocks.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#ifndef APEX_SYNTAX_HIGHLIGHT_H
|
|
11
|
+
#define APEX_SYNTAX_HIGHLIGHT_H
|
|
12
|
+
|
|
13
|
+
#include <stdbool.h>
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Apply syntax highlighting to code blocks using an external tool.
|
|
17
|
+
*
|
|
18
|
+
* Scans the HTML for <pre><code class="language-XXX">...</code></pre> blocks,
|
|
19
|
+
* extracts the code content, runs it through the specified external tool,
|
|
20
|
+
* and replaces the original block with the highlighted HTML output.
|
|
21
|
+
*
|
|
22
|
+
* Supported tools:
|
|
23
|
+
* - "pygments": Uses pygmentize command (Python)
|
|
24
|
+
* - "skylighting": Uses skylighting command (Haskell)
|
|
25
|
+
*
|
|
26
|
+
* @param html The HTML output containing code blocks to highlight
|
|
27
|
+
* @param tool The highlighting tool name ("pygments" or "skylighting")
|
|
28
|
+
* @param line_numbers Whether to include line numbers in output
|
|
29
|
+
* @param language_only When true, only highlight blocks that have a language specified
|
|
30
|
+
* @return Newly allocated HTML with highlighted code blocks, or NULL on error.
|
|
31
|
+
* If the tool is not found or fails, returns a copy of the original HTML
|
|
32
|
+
* with a warning printed to stderr.
|
|
33
|
+
*/
|
|
34
|
+
char *apex_apply_syntax_highlighting(const char *html, const char *tool, bool line_numbers, bool language_only);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a syntax highlighting tool is available in PATH.
|
|
38
|
+
*
|
|
39
|
+
* @param tool The tool name ("pygments" or "skylighting")
|
|
40
|
+
* @return true if the tool's binary is found and executable, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
bool apex_syntax_highlighter_available(const char *tool);
|
|
43
|
+
|
|
44
|
+
#endif /* APEX_SYNTAX_HIGHLIGHT_H */
|