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,733 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# Generate single HTML file with all wiki pages
|
|
3
|
+
# Uses JavaScript to show/hide pages based on sidebar selection
|
|
4
|
+
|
|
5
|
+
require 'fileutils'
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
require 'rouge'
|
|
9
|
+
ROUGE_AVAILABLE = true
|
|
10
|
+
puts "Rouge loaded successfully (version: #{Rouge::VERSION rescue 'unknown'})"
|
|
11
|
+
rescue LoadError => e
|
|
12
|
+
ROUGE_AVAILABLE = false
|
|
13
|
+
puts "Warning: Rouge gem not found. Install with: gem install rouge"
|
|
14
|
+
puts "Error: #{e.message}" if e.message
|
|
15
|
+
puts "Syntax highlighting will be disabled."
|
|
16
|
+
rescue => e
|
|
17
|
+
ROUGE_AVAILABLE = false
|
|
18
|
+
puts "Warning: Error loading Rouge: #{e.class}: #{e.message}"
|
|
19
|
+
puts "Syntax highlighting will be disabled."
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
SCRIPT_DIR = File.expand_path(__dir__)
|
|
23
|
+
DOCS_DIR = File.join(SCRIPT_DIR, '..')
|
|
24
|
+
HTML_DIR = File.join(DOCS_DIR, 'documentation', 'html')
|
|
25
|
+
WIKI_DIR = File.join(DOCS_DIR, 'documentation', 'apex.wiki')
|
|
26
|
+
|
|
27
|
+
# Find Apex binary
|
|
28
|
+
def find_apex_binary
|
|
29
|
+
# Prioritize build/apex if it exists (most recent build)
|
|
30
|
+
build_apex = File.expand_path('../build/apex', __dir__)
|
|
31
|
+
return build_apex if File.exist?(build_apex)
|
|
32
|
+
|
|
33
|
+
# Try build-release (relative to repo root, not script dir)
|
|
34
|
+
build_release_apex = File.expand_path('../build-release/apex', __dir__)
|
|
35
|
+
return build_release_apex if File.exist?(build_release_apex)
|
|
36
|
+
|
|
37
|
+
['../build-debug/apex'].each do |path|
|
|
38
|
+
full_path = File.expand_path(path, __dir__)
|
|
39
|
+
return full_path if File.exist?(full_path)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Fall back to system-installed apex
|
|
43
|
+
system_apex = `which apex 2>/dev/null`.strip
|
|
44
|
+
return system_apex if system_apex != '' && File.exist?(system_apex)
|
|
45
|
+
|
|
46
|
+
nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
APEX_BIN = find_apex_binary
|
|
50
|
+
|
|
51
|
+
def parse_sidebar
|
|
52
|
+
sidebar_file = File.join(WIKI_DIR, '_Sidebar.md')
|
|
53
|
+
pages = []
|
|
54
|
+
|
|
55
|
+
# Always add Home first
|
|
56
|
+
pages << { name: 'Home', title: 'Home', file: 'Home.md' }
|
|
57
|
+
|
|
58
|
+
if File.exist?(sidebar_file)
|
|
59
|
+
sidebar_content = File.read(sidebar_file)
|
|
60
|
+
sidebar_content.scan(/\[([^\]]+)\]\(([^)]+)\)/) do |text, link|
|
|
61
|
+
page_name = link.gsub(/\.md$/, '')
|
|
62
|
+
next if page_name.downcase == 'home'
|
|
63
|
+
pages << { name: page_name, title: text, file: "#{page_name}.md" }
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
pages
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def parse_footer
|
|
71
|
+
footer_file = File.join(WIKI_DIR, '_Footer.md')
|
|
72
|
+
return '' unless File.exist?(footer_file)
|
|
73
|
+
|
|
74
|
+
footer_content = `#{APEX_BIN} "#{footer_file}" 2>/dev/null`
|
|
75
|
+
if $?.success? && !footer_content.empty?
|
|
76
|
+
footer_content.strip
|
|
77
|
+
else
|
|
78
|
+
footer_text = File.read(footer_file).strip
|
|
79
|
+
"<p>#{footer_text.gsub(/\n/, '<br>')}</p>"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Rouge CSS is now included in shared_styles.css
|
|
84
|
+
|
|
85
|
+
def generate_css
|
|
86
|
+
# Load shared CSS
|
|
87
|
+
shared_css_file = File.join(SCRIPT_DIR, 'shared_styles.css')
|
|
88
|
+
shared_css = File.exist?(shared_css_file) ? File.read(shared_css_file) : ''
|
|
89
|
+
|
|
90
|
+
# Additional styles specific to single-page HTML
|
|
91
|
+
additional_css = <<~CSS
|
|
92
|
+
<style>
|
|
93
|
+
* {
|
|
94
|
+
margin: 0;
|
|
95
|
+
padding: 0;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
}
|
|
98
|
+
#{shared_css}
|
|
99
|
+
.content {
|
|
100
|
+
padding: 2rem;
|
|
101
|
+
max-width: 900px;
|
|
102
|
+
}
|
|
103
|
+
.page {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
.page.active {
|
|
107
|
+
display: block;
|
|
108
|
+
}
|
|
109
|
+
h1, h2, h3, h4, h5, h6 {
|
|
110
|
+
margin-top: 1.5em;
|
|
111
|
+
margin-bottom: 0.5em;
|
|
112
|
+
}
|
|
113
|
+
h1 {
|
|
114
|
+
font-size: 2em;
|
|
115
|
+
border-bottom: 2px solid #eee;
|
|
116
|
+
padding-bottom: 0.3em;
|
|
117
|
+
}
|
|
118
|
+
h2 {
|
|
119
|
+
font-size: 1.5em;
|
|
120
|
+
border-bottom: 1px solid #eee;
|
|
121
|
+
padding-bottom: 0.3em;
|
|
122
|
+
}
|
|
123
|
+
blockquote {
|
|
124
|
+
border-left: 4px solid #ddd;
|
|
125
|
+
margin: 0;
|
|
126
|
+
padding-left: 1rem;
|
|
127
|
+
color: #666;
|
|
128
|
+
}
|
|
129
|
+
table {
|
|
130
|
+
border-collapse: collapse;
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
th, td {
|
|
134
|
+
border: 1px solid #ddd;
|
|
135
|
+
padding: 0.5rem;
|
|
136
|
+
}
|
|
137
|
+
th {
|
|
138
|
+
background: #f5f5f5;
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
141
|
+
CSS
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def generate_javascript
|
|
145
|
+
# Load shared JavaScript
|
|
146
|
+
shared_js_file = File.join(SCRIPT_DIR, 'shared_scripts.js')
|
|
147
|
+
shared_js = File.exist?(shared_js_file) ? File.read(shared_js_file) : ''
|
|
148
|
+
|
|
149
|
+
<<~JS
|
|
150
|
+
<script>
|
|
151
|
+
#{shared_js}
|
|
152
|
+
function showPage(pageId) {
|
|
153
|
+
// Hide all pages
|
|
154
|
+
var pages = document.querySelectorAll('.page');
|
|
155
|
+
pages.forEach(function(page) {
|
|
156
|
+
page.classList.remove('active');
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Show selected page
|
|
160
|
+
var selectedPage = document.getElementById('page-' + pageId);
|
|
161
|
+
if (selectedPage) {
|
|
162
|
+
selectedPage.classList.add('active');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Update active link
|
|
166
|
+
var links = document.querySelectorAll('.sidebar a');
|
|
167
|
+
links.forEach(function(link) {
|
|
168
|
+
link.classList.remove('active');
|
|
169
|
+
});
|
|
170
|
+
var activeLink = document.querySelector('.sidebar a[data-page="' + pageId + '"]');
|
|
171
|
+
if (activeLink) {
|
|
172
|
+
activeLink.classList.add('active');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Scroll to top
|
|
176
|
+
window.scrollTo(0, 0);
|
|
177
|
+
|
|
178
|
+
// Update URL hash without triggering scroll
|
|
179
|
+
if (history.pushState) {
|
|
180
|
+
history.pushState(null, null, '#' + pageId);
|
|
181
|
+
} else {
|
|
182
|
+
window.location.hash = pageId;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Initialize floating TOC for a page
|
|
188
|
+
function initFloatingTOC(pageElement) {
|
|
189
|
+
if (!pageElement) return;
|
|
190
|
+
|
|
191
|
+
var pageTOC = pageElement.querySelector('.page-toc');
|
|
192
|
+
if (!pageTOC) return;
|
|
193
|
+
|
|
194
|
+
// Add ID to page TOC if it doesn't have one
|
|
195
|
+
if (!pageTOC.id) {
|
|
196
|
+
pageTOC.id = 'page-toc-top-' + pageElement.id;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Find or create floating TOC for this page
|
|
200
|
+
var floatingTOC = pageElement.querySelector('.floating-toc');
|
|
201
|
+
if (!floatingTOC) {
|
|
202
|
+
floatingTOC = document.createElement('div');
|
|
203
|
+
floatingTOC.className = 'floating-toc';
|
|
204
|
+
floatingTOC.id = 'floating-toc-' + pageElement.id;
|
|
205
|
+
floatingTOC.innerHTML = '<div class="floating-toc-container"><div class="floating-toc-header"><span>Table of Contents 🔻</span></div><div class="floating-toc-content" id="floating-toc-content-' + pageElement.id + '"></div></div>';
|
|
206
|
+
pageElement.insertBefore(floatingTOC, pageElement.firstChild);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var floatingTOCContent = floatingTOC.querySelector('.floating-toc-content');
|
|
210
|
+
if (!floatingTOCContent) return;
|
|
211
|
+
|
|
212
|
+
// Clone the TOC structure
|
|
213
|
+
var tocClone = pageTOC.cloneNode(true);
|
|
214
|
+
tocClone.id = 'floating-toc-clone-' + pageElement.id;
|
|
215
|
+
floatingTOCContent.innerHTML = '';
|
|
216
|
+
floatingTOCContent.appendChild(tocClone);
|
|
217
|
+
|
|
218
|
+
// Update all links to use smooth scrolling
|
|
219
|
+
var allTOCLinks = pageElement.querySelectorAll('.page-toc a, .floating-toc-content a');
|
|
220
|
+
allTOCLinks.forEach(function(link) {
|
|
221
|
+
link.addEventListener('click', function(e) {
|
|
222
|
+
var href = this.getAttribute('href');
|
|
223
|
+
if (href && href.startsWith('#')) {
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
var targetId = href.substring(1);
|
|
226
|
+
var targetElement = document.getElementById(targetId);
|
|
227
|
+
if (targetElement) {
|
|
228
|
+
var offset = 20; // Offset from top
|
|
229
|
+
|
|
230
|
+
// Function to calculate absolute position from document top
|
|
231
|
+
function getAbsoluteTop(element) {
|
|
232
|
+
var top = 0;
|
|
233
|
+
while (element) {
|
|
234
|
+
top += element.offsetTop;
|
|
235
|
+
element = element.offsetParent;
|
|
236
|
+
}
|
|
237
|
+
return top;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Ensure the target element's page is visible
|
|
241
|
+
var targetPage = targetElement.closest('.page');
|
|
242
|
+
if (targetPage && !targetPage.classList.contains('active')) {
|
|
243
|
+
// If target is in a different page, switch to that page first
|
|
244
|
+
var pageId = targetPage.id.replace('page-', '');
|
|
245
|
+
if (typeof showPage === 'function') {
|
|
246
|
+
showPage(pageId);
|
|
247
|
+
// Wait for page to be visible, then scroll
|
|
248
|
+
setTimeout(function() {
|
|
249
|
+
var absoluteTop = getAbsoluteTop(targetElement);
|
|
250
|
+
window.scrollTo({
|
|
251
|
+
top: Math.max(0, absoluteTop - offset),
|
|
252
|
+
behavior: 'smooth'
|
|
253
|
+
});
|
|
254
|
+
}, 150);
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
// Target is in current page, calculate and scroll
|
|
258
|
+
var absoluteTop = getAbsoluteTop(targetElement);
|
|
259
|
+
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
260
|
+
var offsetPosition = absoluteTop - offset;
|
|
261
|
+
|
|
262
|
+
if (Math.abs(scrollTop - offsetPosition) > 10) {
|
|
263
|
+
window.scrollTo({
|
|
264
|
+
top: Math.max(0, offsetPosition),
|
|
265
|
+
behavior: 'smooth'
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Update URL hash without triggering scroll
|
|
271
|
+
if (history.pushState) {
|
|
272
|
+
history.pushState(null, null, href);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
// Handle scroll to show/hide floating TOC
|
|
280
|
+
var tocTop = pageTOC.getBoundingClientRect().top + window.pageYOffset;
|
|
281
|
+
var tocBottom = tocTop + pageTOC.offsetHeight;
|
|
282
|
+
|
|
283
|
+
function updateFloatingTOC() {
|
|
284
|
+
if (!pageElement.classList.contains('active')) {
|
|
285
|
+
floatingTOC.classList.remove('visible');
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
|
|
290
|
+
|
|
291
|
+
if (scrollY > tocBottom) {
|
|
292
|
+
floatingTOC.classList.add('visible');
|
|
293
|
+
} else {
|
|
294
|
+
floatingTOC.classList.remove('visible');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Throttle scroll events
|
|
299
|
+
var ticking = false;
|
|
300
|
+
function handleScroll() {
|
|
301
|
+
if (!ticking) {
|
|
302
|
+
window.requestAnimationFrame(function() {
|
|
303
|
+
updateFloatingTOC();
|
|
304
|
+
ticking = false;
|
|
305
|
+
});
|
|
306
|
+
ticking = true;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
window.addEventListener('scroll', handleScroll);
|
|
311
|
+
|
|
312
|
+
// Initial check
|
|
313
|
+
updateFloatingTOC();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Initialize on load
|
|
317
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
318
|
+
// Set up sidebar links
|
|
319
|
+
var links = document.querySelectorAll('.sidebar a');
|
|
320
|
+
links.forEach(function(link) {
|
|
321
|
+
link.addEventListener('click', function(e) {
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
var pageId = this.getAttribute('data-page');
|
|
324
|
+
if (pageId) {
|
|
325
|
+
showPage(pageId);
|
|
326
|
+
// Initialize floating TOC for the new page
|
|
327
|
+
setTimeout(function() {
|
|
328
|
+
var pageElement = document.getElementById('page-' + pageId);
|
|
329
|
+
if (pageElement) {
|
|
330
|
+
initFloatingTOC(pageElement);
|
|
331
|
+
}
|
|
332
|
+
}, 100);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
// Function to handle hash navigation
|
|
338
|
+
function handleHashNavigation() {
|
|
339
|
+
var hash = window.location.hash.substring(1);
|
|
340
|
+
if (!hash) {
|
|
341
|
+
// No hash, show first page by default
|
|
342
|
+
var firstLink = document.querySelector('.sidebar a[data-page]');
|
|
343
|
+
if (firstLink) {
|
|
344
|
+
var firstPageId = firstLink.getAttribute('data-page');
|
|
345
|
+
showPage(firstPageId);
|
|
346
|
+
setTimeout(function() {
|
|
347
|
+
var firstPageElement = document.getElementById('page-' + firstPageId);
|
|
348
|
+
if (firstPageElement) {
|
|
349
|
+
initFloatingTOC(firstPageElement);
|
|
350
|
+
}
|
|
351
|
+
}, 100);
|
|
352
|
+
}
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Check if hash is a page ID
|
|
357
|
+
var pageElement = document.getElementById('page-' + hash);
|
|
358
|
+
if (pageElement) {
|
|
359
|
+
// Hash is a page ID, show that page
|
|
360
|
+
showPage(hash);
|
|
361
|
+
setTimeout(function() {
|
|
362
|
+
initFloatingTOC(pageElement);
|
|
363
|
+
}, 100);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// Hash might be a section ID, find which page contains it
|
|
368
|
+
var targetElement = document.getElementById(hash);
|
|
369
|
+
if (targetElement) {
|
|
370
|
+
// Find the page that contains this element
|
|
371
|
+
var containingPage = targetElement.closest('.page');
|
|
372
|
+
if (containingPage) {
|
|
373
|
+
var pageId = containingPage.id.replace('page-', '');
|
|
374
|
+
showPage(pageId);
|
|
375
|
+
setTimeout(function() {
|
|
376
|
+
initFloatingTOC(containingPage);
|
|
377
|
+
// Scroll to the target element
|
|
378
|
+
function getAbsoluteTop(element) {
|
|
379
|
+
var top = 0;
|
|
380
|
+
while (element) {
|
|
381
|
+
top += element.offsetTop;
|
|
382
|
+
element = element.offsetParent;
|
|
383
|
+
}
|
|
384
|
+
return top;
|
|
385
|
+
}
|
|
386
|
+
var absoluteTop = getAbsoluteTop(targetElement);
|
|
387
|
+
window.scrollTo({
|
|
388
|
+
top: Math.max(0, absoluteTop - 20),
|
|
389
|
+
behavior: 'smooth'
|
|
390
|
+
});
|
|
391
|
+
}, 200);
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Hash doesn't match anything, show first page
|
|
397
|
+
var firstLink = document.querySelector('.sidebar a[data-page]');
|
|
398
|
+
if (firstLink) {
|
|
399
|
+
var firstPageId = firstLink.getAttribute('data-page');
|
|
400
|
+
showPage(firstPageId);
|
|
401
|
+
setTimeout(function() {
|
|
402
|
+
var firstPageElement = document.getElementById('page-' + firstPageId);
|
|
403
|
+
if (firstPageElement) {
|
|
404
|
+
initFloatingTOC(firstPageElement);
|
|
405
|
+
}
|
|
406
|
+
}, 100);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Handle hash on load
|
|
411
|
+
handleHashNavigation();
|
|
412
|
+
|
|
413
|
+
// Also handle hash changes
|
|
414
|
+
window.addEventListener('hashchange', function() {
|
|
415
|
+
handleHashNavigation();
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// Initialize floating TOC for all pages
|
|
419
|
+
var allPages = document.querySelectorAll('.page');
|
|
420
|
+
allPages.forEach(function(page) {
|
|
421
|
+
initFloatingTOC(page);
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
</script>
|
|
425
|
+
JS
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
def highlight_code_blocks(html_content)
|
|
429
|
+
return html_content unless ROUGE_AVAILABLE
|
|
430
|
+
|
|
431
|
+
code_block_count = 0
|
|
432
|
+
highlighted_count = 0
|
|
433
|
+
error_count = 0
|
|
434
|
+
|
|
435
|
+
# Find all code blocks - handle various formats
|
|
436
|
+
# Apex outputs: <pre lang="language"><code>...</code></pre>
|
|
437
|
+
# Or: <pre><code class="language-xxx">...</code></pre>
|
|
438
|
+
# Match <pre> tag (with optional lang attribute), then <code> tag (with optional class), then content, then closing tags
|
|
439
|
+
result = html_content.gsub(/<pre(\s+lang=["']([^"']+)["'])?[^>]*>\s*<code(\s+class=["'](?:language-)?([^"'\s]+)["'])?[^>]*>([\s\S]*?)<\/code>\s*<\/pre>/i) do |match|
|
|
440
|
+
code_block_count += 1
|
|
441
|
+
lang = $2 || $4 # Get lang from <pre lang="..."> ($2) or class from <code class="..."> ($4)
|
|
442
|
+
code = $5
|
|
443
|
+
|
|
444
|
+
begin
|
|
445
|
+
# Unescape HTML entities
|
|
446
|
+
code = code.gsub(/</, '<').gsub(/>/, '>').gsub(/&/, '&').gsub(/"/, '"')
|
|
447
|
+
|
|
448
|
+
if lang && !lang.empty?
|
|
449
|
+
lang_normalized = lang.downcase
|
|
450
|
+
# Handle common language aliases
|
|
451
|
+
lang_aliases = {
|
|
452
|
+
'yml' => 'yaml',
|
|
453
|
+
'md' => 'markdown',
|
|
454
|
+
'mkd' => 'markdown',
|
|
455
|
+
'mkdn' => 'markdown',
|
|
456
|
+
'mdown' => 'markdown'
|
|
457
|
+
}
|
|
458
|
+
lang_normalized = lang_aliases[lang_normalized] || lang_normalized
|
|
459
|
+
|
|
460
|
+
lexer = Rouge::Lexer.find(lang_normalized)
|
|
461
|
+
if lexer.nil?
|
|
462
|
+
puts " Warning: No lexer found for language '#{lang}' (normalized: '#{lang_normalized}'), using PlainText"
|
|
463
|
+
lexer = Rouge::Lexers::PlainText
|
|
464
|
+
end
|
|
465
|
+
else
|
|
466
|
+
lexer = Rouge::Lexers::PlainText
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
formatter = Rouge::Formatters::HTML.new
|
|
470
|
+
highlighted = formatter.format(lexer.lex(code))
|
|
471
|
+
highlighted_count += 1
|
|
472
|
+
|
|
473
|
+
# Return highlighted code with proper classes
|
|
474
|
+
"<pre><code class=\"highlight #{lang ? "language-#{lang}" : ''}\">#{highlighted}</code></pre>"
|
|
475
|
+
rescue => e
|
|
476
|
+
error_count += 1
|
|
477
|
+
# If highlighting fails, return original
|
|
478
|
+
puts " Warning: Failed to highlight code block (lang: #{lang || 'none'}): #{e.class}: #{e.message}"
|
|
479
|
+
puts " Backtrace: #{e.backtrace.first(2).join(' | ')}" if $DEBUG
|
|
480
|
+
match
|
|
481
|
+
end
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
if code_block_count > 0
|
|
485
|
+
puts " Highlighted #{highlighted_count}/#{code_block_count} code blocks"
|
|
486
|
+
puts " Errors: #{error_count}" if error_count > 0
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
result
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
def extract_headers(html_content)
|
|
493
|
+
headers = []
|
|
494
|
+
html_content.scan(/<h([1-6])[^>]*id=["']([^"']+)["'][^>]*>([\s\S]*?)<\/h[1-6]>/i) do |level, id, text|
|
|
495
|
+
text = text.gsub(/<[^>]+>/, '').gsub(/\s+/, ' ').strip
|
|
496
|
+
headers << { level: level.to_i, id: id, text: text } unless text.empty?
|
|
497
|
+
end
|
|
498
|
+
headers
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
def generate_page_toc(headers)
|
|
502
|
+
return '' if headers.empty?
|
|
503
|
+
|
|
504
|
+
toc_html = '<nav class="page-toc"><ul>'
|
|
505
|
+
stack = []
|
|
506
|
+
|
|
507
|
+
headers.each_with_index do |header, idx|
|
|
508
|
+
level = header[:level]
|
|
509
|
+
next_header = headers[idx + 1]
|
|
510
|
+
next_level = next_header ? next_header[:level] : 1
|
|
511
|
+
|
|
512
|
+
while !stack.empty? && stack.last >= level
|
|
513
|
+
toc_html += '</ul></li>'
|
|
514
|
+
stack.pop
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
if next_level > level
|
|
518
|
+
toc_html += "<li><a href=\"##{header[:id]}\">#{header[:text]}</a><ul>"
|
|
519
|
+
stack.push(level)
|
|
520
|
+
else
|
|
521
|
+
toc_html += "<li><a href=\"##{header[:id]}\">#{header[:text]}</a></li>"
|
|
522
|
+
end
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
while !stack.empty?
|
|
526
|
+
toc_html += '</ul></li>'
|
|
527
|
+
stack.pop
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
toc_html += '</ul></nav>'
|
|
531
|
+
toc_html
|
|
532
|
+
end
|
|
533
|
+
|
|
534
|
+
def fix_links_in_html(html_content, page_map)
|
|
535
|
+
# Fix internal links to use JavaScript navigation
|
|
536
|
+
html_content.gsub(/<a\s+([^>]*\s+)?href=["']([^"']+)["']([^>]*)>/i) do |match|
|
|
537
|
+
attrs_before = $1 || ''
|
|
538
|
+
href = $2
|
|
539
|
+
attrs_after = $3 || ''
|
|
540
|
+
|
|
541
|
+
# Skip external links, anchors (starting with #), or files with extensions
|
|
542
|
+
if href =~ /^(https?:\/\/|mailto:|#|.*\.(html|md|pdf|png|jpg|jpeg|gif|svg|webp))/i
|
|
543
|
+
match
|
|
544
|
+
elsif page_map[href]
|
|
545
|
+
# Convert to JavaScript navigation
|
|
546
|
+
page_id = page_map[href]
|
|
547
|
+
"<a #{attrs_before}href=\"##{page_id}\" onclick=\"showPage('#{page_id}'); return false;\"#{attrs_after}>"
|
|
548
|
+
elsif page_map[href.gsub(/\s+/, '-')]
|
|
549
|
+
page_id = page_map[href.gsub(/\s+/, '-')]
|
|
550
|
+
"<a #{attrs_before}href=\"##{page_id}\" onclick=\"showPage('#{page_id}'); return false;\"#{attrs_after}>"
|
|
551
|
+
else
|
|
552
|
+
# Try to find a matching page by case-insensitive comparison
|
|
553
|
+
matching_page = page_map.find { |name, id| name.downcase == href.downcase || name.downcase.gsub(/\s+/, '-') == href.downcase }
|
|
554
|
+
if matching_page
|
|
555
|
+
page_id = matching_page[1]
|
|
556
|
+
"<a #{attrs_before}href=\"##{page_id}\" onclick=\"showPage('#{page_id}'); return false;\"#{attrs_after}>"
|
|
557
|
+
else
|
|
558
|
+
match
|
|
559
|
+
end
|
|
560
|
+
end
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
def clone_wiki
|
|
565
|
+
wiki_url = 'https://github.com/ApexMarkdown/apex.wiki.git'
|
|
566
|
+
puts "Cloning wiki from GitHub..."
|
|
567
|
+
|
|
568
|
+
if File.exist?(WIKI_DIR)
|
|
569
|
+
puts "Wiki directory already exists, removing..."
|
|
570
|
+
FileUtils.rm_rf(WIKI_DIR)
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
success = system("git clone #{wiki_url} \"#{WIKI_DIR}\" 2>&1")
|
|
574
|
+
unless success
|
|
575
|
+
puts "Error: Failed to clone wiki from #{wiki_url}"
|
|
576
|
+
exit 1
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
puts "Wiki cloned successfully"
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
def cleanup_wiki
|
|
583
|
+
if File.exist?(WIKI_DIR)
|
|
584
|
+
puts "\nCleaning up wiki clone..."
|
|
585
|
+
FileUtils.rm_rf(WIKI_DIR)
|
|
586
|
+
puts "Wiki clone removed"
|
|
587
|
+
end
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
puts "Generating single HTML file with all wiki pages..."
|
|
591
|
+
|
|
592
|
+
# Ensure output directory exists
|
|
593
|
+
FileUtils.mkdir_p(HTML_DIR)
|
|
594
|
+
|
|
595
|
+
# Clone wiki
|
|
596
|
+
clone_wiki
|
|
597
|
+
|
|
598
|
+
unless File.exist?(WIKI_DIR)
|
|
599
|
+
puts "Error: Wiki directory not found at #{WIKI_DIR}"
|
|
600
|
+
exit 1
|
|
601
|
+
end
|
|
602
|
+
|
|
603
|
+
unless File.exist?(APEX_BIN)
|
|
604
|
+
puts "Error: Apex binary not found at #{APEX_BIN}"
|
|
605
|
+
puts "Please build Apex first or ensure it's in PATH"
|
|
606
|
+
cleanup_wiki
|
|
607
|
+
exit 1
|
|
608
|
+
end
|
|
609
|
+
|
|
610
|
+
# Parse sidebar to get page order
|
|
611
|
+
pages = parse_sidebar
|
|
612
|
+
puts "Found #{pages.length} pages to process..."
|
|
613
|
+
|
|
614
|
+
# Parse footer
|
|
615
|
+
footer_html = parse_footer
|
|
616
|
+
|
|
617
|
+
# Build complete page_map first (before processing any pages)
|
|
618
|
+
# This ensures all page names are available when fixing links
|
|
619
|
+
page_map = {}
|
|
620
|
+
pages.each do |page_info|
|
|
621
|
+
page_id = page_info[:name].downcase.gsub(/\s+/, '-')
|
|
622
|
+
# Map both the original name and common variations
|
|
623
|
+
page_map[page_info[:name]] = page_id
|
|
624
|
+
page_map[page_info[:name].gsub(/\s+/, '-')] = page_id
|
|
625
|
+
page_map[page_info[:name].gsub(/\s+/, '_')] = page_id
|
|
626
|
+
# Also map the file name without extension
|
|
627
|
+
file_basename = File.basename(page_info[:file], '.md')
|
|
628
|
+
page_map[file_basename] = page_id
|
|
629
|
+
page_map[file_basename.gsub(/\s+/, '-')] = page_id
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
# Process each page
|
|
633
|
+
page_htmls = []
|
|
634
|
+
|
|
635
|
+
pages.each do |page_info|
|
|
636
|
+
md_file = File.join(WIKI_DIR, page_info[:file])
|
|
637
|
+
next unless File.exist?(md_file)
|
|
638
|
+
|
|
639
|
+
puts "Processing #{page_info[:name]}..."
|
|
640
|
+
|
|
641
|
+
# Convert to HTML
|
|
642
|
+
html_content = `#{APEX_BIN} "#{md_file}" --standalone --pretty 2>/dev/null`
|
|
643
|
+
|
|
644
|
+
if $?.success? && !html_content.empty?
|
|
645
|
+
# Extract body content (remove html/head/body tags)
|
|
646
|
+
body_match = html_content.match(/<body[^>]*>([\s\S]*)<\/body>/i)
|
|
647
|
+
if body_match
|
|
648
|
+
body_content = body_match[1]
|
|
649
|
+
|
|
650
|
+
# Extract title
|
|
651
|
+
title_match = body_content.match(/<h1[^>]*>(.*?)<\/h1>/i)
|
|
652
|
+
title = title_match ? title_match[1].gsub(/<[^>]+>/, '').strip : page_info[:title]
|
|
653
|
+
|
|
654
|
+
# Fix links (page_map is now complete with all pages)
|
|
655
|
+
body_content = fix_links_in_html(body_content, page_map)
|
|
656
|
+
|
|
657
|
+
# Extract headers for TOC (after fixing links)
|
|
658
|
+
headers = extract_headers(body_content)
|
|
659
|
+
page_toc = generate_page_toc(headers)
|
|
660
|
+
|
|
661
|
+
# Fix any remaining links in the TOC itself
|
|
662
|
+
page_toc = fix_links_in_html(page_toc, page_map)
|
|
663
|
+
|
|
664
|
+
# Highlight code blocks
|
|
665
|
+
body_content = highlight_code_blocks(body_content)
|
|
666
|
+
|
|
667
|
+
# Inject page TOC after h1 (add ID for scroll detection)
|
|
668
|
+
page_toc_with_id = page_toc.sub(/<nav class="page-toc">/, '<nav class="page-toc" id="page-toc-top">')
|
|
669
|
+
if body_content =~ /<h1[^>]*>[\s\S]*?<\/h1>/i
|
|
670
|
+
body_content = body_content.sub(/(<h1[^>]*>[\s\S]*?<\/h1>)/i, "\\1\n#{page_toc_with_id}")
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
# Add footer
|
|
674
|
+
body_content += "\n#{footer_html}" if footer_html.length > 0
|
|
675
|
+
|
|
676
|
+
page_htmls << {
|
|
677
|
+
id: page_info[:name].downcase.gsub(/\s+/, '-'),
|
|
678
|
+
title: title,
|
|
679
|
+
content: body_content
|
|
680
|
+
}
|
|
681
|
+
end
|
|
682
|
+
end
|
|
683
|
+
end
|
|
684
|
+
|
|
685
|
+
# Generate sidebar HTML
|
|
686
|
+
# Add hamburger menu and mobile overlay
|
|
687
|
+
hamburger_html = <<~HTML
|
|
688
|
+
<button class="hamburger-menu" id="hamburger-menu" aria-label="Toggle navigation"></button>
|
|
689
|
+
<div class="mobile-menu-overlay" id="mobile-menu-overlay"></div>
|
|
690
|
+
HTML
|
|
691
|
+
|
|
692
|
+
sidebar_html = hamburger_html + '<nav class="sidebar"><ul>'
|
|
693
|
+
pages.each do |page_info|
|
|
694
|
+
page_id = page_info[:name].downcase.gsub(/\s+/, '-')
|
|
695
|
+
sidebar_html += "<li><a href=\"##{page_id}\" data-page=\"#{page_id}\">#{page_info[:title]}</a></li>"
|
|
696
|
+
end
|
|
697
|
+
sidebar_html += '</ul></nav>'
|
|
698
|
+
|
|
699
|
+
# Generate page containers
|
|
700
|
+
pages_html = '<div class="content">'
|
|
701
|
+
page_htmls.each do |page|
|
|
702
|
+
pages_html += "<div id=\"page-#{page[:id]}\" class=\"page\">#{page[:content]}</div>"
|
|
703
|
+
end
|
|
704
|
+
pages_html += '</div>'
|
|
705
|
+
|
|
706
|
+
# Combine everything
|
|
707
|
+
html_output = <<~HTML
|
|
708
|
+
<!DOCTYPE html>
|
|
709
|
+
<html lang="en">
|
|
710
|
+
<head>
|
|
711
|
+
<meta charset="UTF-8">
|
|
712
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
713
|
+
<title>Apex Documentation</title>
|
|
714
|
+
#{generate_css}
|
|
715
|
+
</head>
|
|
716
|
+
<body>
|
|
717
|
+
#{sidebar_html}
|
|
718
|
+
#{pages_html}
|
|
719
|
+
#{generate_javascript}
|
|
720
|
+
</body>
|
|
721
|
+
</html>
|
|
722
|
+
HTML
|
|
723
|
+
|
|
724
|
+
# Write output
|
|
725
|
+
output_file = File.join(HTML_DIR, 'apex-docs.html')
|
|
726
|
+
File.write(output_file, html_output)
|
|
727
|
+
|
|
728
|
+
puts "\nSingle HTML file generated successfully!"
|
|
729
|
+
puts "Output: #{output_file}"
|
|
730
|
+
puts "File size: #{(File.size(output_file) / 1024.0 / 1024.0).round(2)} MB"
|
|
731
|
+
|
|
732
|
+
# Clean up wiki clone
|
|
733
|
+
cleanup_wiki
|