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
data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html
ADDED
|
@@ -0,0 +1,1737 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
|
|
6
|
+
<meta charset="UTF-8">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<meta name="generator" content="Apex 0.1.49">
|
|
9
|
+
<title>Document</title>
|
|
10
|
+
<style>
|
|
11
|
+
body {
|
|
12
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
|
|
13
|
+
line-height: 1.6;
|
|
14
|
+
max-width: 800px;
|
|
15
|
+
margin: 2rem auto;
|
|
16
|
+
padding: 0 1rem;
|
|
17
|
+
color: #333;
|
|
18
|
+
}
|
|
19
|
+
pre { background: #f5f5f5; padding: 1rem; overflow-x: auto; }
|
|
20
|
+
code { background: #f0f0f0; padding: 0.2em 0.4em; border-radius: 3px; }
|
|
21
|
+
blockquote { border-left: 4px solid #ddd; margin: 0; padding-left: 1rem; color: #666; }
|
|
22
|
+
table { border-collapse: collapse; width: 100%%; }
|
|
23
|
+
th, td { border: 1px solid #ddd; padding: 0.5rem; }
|
|
24
|
+
th { background: #f5f5f5; }
|
|
25
|
+
tfoot td { background: #e8e8e8; }
|
|
26
|
+
figure.table-figure { width: fit-content; margin: 1em 0; }
|
|
27
|
+
figure.table-figure table { width: auto; }
|
|
28
|
+
figcaption { text-align: center; font-weight: bold; font-size: 0.8em; }
|
|
29
|
+
.page-break { page-break-after: always; }
|
|
30
|
+
.callout { padding: 1rem; margin: 1rem 0; border-left: 4px solid; }
|
|
31
|
+
.callout-note { border-color: #3b82f6; background: #eff6ff; }
|
|
32
|
+
.callout-warning { border-color: #f59e0b; background: #fffbeb; }
|
|
33
|
+
.callout-tip { border-color: #10b981; background: #f0fdf4; }
|
|
34
|
+
.callout-danger { border-color: #ef4444; background: #fef2f2; }
|
|
35
|
+
ins { background: #d4fcbc; text-decoration: none; }
|
|
36
|
+
del { background: #fbb6c2; text-decoration: line-through; }
|
|
37
|
+
mark { background: #fff3cd; }
|
|
38
|
+
.critic.comment { background: #e7e7e7; color: #666; font-style: italic; }
|
|
39
|
+
</style>
|
|
40
|
+
<style>
|
|
41
|
+
/* Base styles */
|
|
42
|
+
body {
|
|
43
|
+
-webkit-font-smoothing: antialiased;
|
|
44
|
+
-moz-osx-font-smoothing: grayscale;
|
|
45
|
+
font-size: 17px;
|
|
46
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
47
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
48
|
+
line-height: 1.65;
|
|
49
|
+
color: #1e293b;
|
|
50
|
+
background-color: #fff;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Sidebar / Main TOC - wider on larger screens */
|
|
54
|
+
.main-toc,
|
|
55
|
+
.sidebar {
|
|
56
|
+
position: fixed;
|
|
57
|
+
left: 0;
|
|
58
|
+
top: 0;
|
|
59
|
+
width: auto;
|
|
60
|
+
min-width: 180px;
|
|
61
|
+
max-width: 250px;
|
|
62
|
+
height: 100vh;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
background: #1e293b;
|
|
65
|
+
color: rgba(255, 255, 255, 0.9);
|
|
66
|
+
border-right: 2px solid rgba(255, 255, 255, 0.1);
|
|
67
|
+
padding: 24px 20px 130px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
z-index: 100;
|
|
70
|
+
margin-right: 1rem;
|
|
71
|
+
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
|
|
72
|
+
transition: transform 0.3s ease;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.main-toc ul,
|
|
76
|
+
.sidebar ul {
|
|
77
|
+
list-style: none;
|
|
78
|
+
padding-left: 0;
|
|
79
|
+
margin: 0;
|
|
80
|
+
padding-bottom: 80px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.main-toc ul::after,
|
|
84
|
+
.sidebar ul::after {
|
|
85
|
+
content: "";
|
|
86
|
+
display: block;
|
|
87
|
+
height: 80px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.main-toc li,
|
|
91
|
+
.sidebar li {
|
|
92
|
+
margin: 0.25em 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.main-toc a,
|
|
96
|
+
.sidebar a {
|
|
97
|
+
color: rgba(255, 255, 255, 0.85);
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
display: block;
|
|
100
|
+
padding: 6px 12px;
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
transition: all 0.15s ease;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.main-toc a:hover,
|
|
109
|
+
.sidebar a:hover {
|
|
110
|
+
background: #334155;
|
|
111
|
+
color: #fff;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.sidebar a.active {
|
|
115
|
+
color: #0ea5e9;
|
|
116
|
+
font-weight: 500;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Body margin for sidebar */
|
|
120
|
+
body {
|
|
121
|
+
margin-left: 270px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Hamburger menu button */
|
|
125
|
+
.hamburger-menu {
|
|
126
|
+
display: none;
|
|
127
|
+
position: fixed;
|
|
128
|
+
top: 12px;
|
|
129
|
+
left: 12px;
|
|
130
|
+
z-index: 200;
|
|
131
|
+
background: #1e293b;
|
|
132
|
+
border: 2px solid rgba(255, 255, 255, 0.1);
|
|
133
|
+
border-radius: 6px;
|
|
134
|
+
padding: 10px;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
color: rgba(255, 255, 255, 0.9);
|
|
137
|
+
font-size: 20px;
|
|
138
|
+
line-height: 1;
|
|
139
|
+
width: 44px;
|
|
140
|
+
height: 44px;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
144
|
+
transition: all 0.2s ease;
|
|
145
|
+
opacity: 0.2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.hamburger-menu:hover {
|
|
149
|
+
background: #334155;
|
|
150
|
+
color: #fff;
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Move hamburger to the right of the sidebar when menu is open */
|
|
155
|
+
.hamburger-menu.active {
|
|
156
|
+
left: calc(
|
|
157
|
+
250px + 12px
|
|
158
|
+
); /* Position just to the right of sidebar (max-width 250px + 12px padding) */
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.hamburger-menu.active {
|
|
162
|
+
background: #0ea5e9;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.hamburger-menu::before {
|
|
166
|
+
content: "☰";
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.hamburger-menu.active::before {
|
|
170
|
+
content: "✕";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Mobile menu overlay */
|
|
174
|
+
.mobile-menu-overlay {
|
|
175
|
+
display: none;
|
|
176
|
+
position: fixed;
|
|
177
|
+
top: 0;
|
|
178
|
+
left: 0;
|
|
179
|
+
right: 0;
|
|
180
|
+
bottom: 0;
|
|
181
|
+
background: rgba(0, 0, 0, 0.5);
|
|
182
|
+
z-index: 150;
|
|
183
|
+
opacity: 0;
|
|
184
|
+
visibility: hidden;
|
|
185
|
+
transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.mobile-menu-overlay.active {
|
|
189
|
+
opacity: 1;
|
|
190
|
+
visibility: visible;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Page TOC */
|
|
194
|
+
.page-toc {
|
|
195
|
+
background: #f9f9f9;
|
|
196
|
+
border: 1px solid #ddd;
|
|
197
|
+
border-radius: 4px;
|
|
198
|
+
padding: 1rem;
|
|
199
|
+
margin: 1.5rem 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.page-toc ul {
|
|
203
|
+
list-style: none;
|
|
204
|
+
padding-left: 0;
|
|
205
|
+
margin: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.page-toc > ul {
|
|
209
|
+
padding-left: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.page-toc li {
|
|
213
|
+
margin: 0.25em 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.page-toc a {
|
|
217
|
+
color: #0066cc;
|
|
218
|
+
text-decoration: none;
|
|
219
|
+
display: block;
|
|
220
|
+
padding: 0.25em 0.5em;
|
|
221
|
+
border-radius: 3px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.page-toc a:hover {
|
|
225
|
+
background: #e0e0e0;
|
|
226
|
+
color: #004499;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.page-toc ul ul {
|
|
230
|
+
list-style: none;
|
|
231
|
+
padding-left: 1.5em;
|
|
232
|
+
margin-top: 0.25em;
|
|
233
|
+
margin-left: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.page-toc ul ul ul {
|
|
237
|
+
padding-left: 1.5em;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.page-toc ul ul a {
|
|
241
|
+
font-size: 0.9em;
|
|
242
|
+
color: #555;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.page-toc ul ul ul a {
|
|
246
|
+
font-size: 0.85em;
|
|
247
|
+
color: #666;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Floating TOC */
|
|
251
|
+
.floating-toc {
|
|
252
|
+
position: fixed;
|
|
253
|
+
top: 0;
|
|
254
|
+
left: 270px;
|
|
255
|
+
right: 0;
|
|
256
|
+
z-index: 50;
|
|
257
|
+
opacity: 0;
|
|
258
|
+
visibility: hidden;
|
|
259
|
+
transition: opacity 0.2s ease, visibility 0.2s ease;
|
|
260
|
+
pointer-events: none;
|
|
261
|
+
display: flex;
|
|
262
|
+
justify-content: flex-end;
|
|
263
|
+
padding-right: 2rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.floating-toc.visible {
|
|
267
|
+
opacity: 1;
|
|
268
|
+
visibility: visible;
|
|
269
|
+
pointer-events: auto;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.floating-toc-container {
|
|
273
|
+
background: rgba(255, 255, 255, 0.95);
|
|
274
|
+
backdrop-filter: blur(10px);
|
|
275
|
+
border-bottom: 1px solid #ddd;
|
|
276
|
+
border-radius: 0 0 12px 12px;
|
|
277
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
278
|
+
width: fit-content;
|
|
279
|
+
max-width: 400px;
|
|
280
|
+
min-width: 200px;
|
|
281
|
+
overflow: hidden;
|
|
282
|
+
transition: max-height 0.3s ease;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.floating-toc-header {
|
|
286
|
+
padding: 8px 16px;
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
user-select: none;
|
|
289
|
+
font-size: 14px;
|
|
290
|
+
font-weight: 500;
|
|
291
|
+
color: #1e293b;
|
|
292
|
+
display: flex;
|
|
293
|
+
align-items: center;
|
|
294
|
+
justify-content: space-between;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.floating-toc-header:hover {
|
|
298
|
+
background: rgba(0, 0, 0, 0.02);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.floating-toc-content {
|
|
302
|
+
max-height: 0;
|
|
303
|
+
overflow: hidden;
|
|
304
|
+
transition: max-height 0.3s ease;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.floating-toc-container:hover .floating-toc-content {
|
|
308
|
+
max-height: 70vh;
|
|
309
|
+
overflow-y: auto;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.floating-toc-content ul {
|
|
313
|
+
list-style: none;
|
|
314
|
+
padding: 8px 16px 16px;
|
|
315
|
+
margin: 0;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.floating-toc-content li {
|
|
319
|
+
margin: 0.1em 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.floating-toc-content a {
|
|
323
|
+
color: #0066cc;
|
|
324
|
+
text-decoration: none;
|
|
325
|
+
display: block;
|
|
326
|
+
padding: 0.2em 0.5em;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
font-size: 13px;
|
|
329
|
+
transition: background 0.15s ease;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.floating-toc-content a:hover {
|
|
333
|
+
background: #e0e0e0;
|
|
334
|
+
color: #004499;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.floating-toc-content ul ul {
|
|
338
|
+
padding-left: 1.2em;
|
|
339
|
+
margin-top: 0;
|
|
340
|
+
margin-bottom: 0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.floating-toc-content ul ul ul {
|
|
344
|
+
margin-top: 0;
|
|
345
|
+
margin-bottom: 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.floating-toc-content ul ul a {
|
|
349
|
+
font-size: 12px;
|
|
350
|
+
color: #555;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.floating-toc-content ul ul ul a {
|
|
354
|
+
font-size: 11px;
|
|
355
|
+
color: #666;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Smooth scrolling */
|
|
359
|
+
html {
|
|
360
|
+
scroll-behavior: smooth;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* Code blocks */
|
|
364
|
+
code {
|
|
365
|
+
background: #f0f0f0;
|
|
366
|
+
padding: 0.2em 0.4em;
|
|
367
|
+
border-radius: 3px;
|
|
368
|
+
font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
|
|
369
|
+
font-size: 0.9em;
|
|
370
|
+
margin: 0 0.1em;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
pre {
|
|
374
|
+
background: #f5f5f5;
|
|
375
|
+
padding: 1rem;
|
|
376
|
+
overflow-x: auto;
|
|
377
|
+
border-radius: 4px;
|
|
378
|
+
margin: 1em 0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
pre code {
|
|
382
|
+
background: none;
|
|
383
|
+
padding: 0;
|
|
384
|
+
margin: 0;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* Rouge syntax highlighting - GitHub theme, scoped to .highlight containers */
|
|
388
|
+
.highlight {
|
|
389
|
+
color: #24292e;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.highlight .c {
|
|
393
|
+
color: #6a737d;
|
|
394
|
+
font-style: italic;
|
|
395
|
+
} /* Comment */
|
|
396
|
+
.highlight .err {
|
|
397
|
+
color: #a61717;
|
|
398
|
+
background-color: #e3d2d2;
|
|
399
|
+
} /* Error */
|
|
400
|
+
.highlight .k {
|
|
401
|
+
color: #d73a49;
|
|
402
|
+
font-weight: bold;
|
|
403
|
+
} /* Keyword */
|
|
404
|
+
.highlight .l {
|
|
405
|
+
color: #032f62;
|
|
406
|
+
} /* Literal */
|
|
407
|
+
.highlight .n {
|
|
408
|
+
color: #24292e;
|
|
409
|
+
} /* Name */
|
|
410
|
+
.highlight .o {
|
|
411
|
+
color: #d73a49;
|
|
412
|
+
} /* Operator */
|
|
413
|
+
.highlight .p {
|
|
414
|
+
color: #24292e;
|
|
415
|
+
} /* Punctuation */
|
|
416
|
+
.highlight .cm {
|
|
417
|
+
color: #6a737d;
|
|
418
|
+
font-style: italic;
|
|
419
|
+
} /* Comment.Multiline */
|
|
420
|
+
.highlight .cp {
|
|
421
|
+
color: #6a737d;
|
|
422
|
+
font-weight: bold;
|
|
423
|
+
} /* Comment.Preproc */
|
|
424
|
+
.highlight .c1 {
|
|
425
|
+
color: #6a737d;
|
|
426
|
+
font-style: italic;
|
|
427
|
+
} /* Comment.Single */
|
|
428
|
+
.highlight .cs {
|
|
429
|
+
color: #6a737d;
|
|
430
|
+
font-weight: bold;
|
|
431
|
+
font-style: italic;
|
|
432
|
+
} /* Comment.Special */
|
|
433
|
+
.highlight .gd {
|
|
434
|
+
color: #24292e;
|
|
435
|
+
background-color: #ffeef0;
|
|
436
|
+
} /* Generic.Deleted */
|
|
437
|
+
.highlight .ge {
|
|
438
|
+
color: #24292e;
|
|
439
|
+
font-style: italic;
|
|
440
|
+
} /* Generic.Emph */
|
|
441
|
+
.highlight .gr {
|
|
442
|
+
color: #aa0000;
|
|
443
|
+
} /* Generic.Error */
|
|
444
|
+
.highlight .gh {
|
|
445
|
+
color: #999999;
|
|
446
|
+
font-weight: bold;
|
|
447
|
+
} /* Generic.Heading */
|
|
448
|
+
.highlight .gi {
|
|
449
|
+
color: #24292e;
|
|
450
|
+
background-color: #f0fff4;
|
|
451
|
+
} /* Generic.Inserted */
|
|
452
|
+
.highlight .go {
|
|
453
|
+
color: #888888;
|
|
454
|
+
} /* Generic.Output */
|
|
455
|
+
.highlight .gp {
|
|
456
|
+
color: #555555;
|
|
457
|
+
} /* Generic.Prompt */
|
|
458
|
+
.highlight .gs {
|
|
459
|
+
font-weight: bold;
|
|
460
|
+
} /* Generic.Strong */
|
|
461
|
+
.highlight .gu {
|
|
462
|
+
color: #aaaaaa;
|
|
463
|
+
} /* Generic.Subheading */
|
|
464
|
+
.highlight .gt {
|
|
465
|
+
color: #aa0000;
|
|
466
|
+
} /* Generic.Traceback */
|
|
467
|
+
.highlight .kc {
|
|
468
|
+
color: #d73a49;
|
|
469
|
+
font-weight: bold;
|
|
470
|
+
} /* Keyword.Constant */
|
|
471
|
+
.highlight .kd {
|
|
472
|
+
color: #d73a49;
|
|
473
|
+
font-weight: bold;
|
|
474
|
+
} /* Keyword.Declaration */
|
|
475
|
+
.highlight .kn {
|
|
476
|
+
color: #d73a49;
|
|
477
|
+
font-weight: bold;
|
|
478
|
+
} /* Keyword.Namespace */
|
|
479
|
+
.highlight .kp {
|
|
480
|
+
color: #d73a49;
|
|
481
|
+
font-weight: bold;
|
|
482
|
+
} /* Keyword.Pseudo */
|
|
483
|
+
.highlight .kr {
|
|
484
|
+
color: #d73a49;
|
|
485
|
+
font-weight: bold;
|
|
486
|
+
} /* Keyword.Reserved */
|
|
487
|
+
.highlight .kt {
|
|
488
|
+
color: #d73a49;
|
|
489
|
+
font-weight: bold;
|
|
490
|
+
} /* Keyword.Type */
|
|
491
|
+
.highlight .ld {
|
|
492
|
+
color: #032f62;
|
|
493
|
+
} /* Literal.Date */
|
|
494
|
+
.highlight .m {
|
|
495
|
+
color: #005cc5;
|
|
496
|
+
} /* Literal.Number */
|
|
497
|
+
.highlight .s {
|
|
498
|
+
color: #032f62;
|
|
499
|
+
} /* Literal.String */
|
|
500
|
+
.highlight .na {
|
|
501
|
+
color: #6f42c1;
|
|
502
|
+
} /* Name.Attribute */
|
|
503
|
+
.highlight .nb {
|
|
504
|
+
color: #005cc5;
|
|
505
|
+
} /* Name.Builtin */
|
|
506
|
+
.highlight .nc {
|
|
507
|
+
color: #6f42c1;
|
|
508
|
+
font-weight: bold;
|
|
509
|
+
} /* Name.Class */
|
|
510
|
+
.highlight .no {
|
|
511
|
+
color: #005cc5;
|
|
512
|
+
} /* Name.Constant */
|
|
513
|
+
.highlight .nd {
|
|
514
|
+
color: #6f42c1;
|
|
515
|
+
font-weight: bold;
|
|
516
|
+
} /* Name.Decorator */
|
|
517
|
+
.highlight .ni {
|
|
518
|
+
color: #800080;
|
|
519
|
+
} /* Name.Entity */
|
|
520
|
+
.highlight .ne {
|
|
521
|
+
color: #990000;
|
|
522
|
+
font-weight: bold;
|
|
523
|
+
} /* Name.Exception */
|
|
524
|
+
.highlight .nf {
|
|
525
|
+
color: #6f42c1;
|
|
526
|
+
} /* Name.Function */
|
|
527
|
+
.highlight .nl {
|
|
528
|
+
color: #990000;
|
|
529
|
+
} /* Name.Label */
|
|
530
|
+
.highlight .nn {
|
|
531
|
+
color: #555555;
|
|
532
|
+
} /* Name.Namespace */
|
|
533
|
+
.highlight .nx {
|
|
534
|
+
color: #6f42c1;
|
|
535
|
+
} /* Name.Other */
|
|
536
|
+
.highlight .py {
|
|
537
|
+
color: #990000;
|
|
538
|
+
} /* Name.Property */
|
|
539
|
+
.highlight .nt {
|
|
540
|
+
color: #22863a;
|
|
541
|
+
} /* Name.Tag */
|
|
542
|
+
.highlight .nv {
|
|
543
|
+
color: #e36209;
|
|
544
|
+
} /* Name.Variable */
|
|
545
|
+
.highlight .ow {
|
|
546
|
+
color: #d73a49;
|
|
547
|
+
font-weight: bold;
|
|
548
|
+
} /* Operator.Word */
|
|
549
|
+
.highlight .w {
|
|
550
|
+
color: #bbbbbb;
|
|
551
|
+
} /* Text.Whitespace */
|
|
552
|
+
.highlight .mf {
|
|
553
|
+
color: #005cc5;
|
|
554
|
+
} /* Literal.Number.Float */
|
|
555
|
+
.highlight .mh {
|
|
556
|
+
color: #005cc5;
|
|
557
|
+
} /* Literal.Number.Hex */
|
|
558
|
+
.highlight .mi {
|
|
559
|
+
color: #005cc5;
|
|
560
|
+
} /* Literal.Number.Integer */
|
|
561
|
+
.highlight .mo {
|
|
562
|
+
color: #005cc5;
|
|
563
|
+
} /* Literal.Number.Oct */
|
|
564
|
+
.highlight .sb {
|
|
565
|
+
color: #032f62;
|
|
566
|
+
} /* Literal.String.Backtick */
|
|
567
|
+
.highlight .sc {
|
|
568
|
+
color: #032f62;
|
|
569
|
+
} /* Literal.String.Char */
|
|
570
|
+
.highlight .sd {
|
|
571
|
+
color: #032f62;
|
|
572
|
+
} /* Literal.String.Doc */
|
|
573
|
+
.highlight .s2 {
|
|
574
|
+
color: #032f62;
|
|
575
|
+
} /* Literal.String.Double */
|
|
576
|
+
.highlight .se {
|
|
577
|
+
color: #032f62;
|
|
578
|
+
} /* Literal.String.Escape */
|
|
579
|
+
.highlight .sh {
|
|
580
|
+
color: #032f62;
|
|
581
|
+
} /* Literal.String.Heredoc */
|
|
582
|
+
.highlight .si {
|
|
583
|
+
color: #032f62;
|
|
584
|
+
} /* Literal.String.Interpol */
|
|
585
|
+
.highlight .sx {
|
|
586
|
+
color: #032f62;
|
|
587
|
+
} /* Literal.String.Other */
|
|
588
|
+
.highlight .sr {
|
|
589
|
+
color: #22863a;
|
|
590
|
+
} /* Literal.String.Regex */
|
|
591
|
+
.highlight .s1 {
|
|
592
|
+
color: #032f62;
|
|
593
|
+
} /* Literal.String.Single */
|
|
594
|
+
.highlight .ss {
|
|
595
|
+
color: #032f62;
|
|
596
|
+
} /* Literal.String.Symbol */
|
|
597
|
+
.highlight .bp {
|
|
598
|
+
color: #005cc5;
|
|
599
|
+
} /* Name.Builtin.Pseudo */
|
|
600
|
+
.highlight .vc {
|
|
601
|
+
color: #e36209;
|
|
602
|
+
} /* Name.Variable.Class */
|
|
603
|
+
.highlight .vg {
|
|
604
|
+
color: #e36209;
|
|
605
|
+
} /* Name.Variable.Global */
|
|
606
|
+
.highlight .vi {
|
|
607
|
+
color: #e36209;
|
|
608
|
+
} /* Name.Variable.Instance */
|
|
609
|
+
.highlight .il {
|
|
610
|
+
color: #005cc5;
|
|
611
|
+
} /* Literal.Number.Integer.Long */
|
|
612
|
+
|
|
613
|
+
/* Additional Rouge token classes that may be used */
|
|
614
|
+
.highlight .token {
|
|
615
|
+
color: #5670a0;
|
|
616
|
+
}
|
|
617
|
+
.highlight .token.list {
|
|
618
|
+
color: #546e9f;
|
|
619
|
+
}
|
|
620
|
+
.highlight .token.punctuation {
|
|
621
|
+
color: #3e8dad;
|
|
622
|
+
}
|
|
623
|
+
.highlight .token.list.punctuation {
|
|
624
|
+
color: #e05b78;
|
|
625
|
+
}
|
|
626
|
+
.highlight .token.content {
|
|
627
|
+
padding: 0;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/* Nested lists in page content */
|
|
631
|
+
ul ul,
|
|
632
|
+
ol ol,
|
|
633
|
+
ul ol,
|
|
634
|
+
ol ul {
|
|
635
|
+
padding-left: 1.5em;
|
|
636
|
+
margin-top: 0.25em;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/* Page footer */
|
|
640
|
+
.page-footer {
|
|
641
|
+
background: #f5f5f5;
|
|
642
|
+
border-top: 1px solid #ddd;
|
|
643
|
+
padding: 1.5rem;
|
|
644
|
+
margin-top: 3rem;
|
|
645
|
+
color: #666;
|
|
646
|
+
font-size: 0.9em;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.page-footer p {
|
|
650
|
+
margin: 0.5em 0;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.page-footer a {
|
|
654
|
+
color: #0066cc;
|
|
655
|
+
text-decoration: none;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.page-footer a:hover {
|
|
659
|
+
text-decoration: underline;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/* Mobile responsive */
|
|
663
|
+
@media (max-width: 768px) {
|
|
664
|
+
.hamburger-menu {
|
|
665
|
+
display: flex;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.main-toc,
|
|
669
|
+
.sidebar {
|
|
670
|
+
transform: translateX(-100%);
|
|
671
|
+
z-index: 175;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.main-toc.mobile-open,
|
|
675
|
+
.sidebar.mobile-open {
|
|
676
|
+
transform: translateX(0);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
body {
|
|
680
|
+
margin-left: 0;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.floating-toc {
|
|
684
|
+
left: 0;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
</style></head>
|
|
689
|
+
|
|
690
|
+
<body>
|
|
691
|
+
<div class="floating-toc" id="floating-toc">
|
|
692
|
+
<div class="floating-toc-container">
|
|
693
|
+
<div class="floating-toc-header">
|
|
694
|
+
<span>Table of Contents 🔻</span>
|
|
695
|
+
</div>
|
|
696
|
+
<div class="floating-toc-content" id="floating-toc-content">
|
|
697
|
+
<!-- Content will be populated by JavaScript -->
|
|
698
|
+
</div>
|
|
699
|
+
</div>
|
|
700
|
+
</div>
|
|
701
|
+
|
|
702
|
+
<button class="hamburger-menu" id="hamburger-menu" aria-label="Toggle navigation"></button>
|
|
703
|
+
<div class="mobile-menu-overlay" id="mobile-menu-overlay"></div>
|
|
704
|
+
|
|
705
|
+
<nav class="main-toc"><ul><li><a href="Home.html">Home</a></li><li><a href="Getting-Started.html">Getting Started</a></li><li><a href="Installation.html">Installation</a></li><li><a href="Usage.html">Usage</a></li><li><a href="Syntax.html">Syntax</a></li><li><a href="Inline-Attribute-Lists.html">Inline Attribute Lists</a></li><li><a href="Modes.html">Modes</a></li><li><a href="Command-Line-Options.html">Command Line Options</a></li><li><a href="Multi-File-Documents.html">Multi-file Documents</a></li><li><a href="Citations.html">Citations</a></li><li><a href="Metadata-Transforms.html">Metadata Transforms</a></li><li><a href="Pandoc-Integration.html">Integrating with Pandoc</a></li><li><a href="Header-IDs.html">Header IDs</a></li><li><a href="C-API.html">C API</a></li><li><a href="Xcode-Integration.html">Xcode Integration</a></li><li><a href="Examples.html">Examples</a></li><li><a href="Plugins.html">Plugins</a></li><li><a href="Troubleshooting.html">Troubleshooting</a></li><li><a href="Credits.html">Credits</a></li></ul></nav>
|
|
706
|
+
|
|
707
|
+
<h1 id="c-api">
|
|
708
|
+
C API
|
|
709
|
+
</h1>
|
|
710
|
+
<nav class="page-toc" id="page-toc-top"><ul><li><a href="#c-api">C API</a><ul><li><a href="#overview">Overview</a></li><li><a href="#core-types">Core Types</a><ul><li><a href="#apexmodet">apex_mode_t</a></li><li><a href="#apexoptions">apex_options</a></li></ul></li><li><a href="#core-functions">Core Functions</a><ul><li><a href="#apexoptionsdefault">apex_options_default</a></li><li><a href="#apexoptionsformode">apex_options_for_mode</a></li><li><a href="#apexmarkdowntohtml">apex_markdown_to_html</a></li><li><a href="#apexfreestring">apex_free_string</a></li><li><a href="#apexwraphtmldocument">apex_wrap_html_document</a></li><li><a href="#apexprettyprinthtml">apex_pretty_print_html</a></li></ul></li><li><a href="#version-functions">Version Functions</a><ul><li><a href="#apexversionstring">apex_version_string</a></li><li><a href="#apexversionmajor-apexversionminor-apexversionpatch">apex_version_major / apex_version_minor / apex_version_patch</a></li></ul></li><li><a href="#list-options">List Options</a><ul><li><a href="#mixed-list-markers">Mixed List Markers</a></li><li><a href="#alpha-lists">Alpha Lists</a></li></ul></li><li><a href="#feature-flags">Feature Flags</a></li><li><a href="#metadata-options">Metadata Options</a></li><li><a href="#file-inclusion">File Inclusion</a></li><li><a href="#output-options">Output Options</a></li><li><a href="#line-break-options">Line Break Options</a></li><li><a href="#header-id-options">Header ID Options</a></li><li><a href="#table-options">Table Options</a></li><li><a href="#complete-example">Complete Example</a></li><li><a href="#compiling-and-linking">Compiling and Linking</a><ul><li><a href="#with-cmake">With CMake</a></li><li><a href="#manual-compilation">Manual Compilation</a></li><li><a href="#static-linking">Static Linking</a></li></ul></li><li><a href="#thread-safety">Thread Safety</a></li><li><a href="#memory-management">Memory Management</a></li><li><a href="#error-handling">Error Handling</a></li><li><a href="#performance-tips">Performance Tips</a></li><li><a href="#related">Related</a></li></ul></li></ul></nav>
|
|
711
|
+
|
|
712
|
+
<p>
|
|
713
|
+
Apex provides a simple C API for programmatic Markdown to HTML conversion.
|
|
714
|
+
</p>
|
|
715
|
+
|
|
716
|
+
<h2 id="overview">
|
|
717
|
+
Overview
|
|
718
|
+
</h2>
|
|
719
|
+
|
|
720
|
+
<p>
|
|
721
|
+
The Apex C API is thread-safe and designed for integration into C and C++ applications. All functions are declared in <code>apex/apex.h</code>.
|
|
722
|
+
</p>
|
|
723
|
+
|
|
724
|
+
<h2 id="core-types">
|
|
725
|
+
Core Types
|
|
726
|
+
</h2>
|
|
727
|
+
|
|
728
|
+
<h3 id="apexmodet">
|
|
729
|
+
apex_mode_t
|
|
730
|
+
</h3>
|
|
731
|
+
|
|
732
|
+
<p>
|
|
733
|
+
Processor compatibility modes:
|
|
734
|
+
</p>
|
|
735
|
+
|
|
736
|
+
<pre><code class="highlight language-c"><span class="k">typedef</span> <span class="k">enum</span> <span class="p">{</span>
|
|
737
|
+
<span class="n">APEX_MODE_COMMONMARK</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="cm">/* Pure CommonMark spec */</span>
|
|
738
|
+
<span class="n">APEX_MODE_GFM</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="cm">/* GitHub Flavored Markdown */</span>
|
|
739
|
+
<span class="n">APEX_MODE_MULTIMARKDOWN</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> <span class="cm">/* MultiMarkdown compatibility */</span>
|
|
740
|
+
<span class="n">APEX_MODE_KRAMDOWN</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span> <span class="cm">/* Kramdown compatibility */</span>
|
|
741
|
+
<span class="n">APEX_MODE_UNIFIED</span> <span class="o">=</span> <span class="mi">4</span> <span class="cm">/* All features enabled */</span>
|
|
742
|
+
<span class="p">}</span> <span class="n">apex_mode_t</span><span class="p">;</span>
|
|
743
|
+
</code></pre>
|
|
744
|
+
|
|
745
|
+
<h3 id="apexoptions">
|
|
746
|
+
apex_options
|
|
747
|
+
</h3>
|
|
748
|
+
|
|
749
|
+
<p>
|
|
750
|
+
Configuration structure for processing:
|
|
751
|
+
</p>
|
|
752
|
+
|
|
753
|
+
<pre><code class="highlight language-c"><span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
|
|
754
|
+
<span class="n">apex_mode_t</span> <span class="n">mode</span><span class="p">;</span>
|
|
755
|
+
|
|
756
|
+
<span class="cm">/* Feature flags */</span>
|
|
757
|
+
<span class="n">bool</span> <span class="n">enable_tables</span><span class="p">;</span>
|
|
758
|
+
<span class="n">bool</span> <span class="n">enable_footnotes</span><span class="p">;</span>
|
|
759
|
+
<span class="n">bool</span> <span class="n">enable_definition_lists</span><span class="p">;</span>
|
|
760
|
+
<span class="n">bool</span> <span class="n">enable_smart_typography</span><span class="p">;</span>
|
|
761
|
+
<span class="n">bool</span> <span class="n">enable_math</span><span class="p">;</span>
|
|
762
|
+
<span class="n">bool</span> <span class="n">enable_critic_markup</span><span class="p">;</span>
|
|
763
|
+
<span class="n">bool</span> <span class="n">enable_wiki_links</span><span class="p">;</span>
|
|
764
|
+
<span class="n">bool</span> <span class="n">enable_task_lists</span><span class="p">;</span>
|
|
765
|
+
<span class="n">bool</span> <span class="n">enable_attributes</span><span class="p">;</span>
|
|
766
|
+
<span class="n">bool</span> <span class="n">enable_callouts</span><span class="p">;</span>
|
|
767
|
+
<span class="n">bool</span> <span class="n">enable_marked_extensions</span><span class="p">;</span>
|
|
768
|
+
|
|
769
|
+
<span class="cm">/* Critic markup mode */</span>
|
|
770
|
+
<span class="kt">int</span> <span class="n">critic_mode</span><span class="p">;</span> <span class="cm">/* 0=accept, 1=reject, 2=markup (default) */</span>
|
|
771
|
+
|
|
772
|
+
<span class="cm">/* Metadata handling */</span>
|
|
773
|
+
<span class="n">bool</span> <span class="n">strip_metadata</span><span class="p">;</span>
|
|
774
|
+
<span class="n">bool</span> <span class="n">enable_metadata_variables</span><span class="p">;</span>
|
|
775
|
+
|
|
776
|
+
<span class="cm">/* File inclusion */</span>
|
|
777
|
+
<span class="n">bool</span> <span class="n">enable_file_includes</span><span class="p">;</span>
|
|
778
|
+
<span class="kt">int</span> <span class="n">max_include_depth</span><span class="p">;</span>
|
|
779
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">base_directory</span><span class="p">;</span>
|
|
780
|
+
|
|
781
|
+
<span class="cm">/* Output options */</span>
|
|
782
|
+
<span class="n">bool</span> <span class="n">unsafe</span><span class="p">;</span> <span class="cm">/* Allow raw HTML */</span>
|
|
783
|
+
<span class="n">bool</span> <span class="n">validate_utf8</span><span class="p">;</span>
|
|
784
|
+
<span class="n">bool</span> <span class="n">github_pre_lang</span><span class="p">;</span>
|
|
785
|
+
<span class="n">bool</span> <span class="n">standalone</span><span class="p">;</span> <span class="cm">/* Generate complete HTML document */</span>
|
|
786
|
+
<span class="n">bool</span> <span class="n">pretty</span><span class="p">;</span> <span class="cm">/* Pretty-print HTML */</span>
|
|
787
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">stylesheet_path</span><span class="p">;</span>
|
|
788
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">document_title</span><span class="p">;</span>
|
|
789
|
+
|
|
790
|
+
<span class="cm">/* Line break handling */</span>
|
|
791
|
+
<span class="n">bool</span> <span class="n">hardbreaks</span><span class="p">;</span> <span class="cm">/* Treat newlines as hard breaks */</span>
|
|
792
|
+
<span class="n">bool</span> <span class="n">nobreaks</span><span class="p">;</span> <span class="cm">/* Render soft breaks as spaces */</span>
|
|
793
|
+
|
|
794
|
+
<span class="cm">/* Header ID generation */</span>
|
|
795
|
+
<span class="n">bool</span> <span class="n">generate_header_ids</span><span class="p">;</span>
|
|
796
|
+
<span class="n">bool</span> <span class="n">header_anchors</span><span class="p">;</span> <span class="cm">/* Generate <a> tags instead of id attributes */</span>
|
|
797
|
+
<span class="kt">int</span> <span class="n">id_format</span><span class="p">;</span> <span class="cm">/* 0=GFM, 1=MMD, 2=Kramdown */</span>
|
|
798
|
+
|
|
799
|
+
<span class="cm">/* Table options */</span>
|
|
800
|
+
<span class="n">bool</span> <span class="n">relaxed_tables</span><span class="p">;</span>
|
|
801
|
+
|
|
802
|
+
<span class="cm">/* List options */</span>
|
|
803
|
+
<span class="n">bool</span> <span class="n">allow_mixed_list_markers</span><span class="p">;</span> <span class="cm">/* Allow mixed list markers at same level (inherit type from first item) */</span>
|
|
804
|
+
<span class="n">bool</span> <span class="n">allow_alpha_lists</span><span class="p">;</span> <span class="cm">/* Support alpha list markers (a., b., c. and A., B., C.) */</span>
|
|
805
|
+
<span class="p">}</span> <span class="n">apex_options</span><span class="p">;</span>
|
|
806
|
+
</code></pre>
|
|
807
|
+
|
|
808
|
+
<h2 id="core-functions">
|
|
809
|
+
Core Functions
|
|
810
|
+
</h2>
|
|
811
|
+
|
|
812
|
+
<h3 id="apexoptionsdefault">
|
|
813
|
+
apex_options_default
|
|
814
|
+
</h3>
|
|
815
|
+
|
|
816
|
+
<p>
|
|
817
|
+
Get default options with all features enabled (unified mode).
|
|
818
|
+
</p>
|
|
819
|
+
|
|
820
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="nf">apex_options_default</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
|
821
|
+
</code></pre>
|
|
822
|
+
|
|
823
|
+
<p>
|
|
824
|
+
<strong> Returns:</strong> Default options structure
|
|
825
|
+
</p>
|
|
826
|
+
|
|
827
|
+
<p>
|
|
828
|
+
<strong> Example:</strong>
|
|
829
|
+
</p>
|
|
830
|
+
|
|
831
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_default</span><span class="p">();</span>
|
|
832
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">enable_math</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
833
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">pretty</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
834
|
+
</code></pre>
|
|
835
|
+
|
|
836
|
+
<h3 id="apexoptionsformode">
|
|
837
|
+
apex_options_for_mode
|
|
838
|
+
</h3>
|
|
839
|
+
|
|
840
|
+
<p>
|
|
841
|
+
Get options configured for a specific processor mode.
|
|
842
|
+
</p>
|
|
843
|
+
|
|
844
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="nf">apex_options_for_mode</span><span class="p">(</span><span class="n">apex_mode_t</span> <span class="n">mode</span><span class="p">);</span>
|
|
845
|
+
</code></pre>
|
|
846
|
+
|
|
847
|
+
<p>
|
|
848
|
+
<strong> Parameters:</strong>
|
|
849
|
+
</p>
|
|
850
|
+
|
|
851
|
+
<ul>
|
|
852
|
+
|
|
853
|
+
<li>
|
|
854
|
+
<code>mode</code> - Desired processor mode
|
|
855
|
+
</li>
|
|
856
|
+
|
|
857
|
+
</ul>
|
|
858
|
+
|
|
859
|
+
<p>
|
|
860
|
+
<strong> Returns:</strong> Options configured for the specified mode
|
|
861
|
+
</p>
|
|
862
|
+
|
|
863
|
+
<p>
|
|
864
|
+
<strong> Example:</strong>
|
|
865
|
+
</p>
|
|
866
|
+
|
|
867
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="n">gfm_opts</span> <span class="o">=</span> <span class="n">apex_options_for_mode</span><span class="p">(</span><span class="n">APEX_MODE_GFM</span><span class="p">);</span>
|
|
868
|
+
<span class="n">apex_options</span> <span class="n">mmd_opts</span> <span class="o">=</span> <span class="n">apex_options_for_mode</span><span class="p">(</span><span class="n">APEX_MODE_MULTIMARKDOWN</span><span class="p">);</span>
|
|
869
|
+
</code></pre>
|
|
870
|
+
|
|
871
|
+
<h3 id="apexmarkdowntohtml">
|
|
872
|
+
apex_markdown_to_html
|
|
873
|
+
</h3>
|
|
874
|
+
|
|
875
|
+
<p>
|
|
876
|
+
Main conversion function - converts Markdown to HTML.
|
|
877
|
+
</p>
|
|
878
|
+
|
|
879
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="nf">apex_markdown_to_html</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">markdown</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">len</span><span class="p">,</span>
|
|
880
|
+
<span class="k">const</span> <span class="n">apex_options</span> <span class="o">*</span><span class="n">options</span><span class="p">);</span>
|
|
881
|
+
</code></pre>
|
|
882
|
+
|
|
883
|
+
<p>
|
|
884
|
+
<strong> Parameters:</strong>
|
|
885
|
+
</p>
|
|
886
|
+
|
|
887
|
+
<ul>
|
|
888
|
+
|
|
889
|
+
<li>
|
|
890
|
+
<code>markdown</code> - Input Markdown text (UTF-8)
|
|
891
|
+
</li>
|
|
892
|
+
|
|
893
|
+
<li>
|
|
894
|
+
<code>len</code> - Length of input text (use <code>strlen()</code> if null-terminated)
|
|
895
|
+
</li>
|
|
896
|
+
|
|
897
|
+
<li>
|
|
898
|
+
<code>options</code> - Processing options (NULL for defaults)
|
|
899
|
+
</li>
|
|
900
|
+
|
|
901
|
+
</ul>
|
|
902
|
+
|
|
903
|
+
<p>
|
|
904
|
+
<strong> Returns:</strong> Newly allocated HTML string (must be freed with <code>apex_free_string</code>), or NULL on error
|
|
905
|
+
</p>
|
|
906
|
+
|
|
907
|
+
<p>
|
|
908
|
+
<strong> Example:</strong>
|
|
909
|
+
</p>
|
|
910
|
+
|
|
911
|
+
<pre><code class="highlight language-c"><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">markdown</span> <span class="o">=</span> <span class="s">"# Hello</span><span class="se">\n\n</span><span class="s">This is **bold**."</span><span class="p">;</span>
|
|
912
|
+
<span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_default</span><span class="p">();</span>
|
|
913
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">strlen</span><span class="p">(</span><span class="n">markdown</span><span class="p">),</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
914
|
+
|
|
915
|
+
<span class="k">if</span> <span class="p">(</span><span class="n">html</span><span class="p">)</span> <span class="p">{</span>
|
|
916
|
+
<span class="n">printf</span><span class="p">(</span><span class="s">"%s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">html</span><span class="p">);</span>
|
|
917
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
918
|
+
<span class="p">}</span>
|
|
919
|
+
</code></pre>
|
|
920
|
+
|
|
921
|
+
<h3 id="apexfreestring">
|
|
922
|
+
apex_free_string
|
|
923
|
+
</h3>
|
|
924
|
+
|
|
925
|
+
<p>
|
|
926
|
+
Free a string allocated by Apex.
|
|
927
|
+
</p>
|
|
928
|
+
|
|
929
|
+
<pre><code class="highlight language-c"><span class="kt">void</span> <span class="nf">apex_free_string</span><span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">);</span>
|
|
930
|
+
</code></pre>
|
|
931
|
+
|
|
932
|
+
<p>
|
|
933
|
+
<strong> Parameters:</strong>
|
|
934
|
+
</p>
|
|
935
|
+
|
|
936
|
+
<ul>
|
|
937
|
+
|
|
938
|
+
<li>
|
|
939
|
+
<code>str</code> - String to free (can be NULL, safe to call on NULL)
|
|
940
|
+
</li>
|
|
941
|
+
|
|
942
|
+
</ul>
|
|
943
|
+
|
|
944
|
+
<p>
|
|
945
|
+
<strong> Example:</strong>
|
|
946
|
+
</p>
|
|
947
|
+
|
|
948
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
|
|
949
|
+
<span class="n">Use</span> <span class="n">html</span><span class="p">...</span>
|
|
950
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
951
|
+
</code></pre>
|
|
952
|
+
|
|
953
|
+
<h3 id="apexwraphtmldocument">
|
|
954
|
+
apex_wrap_html_document
|
|
955
|
+
</h3>
|
|
956
|
+
|
|
957
|
+
<p>
|
|
958
|
+
Wrap HTML content in a complete HTML5 document structure.
|
|
959
|
+
</p>
|
|
960
|
+
|
|
961
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="nf">apex_wrap_html_document</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">content</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">title</span><span class="p">,</span>
|
|
962
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">stylesheet_path</span><span class="p">);</span>
|
|
963
|
+
</code></pre>
|
|
964
|
+
|
|
965
|
+
<p>
|
|
966
|
+
<strong> Parameters:</strong>
|
|
967
|
+
</p>
|
|
968
|
+
|
|
969
|
+
<ul>
|
|
970
|
+
|
|
971
|
+
<li>
|
|
972
|
+
<code>content</code> - HTML content to wrap
|
|
973
|
+
</li>
|
|
974
|
+
|
|
975
|
+
<li>
|
|
976
|
+
<code>title</code> - Document title (NULL for default “Document”)
|
|
977
|
+
</li>
|
|
978
|
+
|
|
979
|
+
<li>
|
|
980
|
+
<code>stylesheet_path</code> - Path to CSS file to link (NULL for none)
|
|
981
|
+
</li>
|
|
982
|
+
|
|
983
|
+
</ul>
|
|
984
|
+
|
|
985
|
+
<p>
|
|
986
|
+
<strong> Returns:</strong> Newly allocated HTML document string (must be freed with <code>apex_free_string</code>)
|
|
987
|
+
</p>
|
|
988
|
+
|
|
989
|
+
<p>
|
|
990
|
+
<strong> Example:</strong>
|
|
991
|
+
</p>
|
|
992
|
+
|
|
993
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="n">fragment</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
994
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">document</span> <span class="o">=</span> <span class="n">apex_wrap_html_document</span><span class="p">(</span><span class="n">fragment</span><span class="p">,</span> <span class="s">"My Document"</span><span class="p">,</span> <span class="s">"style.css"</span><span class="p">);</span>
|
|
995
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">fragment</span><span class="p">);</span>
|
|
996
|
+
<span class="n">Use</span> <span class="n">document</span><span class="p">...</span>
|
|
997
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">document</span><span class="p">);</span>
|
|
998
|
+
</code></pre>
|
|
999
|
+
|
|
1000
|
+
<h3 id="apexprettyprinthtml">
|
|
1001
|
+
apex_pretty_print_html
|
|
1002
|
+
</h3>
|
|
1003
|
+
|
|
1004
|
+
<p>
|
|
1005
|
+
Pretty-print HTML with proper indentation.
|
|
1006
|
+
</p>
|
|
1007
|
+
|
|
1008
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="nf">apex_pretty_print_html</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">html</span><span class="p">);</span>
|
|
1009
|
+
</code></pre>
|
|
1010
|
+
|
|
1011
|
+
<p>
|
|
1012
|
+
<strong> Parameters:</strong>
|
|
1013
|
+
</p>
|
|
1014
|
+
|
|
1015
|
+
<ul>
|
|
1016
|
+
|
|
1017
|
+
<li>
|
|
1018
|
+
<code>html</code> - HTML to format
|
|
1019
|
+
</li>
|
|
1020
|
+
|
|
1021
|
+
</ul>
|
|
1022
|
+
|
|
1023
|
+
<p>
|
|
1024
|
+
<strong> Returns:</strong> Newly allocated formatted HTML string (must be freed with <code>apex_free_string</code>)
|
|
1025
|
+
</p>
|
|
1026
|
+
|
|
1027
|
+
<p>
|
|
1028
|
+
<strong> Example:</strong>
|
|
1029
|
+
</p>
|
|
1030
|
+
|
|
1031
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1032
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">pretty</span> <span class="o">=</span> <span class="n">apex_pretty_print_html</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1033
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1034
|
+
<span class="n">Use</span> <span class="n">pretty</span><span class="p">...</span>
|
|
1035
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">pretty</span><span class="p">);</span>
|
|
1036
|
+
</code></pre>
|
|
1037
|
+
|
|
1038
|
+
<h2 id="version-functions">
|
|
1039
|
+
Version Functions
|
|
1040
|
+
</h2>
|
|
1041
|
+
|
|
1042
|
+
<h3 id="apexversionstring">
|
|
1043
|
+
apex_version_string
|
|
1044
|
+
</h3>
|
|
1045
|
+
|
|
1046
|
+
<p>
|
|
1047
|
+
Get version string.
|
|
1048
|
+
</p>
|
|
1049
|
+
|
|
1050
|
+
<pre><code class="highlight language-c"><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="nf">apex_version_string</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
|
1051
|
+
</code></pre>
|
|
1052
|
+
|
|
1053
|
+
<p>
|
|
1054
|
+
<strong> Returns:</strong> Version string (e.g., “0.1.0”)
|
|
1055
|
+
</p>
|
|
1056
|
+
|
|
1057
|
+
<h3 id="apexversionmajor-apexversionminor-apexversionpatch">
|
|
1058
|
+
apex_version_major / apex_version_minor / apex_version_patch
|
|
1059
|
+
</h3>
|
|
1060
|
+
|
|
1061
|
+
<p>
|
|
1062
|
+
Get individual version components.
|
|
1063
|
+
</p>
|
|
1064
|
+
|
|
1065
|
+
<pre><code class="highlight language-c"><span class="kt">int</span> <span class="nf">apex_version_major</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
|
1066
|
+
<span class="kt">int</span> <span class="nf">apex_version_minor</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
|
1067
|
+
<span class="kt">int</span> <span class="nf">apex_version_patch</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
|
1068
|
+
</code></pre>
|
|
1069
|
+
|
|
1070
|
+
<p>
|
|
1071
|
+
<strong> Returns:</strong> Version component as integer
|
|
1072
|
+
</p>
|
|
1073
|
+
|
|
1074
|
+
<h2 id="list-options">
|
|
1075
|
+
List Options
|
|
1076
|
+
</h2>
|
|
1077
|
+
|
|
1078
|
+
<h3 id="mixed-list-markers">
|
|
1079
|
+
Mixed List Markers
|
|
1080
|
+
</h3>
|
|
1081
|
+
|
|
1082
|
+
<p>
|
|
1083
|
+
When <code>allow_mixed_list_markers</code> is enabled, lists with different marker types at the same indentation level will inherit the type from the first item. This is enabled by default in <strong>MultiMarkdown</strong> and <strong>Unified</strong> modes.
|
|
1084
|
+
</p>
|
|
1085
|
+
|
|
1086
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_for_mode</span><span class="p">(</span><span class="n">APEX_MODE_UNIFIED</span><span class="p">);</span>
|
|
1087
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_mixed_list_markers</span> <span class="n">is</span> <span class="nb">true</span> <span class="n">by</span> <span class="k">default</span>
|
|
1088
|
+
|
|
1089
|
+
<span class="n">To</span> <span class="n">enable</span> <span class="n">in</span> <span class="n">other</span> <span class="n">modes</span><span class="o">:</span>
|
|
1090
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_mixed_list_markers</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
1091
|
+
|
|
1092
|
+
<span class="n">To</span> <span class="n">disable</span> <span class="n">in</span> <span class="n">unified</span><span class="o">/</span><span class="n">multimarkdown</span> <span class="n">modes</span><span class="o">:</span>
|
|
1093
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_mixed_list_markers</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
|
|
1094
|
+
</code></pre>
|
|
1095
|
+
|
|
1096
|
+
<p>
|
|
1097
|
+
<strong> Example markdown:</strong>
|
|
1098
|
+
</p>
|
|
1099
|
+
|
|
1100
|
+
<pre><code class="highlight language-markdown"><span class="p">1.</span> First numbered item
|
|
1101
|
+
<span class="p">*</span> Second item (becomes numbered)
|
|
1102
|
+
<span class="p">*</span> Third item (becomes numbered)
|
|
1103
|
+
</code></pre>
|
|
1104
|
+
|
|
1105
|
+
<h3 id="alpha-lists">
|
|
1106
|
+
Alpha Lists
|
|
1107
|
+
</h3>
|
|
1108
|
+
|
|
1109
|
+
<p>
|
|
1110
|
+
When <code>allow_alpha_lists</code> is enabled, alphabetic markers (<code>a.</code>, <code>b.</code>, <code>c.</code> for lower-alpha and <code>A.</code>, <code>B.</code>, <code>C.</code> for upper-alpha) are converted to HTML lists with appropriate <code>list-style-type</code> CSS. This is enabled by default in <strong>Unified</strong> mode only.
|
|
1111
|
+
</p>
|
|
1112
|
+
|
|
1113
|
+
<pre><code class="highlight language-c"><span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_for_mode</span><span class="p">(</span><span class="n">APEX_MODE_UNIFIED</span><span class="p">);</span>
|
|
1114
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_alpha_lists</span> <span class="n">is</span> <span class="nb">true</span> <span class="n">by</span> <span class="k">default</span>
|
|
1115
|
+
|
|
1116
|
+
<span class="n">To</span> <span class="n">enable</span> <span class="n">in</span> <span class="n">other</span> <span class="n">modes</span><span class="o">:</span>
|
|
1117
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_alpha_lists</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
1118
|
+
|
|
1119
|
+
<span class="n">To</span> <span class="n">disable</span> <span class="n">in</span> <span class="n">unified</span> <span class="n">mode</span><span class="o">:</span>
|
|
1120
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">allow_alpha_lists</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
|
|
1121
|
+
</code></pre>
|
|
1122
|
+
|
|
1123
|
+
<p>
|
|
1124
|
+
<strong> Example markdown:</strong>
|
|
1125
|
+
</p>
|
|
1126
|
+
|
|
1127
|
+
<pre><code class="highlight language-markdown">[apex-alpha-list:lower]
|
|
1128
|
+
<span class="p">
|
|
1129
|
+
1.</span> First item
|
|
1130
|
+
<span class="p">2.</span> Second item
|
|
1131
|
+
<span class="p">3.</span> Third item
|
|
1132
|
+
</code></pre>
|
|
1133
|
+
|
|
1134
|
+
<p>
|
|
1135
|
+
This produces HTML with <code>style="list-style-type: lower-alpha"</code> on the <code><ol></code> tag.
|
|
1136
|
+
</p>
|
|
1137
|
+
|
|
1138
|
+
<h2 id="feature-flags">
|
|
1139
|
+
Feature Flags
|
|
1140
|
+
</h2>
|
|
1141
|
+
|
|
1142
|
+
<p>
|
|
1143
|
+
All feature flags control whether specific Markdown extensions are enabled:
|
|
1144
|
+
</p>
|
|
1145
|
+
|
|
1146
|
+
<ul>
|
|
1147
|
+
|
|
1148
|
+
<li>
|
|
1149
|
+
<code>enable_tables</code> - GFM-style tables
|
|
1150
|
+
</li>
|
|
1151
|
+
|
|
1152
|
+
<li>
|
|
1153
|
+
<code>enable_footnotes</code> - Reference and inline footnotes
|
|
1154
|
+
</li>
|
|
1155
|
+
|
|
1156
|
+
<li>
|
|
1157
|
+
<code>enable_definition_lists</code> - Definition lists (term: definition)
|
|
1158
|
+
</li>
|
|
1159
|
+
|
|
1160
|
+
<li>
|
|
1161
|
+
<code>enable_smart_typography</code> - Smart quotes, dashes, ellipsis
|
|
1162
|
+
</li>
|
|
1163
|
+
|
|
1164
|
+
<li>
|
|
1165
|
+
<code>enable_math</code> - LaTeX math (inline <code>$...$</code> and display <code>$$...$$</code>)
|
|
1166
|
+
</li>
|
|
1167
|
+
|
|
1168
|
+
<li>
|
|
1169
|
+
<code>enable_critic_markup</code> - Critic Markup for change tracking
|
|
1170
|
+
</li>
|
|
1171
|
+
|
|
1172
|
+
<li>
|
|
1173
|
+
<code>enable_wiki_links</code> - <code>[[WikiLink]]</code> syntax
|
|
1174
|
+
</li>
|
|
1175
|
+
|
|
1176
|
+
<li>
|
|
1177
|
+
<code>enable_task_lists</code> - GFM task lists (<code>- [ ]</code> and <code>- [x]</code>)
|
|
1178
|
+
</li>
|
|
1179
|
+
|
|
1180
|
+
<li>
|
|
1181
|
+
<code>enable_attributes</code> - Inline Attribute Lists (IAL)
|
|
1182
|
+
</li>
|
|
1183
|
+
|
|
1184
|
+
<li>
|
|
1185
|
+
<code>enable_callouts</code> - Bear/Obsidian-style callouts
|
|
1186
|
+
</li>
|
|
1187
|
+
|
|
1188
|
+
<li>
|
|
1189
|
+
<code>enable_marked_extensions</code> - Marked app extensions (TOC, page breaks, etc.)
|
|
1190
|
+
</li>
|
|
1191
|
+
|
|
1192
|
+
</ul>
|
|
1193
|
+
|
|
1194
|
+
<p>
|
|
1195
|
+
These are typically enabled/disabled based on the selected mode, but can be overridden.
|
|
1196
|
+
</p>
|
|
1197
|
+
|
|
1198
|
+
<h2 id="metadata-options">
|
|
1199
|
+
Metadata Options
|
|
1200
|
+
</h2>
|
|
1201
|
+
|
|
1202
|
+
<ul>
|
|
1203
|
+
|
|
1204
|
+
<li>
|
|
1205
|
+
<code>strip_metadata</code> - Remove metadata from output (default: true)
|
|
1206
|
+
</li>
|
|
1207
|
+
|
|
1208
|
+
<li>
|
|
1209
|
+
<code>enable_metadata_variables</code> - Enable <code>[%key]</code> variable replacement (default: true in MMD/Kramdown/Unified modes)
|
|
1210
|
+
</li>
|
|
1211
|
+
|
|
1212
|
+
</ul>
|
|
1213
|
+
|
|
1214
|
+
<h2 id="file-inclusion">
|
|
1215
|
+
File Inclusion
|
|
1216
|
+
</h2>
|
|
1217
|
+
|
|
1218
|
+
<ul>
|
|
1219
|
+
|
|
1220
|
+
<li>
|
|
1221
|
+
<code>enable_file_includes</code> - Enable file inclusion syntax (``, <code>{{file.md}}</code>, `/file.md`)
|
|
1222
|
+
</li>
|
|
1223
|
+
|
|
1224
|
+
<li>
|
|
1225
|
+
<code>max_include_depth</code> - Maximum nesting depth for includes (default: 10)
|
|
1226
|
+
</li>
|
|
1227
|
+
|
|
1228
|
+
<li>
|
|
1229
|
+
<code>base_directory</code> - Base directory for resolving relative include paths (NULL = current directory)
|
|
1230
|
+
</li>
|
|
1231
|
+
|
|
1232
|
+
</ul>
|
|
1233
|
+
|
|
1234
|
+
<h2 id="output-options">
|
|
1235
|
+
Output Options
|
|
1236
|
+
</h2>
|
|
1237
|
+
|
|
1238
|
+
<ul>
|
|
1239
|
+
|
|
1240
|
+
<li>
|
|
1241
|
+
<code>unsafe</code> - Allow raw HTML in output (default: true)
|
|
1242
|
+
</li>
|
|
1243
|
+
|
|
1244
|
+
<li>
|
|
1245
|
+
<code>validate_utf8</code> - Validate UTF-8 encoding (default: true)
|
|
1246
|
+
</li>
|
|
1247
|
+
|
|
1248
|
+
<li>
|
|
1249
|
+
<code>github_pre_lang</code> - Use GitHub-style code block language format (default: true)
|
|
1250
|
+
</li>
|
|
1251
|
+
|
|
1252
|
+
<li>
|
|
1253
|
+
<code>standalone</code> - Generate complete HTML document with <code><html></code>, <code><head></code>, <code><body></code> (default: false)
|
|
1254
|
+
</li>
|
|
1255
|
+
|
|
1256
|
+
<li>
|
|
1257
|
+
<code>pretty</code> - Pretty-print HTML with indentation (default: false)
|
|
1258
|
+
</li>
|
|
1259
|
+
|
|
1260
|
+
<li>
|
|
1261
|
+
<code>stylesheet_path</code> - Path to CSS file to link in <code><head></code> (requires <code>standalone</code>)
|
|
1262
|
+
</li>
|
|
1263
|
+
|
|
1264
|
+
<li>
|
|
1265
|
+
<code>document_title</code> - Title for HTML document (requires <code>standalone</code>)
|
|
1266
|
+
</li>
|
|
1267
|
+
|
|
1268
|
+
</ul>
|
|
1269
|
+
|
|
1270
|
+
<h2 id="line-break-options">
|
|
1271
|
+
Line Break Options
|
|
1272
|
+
</h2>
|
|
1273
|
+
|
|
1274
|
+
<ul>
|
|
1275
|
+
|
|
1276
|
+
<li>
|
|
1277
|
+
<code>hardbreaks</code> - Treat newlines as hard breaks (<code><br></code>) like GFM (default: false, true in GFM mode)
|
|
1278
|
+
</li>
|
|
1279
|
+
|
|
1280
|
+
<li>
|
|
1281
|
+
<code>nobreaks</code> - Render soft breaks as spaces instead of newlines (default: false)
|
|
1282
|
+
</li>
|
|
1283
|
+
|
|
1284
|
+
</ul>
|
|
1285
|
+
|
|
1286
|
+
<h2 id="header-id-options">
|
|
1287
|
+
Header ID Options
|
|
1288
|
+
</h2>
|
|
1289
|
+
|
|
1290
|
+
<ul>
|
|
1291
|
+
|
|
1292
|
+
<li>
|
|
1293
|
+
<code>generate_header_ids</code> - Automatically generate IDs for headers (default: true)
|
|
1294
|
+
</li>
|
|
1295
|
+
|
|
1296
|
+
<li>
|
|
1297
|
+
<code>header_anchors</code> - Generate <code><a></code> anchor tags instead of <code>id</code> attributes (default: false)
|
|
1298
|
+
</li>
|
|
1299
|
+
|
|
1300
|
+
<li>
|
|
1301
|
+
<code>id_format</code> - ID format: <code>0</code> = GFM (with dashes), <code>1</code> = MMD (no dashes), <code>2</code> = Kramdown
|
|
1302
|
+
</li>
|
|
1303
|
+
|
|
1304
|
+
</ul>
|
|
1305
|
+
|
|
1306
|
+
<h2 id="table-options">
|
|
1307
|
+
Table Options
|
|
1308
|
+
</h2>
|
|
1309
|
+
|
|
1310
|
+
<ul>
|
|
1311
|
+
|
|
1312
|
+
<li>
|
|
1313
|
+
<code>relaxed_tables</code> - Support tables without separator rows (Kramdown-style, default: true in Unified/Kramdown modes)
|
|
1314
|
+
</li>
|
|
1315
|
+
|
|
1316
|
+
</ul>
|
|
1317
|
+
|
|
1318
|
+
<h2 id="complete-example">
|
|
1319
|
+
Complete Example
|
|
1320
|
+
</h2>
|
|
1321
|
+
|
|
1322
|
+
<pre><code class="highlight language-c"><span class="cp">#include</span> <span class="cpf"><apex/apex.h></span><span class="cp">
|
|
1323
|
+
#include</span> <span class="cpf"><stdio.h></span><span class="cp">
|
|
1324
|
+
#include</span> <span class="cpf"><string.h></span><span class="cp">
|
|
1325
|
+
</span>
|
|
1326
|
+
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
|
|
1327
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">markdown</span> <span class="o">=</span>
|
|
1328
|
+
<span class="s">"---</span><span class="se">\n</span><span class="s">"</span>
|
|
1329
|
+
<span class="s">"title: Test Document</span><span class="se">\n</span><span class="s">"</span>
|
|
1330
|
+
<span class="s">"author: John Doe</span><span class="se">\n</span><span class="s">"</span>
|
|
1331
|
+
<span class="s">"---</span><span class="se">\n</span><span class="s">"</span>
|
|
1332
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1333
|
+
<span class="s">"# [%title]</span><span class="se">\n</span><span class="s">"</span>
|
|
1334
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1335
|
+
<span class="s">"By [%author]</span><span class="se">\n</span><span class="s">"</span>
|
|
1336
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1337
|
+
<span class="s">"This has **bold** and a [[WikiLink]].</span><span class="se">\n</span><span class="s">"</span>
|
|
1338
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1339
|
+
<span class="s">"Math: $E = mc^2$</span><span class="se">\n</span><span class="s">"</span>
|
|
1340
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1341
|
+
<span class="s">"1. Mixed markers</span><span class="se">\n</span><span class="s">"</span>
|
|
1342
|
+
<span class="s">"* Second item</span><span class="se">\n</span><span class="s">"</span>
|
|
1343
|
+
<span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
|
1344
|
+
<span class="s">"a. Alpha list</span><span class="se">\n</span><span class="s">"</span>
|
|
1345
|
+
<span class="s">"b. Second alpha</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span>
|
|
1346
|
+
|
|
1347
|
+
<span class="c1">// Use unified mode with all features</span>
|
|
1348
|
+
<span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_for_mode</span><span class="p">(</span><span class="n">APEX_MODE_UNIFIED</span><span class="p">);</span>
|
|
1349
|
+
<span class="c1">// Mixed markers and alpha lists are enabled by default in unified mode</span>
|
|
1350
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">pretty</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
1351
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">standalone</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
|
|
1352
|
+
<span class="n">opts</span><span class="p">.</span><span class="n">document_title</span> <span class="o">=</span> <span class="s">"Test Document"</span><span class="p">;</span>
|
|
1353
|
+
|
|
1354
|
+
<span class="c1">// Convert to HTML</span>
|
|
1355
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">strlen</span><span class="p">(</span><span class="n">markdown</span><span class="p">),</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1356
|
+
|
|
1357
|
+
<span class="k">if</span> <span class="p">(</span><span class="n">html</span><span class="p">)</span> <span class="p">{</span>
|
|
1358
|
+
<span class="n">printf</span><span class="p">(</span><span class="s">"%s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">html</span><span class="p">);</span>
|
|
1359
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1360
|
+
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
|
|
1361
|
+
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
|
1362
|
+
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Conversion failed</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
|
|
1363
|
+
<span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
|
|
1364
|
+
<span class="p">}</span>
|
|
1365
|
+
<span class="p">}</span>
|
|
1366
|
+
</code></pre>
|
|
1367
|
+
|
|
1368
|
+
<h2 id="compiling-and-linking">
|
|
1369
|
+
Compiling and Linking
|
|
1370
|
+
</h2>
|
|
1371
|
+
|
|
1372
|
+
<h3 id="with-cmake">
|
|
1373
|
+
With CMake
|
|
1374
|
+
</h3>
|
|
1375
|
+
|
|
1376
|
+
<pre><code class="highlight language-cmake"><span class="c1"># In your CMakeLists.txt</span>
|
|
1377
|
+
<span class="nb">find_package</span><span class="p">(</span>apex REQUIRED<span class="p">)</span>
|
|
1378
|
+
<span class="nb">target_link_libraries</span><span class="p">(</span>your_app apex<span class="p">)</span>
|
|
1379
|
+
</code></pre>
|
|
1380
|
+
|
|
1381
|
+
<h3 id="manual-compilation">
|
|
1382
|
+
Manual Compilation
|
|
1383
|
+
</h3>
|
|
1384
|
+
|
|
1385
|
+
<pre><code class="highlight language-bash"><span class="c"># Compile</span>
|
|
1386
|
+
gcc <span class="nt">-c</span> <span class="nt">-I</span>/usr/local/include your_app.c
|
|
1387
|
+
|
|
1388
|
+
<span class="c"># Link</span>
|
|
1389
|
+
gcc your_app.o <span class="nt">-L</span>/usr/local/lib <span class="nt">-lapex</span> <span class="nt">-o</span> your_app
|
|
1390
|
+
|
|
1391
|
+
<span class="c"># Run (may need library path)</span>
|
|
1392
|
+
<span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span>/usr/local/lib ./your_app <span class="c"># macOS</span>
|
|
1393
|
+
<span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span>/usr/local/lib ./your_app <span class="c"># Linux</span>
|
|
1394
|
+
</code></pre>
|
|
1395
|
+
|
|
1396
|
+
<h3 id="static-linking">
|
|
1397
|
+
Static Linking
|
|
1398
|
+
</h3>
|
|
1399
|
+
|
|
1400
|
+
<pre><code class="highlight language-bash">gcc your_app.c <span class="nt">-I</span>/usr/local/include <span class="nt">-L</span>/usr/local/lib <span class="nt">-lapex</span> <span class="nt">-static</span> <span class="nt">-o</span> your_app
|
|
1401
|
+
</code></pre>
|
|
1402
|
+
|
|
1403
|
+
<h2 id="thread-safety">
|
|
1404
|
+
Thread Safety
|
|
1405
|
+
</h2>
|
|
1406
|
+
|
|
1407
|
+
<p>
|
|
1408
|
+
Apex is thread-safe as long as:
|
|
1409
|
+
</p>
|
|
1410
|
+
|
|
1411
|
+
<ol>
|
|
1412
|
+
|
|
1413
|
+
<li>
|
|
1414
|
+
Each thread uses its own <code>apex_options</code> structure
|
|
1415
|
+
</li>
|
|
1416
|
+
|
|
1417
|
+
<li>
|
|
1418
|
+
Document nodes are not shared between threads
|
|
1419
|
+
</li>
|
|
1420
|
+
|
|
1421
|
+
<li>
|
|
1422
|
+
The conversion function can be called from multiple threads simultaneously
|
|
1423
|
+
</li>
|
|
1424
|
+
|
|
1425
|
+
</ol>
|
|
1426
|
+
|
|
1427
|
+
<p>
|
|
1428
|
+
<strong> Example:</strong>
|
|
1429
|
+
</p>
|
|
1430
|
+
|
|
1431
|
+
<pre><code class="highlight language-c"> <span class="n">Thread</span><span class="o">-</span><span class="n">safe</span><span class="o">:</span> <span class="n">each</span> <span class="kr">thread</span> <span class="n">has</span> <span class="n">its</span> <span class="n">own</span> <span class="n">options</span>
|
|
1432
|
+
<span class="kt">void</span> <span class="o">*</span><span class="nf">thread_func</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span> <span class="p">{</span>
|
|
1433
|
+
<span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_default</span><span class="p">();</span>
|
|
1434
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1435
|
+
<span class="c1">// Use html...</span>
|
|
1436
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1437
|
+
<span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
|
|
1438
|
+
<span class="p">}</span>
|
|
1439
|
+
</code></pre>
|
|
1440
|
+
|
|
1441
|
+
<h2 id="memory-management">
|
|
1442
|
+
Memory Management
|
|
1443
|
+
</h2>
|
|
1444
|
+
|
|
1445
|
+
<ul>
|
|
1446
|
+
|
|
1447
|
+
<li>
|
|
1448
|
+
All strings returned by Apex must be freed with <code>apex_free_string()</code>
|
|
1449
|
+
</li>
|
|
1450
|
+
|
|
1451
|
+
<li>
|
|
1452
|
+
<code>apex_options</code> structures are typically stack-allocated (no freeing needed)
|
|
1453
|
+
</li>
|
|
1454
|
+
|
|
1455
|
+
<li>
|
|
1456
|
+
Safe to call <code>apex_free_string(NULL)</code>
|
|
1457
|
+
</li>
|
|
1458
|
+
|
|
1459
|
+
<li>
|
|
1460
|
+
Always check return values before use
|
|
1461
|
+
</li>
|
|
1462
|
+
|
|
1463
|
+
</ul>
|
|
1464
|
+
|
|
1465
|
+
<h2 id="error-handling">
|
|
1466
|
+
Error Handling
|
|
1467
|
+
</h2>
|
|
1468
|
+
|
|
1469
|
+
<ul>
|
|
1470
|
+
|
|
1471
|
+
<li>
|
|
1472
|
+
Functions return <code>NULL</code> or empty strings on error
|
|
1473
|
+
</li>
|
|
1474
|
+
|
|
1475
|
+
<li>
|
|
1476
|
+
Check return values before use
|
|
1477
|
+
</li>
|
|
1478
|
+
|
|
1479
|
+
<li>
|
|
1480
|
+
Errors are generally due to:
|
|
1481
|
+
<ul>
|
|
1482
|
+
|
|
1483
|
+
<li>
|
|
1484
|
+
Memory allocation failures
|
|
1485
|
+
</li>
|
|
1486
|
+
|
|
1487
|
+
<li>
|
|
1488
|
+
Invalid input
|
|
1489
|
+
</li>
|
|
1490
|
+
|
|
1491
|
+
<li>
|
|
1492
|
+
Missing dependencies
|
|
1493
|
+
</li>
|
|
1494
|
+
|
|
1495
|
+
</ul>
|
|
1496
|
+
|
|
1497
|
+
</li>
|
|
1498
|
+
|
|
1499
|
+
</ul>
|
|
1500
|
+
|
|
1501
|
+
<p>
|
|
1502
|
+
<strong> Example:</strong>
|
|
1503
|
+
</p>
|
|
1504
|
+
|
|
1505
|
+
<pre><code class="highlight language-c"><span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1506
|
+
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">html</span><span class="p">)</span> <span class="p">{</span>
|
|
1507
|
+
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Conversion failed</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
|
|
1508
|
+
<span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
|
|
1509
|
+
<span class="p">}</span>
|
|
1510
|
+
<span class="n">Use</span> <span class="n">html</span><span class="p">...</span>
|
|
1511
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1512
|
+
</code></pre>
|
|
1513
|
+
|
|
1514
|
+
<h2 id="performance-tips">
|
|
1515
|
+
Performance Tips
|
|
1516
|
+
</h2>
|
|
1517
|
+
|
|
1518
|
+
<ol>
|
|
1519
|
+
|
|
1520
|
+
<li>
|
|
1521
|
+
<strong> Reuse options</strong>: Create <code>apex_options</code> once and reuse for multiple conversions
|
|
1522
|
+
</li>
|
|
1523
|
+
|
|
1524
|
+
<li>
|
|
1525
|
+
<strong> Provide accurate length</strong>: Avoid unnecessary <code>strlen()</code> calls
|
|
1526
|
+
</li>
|
|
1527
|
+
|
|
1528
|
+
<li>
|
|
1529
|
+
<strong> Disable unused features</strong>: Turn off extensions you don’t need
|
|
1530
|
+
</li>
|
|
1531
|
+
|
|
1532
|
+
<li>
|
|
1533
|
+
<strong> Batch processing</strong>: Process multiple documents in parallel (thread-safe)
|
|
1534
|
+
</li>
|
|
1535
|
+
|
|
1536
|
+
</ol>
|
|
1537
|
+
|
|
1538
|
+
<p>
|
|
1539
|
+
<strong> Example:</strong>
|
|
1540
|
+
</p>
|
|
1541
|
+
|
|
1542
|
+
<pre><code class="highlight language-c"> <span class="nl">Good:</span> <span class="n">reuse</span> <span class="n">options</span>
|
|
1543
|
+
<span class="n">apex_options</span> <span class="n">opts</span> <span class="o">=</span> <span class="n">apex_options_default</span><span class="p">();</span>
|
|
1544
|
+
<span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">count</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
|
|
1545
|
+
<span class="kt">char</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="n">apex_markdown_to_html</span><span class="p">(</span><span class="n">docs</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">lens</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1546
|
+
<span class="c1">// Process...</span>
|
|
1547
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1548
|
+
<span class="p">}</span>
|
|
1549
|
+
</code></pre>
|
|
1550
|
+
|
|
1551
|
+
<h2 id="related">
|
|
1552
|
+
Related
|
|
1553
|
+
</h2>
|
|
1554
|
+
|
|
1555
|
+
<ul>
|
|
1556
|
+
|
|
1557
|
+
<li>
|
|
1558
|
+
<a href="Xcode-Integration.html"> Xcode Integration</a> - Using Apex in Xcode projects
|
|
1559
|
+
</li>
|
|
1560
|
+
|
|
1561
|
+
<li>
|
|
1562
|
+
<a href="Modes.html"> Modes</a> - Understanding processor modes
|
|
1563
|
+
</li>
|
|
1564
|
+
|
|
1565
|
+
<li>
|
|
1566
|
+
<a href="Header-IDs.html"> Header IDs</a> - Header ID generation options
|
|
1567
|
+
</li>
|
|
1568
|
+
|
|
1569
|
+
</ul>
|
|
1570
|
+
|
|
1571
|
+
<script>
|
|
1572
|
+
// Hamburger menu functionality
|
|
1573
|
+
(function() {
|
|
1574
|
+
function initHamburgerMenu() {
|
|
1575
|
+
var hamburger = document.getElementById('hamburger-menu');
|
|
1576
|
+
var sidebar = document.querySelector('.main-toc, .sidebar');
|
|
1577
|
+
var overlay = document.getElementById('mobile-menu-overlay');
|
|
1578
|
+
|
|
1579
|
+
if (!hamburger || !sidebar) return;
|
|
1580
|
+
|
|
1581
|
+
function toggleMenu() {
|
|
1582
|
+
var isOpen = sidebar.classList.contains('mobile-open');
|
|
1583
|
+
if (isOpen) {
|
|
1584
|
+
sidebar.classList.remove('mobile-open');
|
|
1585
|
+
hamburger.classList.remove('active');
|
|
1586
|
+
if (overlay) overlay.classList.remove('active');
|
|
1587
|
+
} else {
|
|
1588
|
+
sidebar.classList.add('mobile-open');
|
|
1589
|
+
hamburger.classList.add('active');
|
|
1590
|
+
if (overlay) overlay.classList.add('active');
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
hamburger.addEventListener('click', function(e) {
|
|
1595
|
+
e.stopPropagation();
|
|
1596
|
+
toggleMenu();
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1599
|
+
if (overlay) {
|
|
1600
|
+
overlay.addEventListener('click', function() {
|
|
1601
|
+
toggleMenu();
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
// Close menu when clicking on a sidebar link (mobile only)
|
|
1606
|
+
if (window.innerWidth <= 768) {
|
|
1607
|
+
var sidebarLinks = sidebar.querySelectorAll('a');
|
|
1608
|
+
sidebarLinks.forEach(function(link) {
|
|
1609
|
+
link.addEventListener('click', function() {
|
|
1610
|
+
setTimeout(function() {
|
|
1611
|
+
sidebar.classList.remove('mobile-open');
|
|
1612
|
+
hamburger.classList.remove('active');
|
|
1613
|
+
if (overlay) overlay.classList.remove('active');
|
|
1614
|
+
}, 100);
|
|
1615
|
+
});
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// Close menu on window resize if going to desktop
|
|
1620
|
+
window.addEventListener('resize', function() {
|
|
1621
|
+
if (window.innerWidth > 768) {
|
|
1622
|
+
sidebar.classList.remove('mobile-open');
|
|
1623
|
+
hamburger.classList.remove('active');
|
|
1624
|
+
if (overlay) overlay.classList.remove('active');
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
// Initialize when DOM is ready
|
|
1630
|
+
if (document.readyState === 'loading') {
|
|
1631
|
+
document.addEventListener('DOMContentLoaded', initHamburgerMenu);
|
|
1632
|
+
} else {
|
|
1633
|
+
initHamburgerMenu();
|
|
1634
|
+
}
|
|
1635
|
+
})();
|
|
1636
|
+
|
|
1637
|
+
</script>
|
|
1638
|
+
<script>
|
|
1639
|
+
(function() {
|
|
1640
|
+
// Clone the page TOC for floating TOC
|
|
1641
|
+
function initFloatingTOC() {
|
|
1642
|
+
var pageTOC = document.getElementById('page-toc-top');
|
|
1643
|
+
var floatingTOCContent = document.getElementById('floating-toc-content');
|
|
1644
|
+
var floatingTOC = document.getElementById('floating-toc');
|
|
1645
|
+
|
|
1646
|
+
if (!pageTOC || !floatingTOCContent || !floatingTOC) return;
|
|
1647
|
+
|
|
1648
|
+
// Clone the TOC structure
|
|
1649
|
+
var tocClone = pageTOC.cloneNode(true);
|
|
1650
|
+
tocClone.id = 'floating-toc-clone';
|
|
1651
|
+
floatingTOCContent.appendChild(tocClone);
|
|
1652
|
+
|
|
1653
|
+
// Update all links to use smooth scrolling
|
|
1654
|
+
var allTOCLinks = document.querySelectorAll('.page-toc a, .floating-toc-content a');
|
|
1655
|
+
allTOCLinks.forEach(function(link) {
|
|
1656
|
+
link.addEventListener('click', function(e) {
|
|
1657
|
+
var href = this.getAttribute('href');
|
|
1658
|
+
if (href && href.startsWith('#')) {
|
|
1659
|
+
e.preventDefault();
|
|
1660
|
+
var targetId = href.substring(1);
|
|
1661
|
+
var targetElement = document.getElementById(targetId);
|
|
1662
|
+
if (targetElement) {
|
|
1663
|
+
var offset = 20; // Offset from top
|
|
1664
|
+
|
|
1665
|
+
// Function to calculate absolute position from document top
|
|
1666
|
+
function getAbsoluteTop(element) {
|
|
1667
|
+
var top = 0;
|
|
1668
|
+
while (element) {
|
|
1669
|
+
top += element.offsetTop;
|
|
1670
|
+
element = element.offsetParent;
|
|
1671
|
+
}
|
|
1672
|
+
return top;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
var absoluteTop = getAbsoluteTop(targetElement);
|
|
1676
|
+
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
1677
|
+
var offsetPosition = absoluteTop - offset;
|
|
1678
|
+
|
|
1679
|
+
// Only scroll if we're not already at the target position
|
|
1680
|
+
if (Math.abs(scrollTop - offsetPosition) > 10) {
|
|
1681
|
+
window.scrollTo({
|
|
1682
|
+
top: Math.max(0, offsetPosition),
|
|
1683
|
+
behavior: 'smooth'
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
// Update URL hash without triggering scroll
|
|
1688
|
+
if (history.pushState) {
|
|
1689
|
+
history.pushState(null, null, href);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
});
|
|
1695
|
+
|
|
1696
|
+
// Handle scroll to show/hide floating TOC
|
|
1697
|
+
var tocTop = pageTOC.getBoundingClientRect().top + window.pageYOffset;
|
|
1698
|
+
var tocBottom = tocTop + pageTOC.offsetHeight;
|
|
1699
|
+
|
|
1700
|
+
function updateFloatingTOC() {
|
|
1701
|
+
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
|
|
1702
|
+
|
|
1703
|
+
if (scrollY > tocBottom) {
|
|
1704
|
+
floatingTOC.classList.add('visible');
|
|
1705
|
+
} else {
|
|
1706
|
+
floatingTOC.classList.remove('visible');
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
// Throttle scroll events
|
|
1711
|
+
var ticking = false;
|
|
1712
|
+
window.addEventListener('scroll', function() {
|
|
1713
|
+
if (!ticking) {
|
|
1714
|
+
window.requestAnimationFrame(function() {
|
|
1715
|
+
updateFloatingTOC();
|
|
1716
|
+
ticking = false;
|
|
1717
|
+
});
|
|
1718
|
+
ticking = true;
|
|
1719
|
+
}
|
|
1720
|
+
});
|
|
1721
|
+
|
|
1722
|
+
// Initial check
|
|
1723
|
+
updateFloatingTOC();
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
// Initialize when DOM is ready
|
|
1727
|
+
if (document.readyState === 'loading') {
|
|
1728
|
+
document.addEventListener('DOMContentLoaded', initFloatingTOC);
|
|
1729
|
+
} else {
|
|
1730
|
+
initFloatingTOC();
|
|
1731
|
+
}
|
|
1732
|
+
})();
|
|
1733
|
+
</script>
|
|
1734
|
+
<footer class="page-footer"><p>Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License</p></footer></body>
|
|
1735
|
+
|
|
1736
|
+
</html>
|
|
1737
|
+
|