apex-ruby 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +119 -0
- data/apex-ruby.gemspec +31 -0
- data/ext/apex_ext/apex_ext.c +215 -0
- data/ext/apex_ext/apex_src/BENCHMARK.md +32 -0
- data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +67 -0
- data/ext/apex_ext/apex_src/CHANGELOG.md +2454 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +454 -0
- data/ext/apex_ext/apex_src/Dockerfile.linux-build +15 -0
- data/ext/apex_ext/apex_src/Formula/apex.rb +38 -0
- data/ext/apex_ext/apex_src/Info.plist.in +27 -0
- data/ext/apex_ext/apex_src/LICENSE +21 -0
- data/ext/apex_ext/apex_src/Package.swift +160 -0
- data/ext/apex_ext/apex_src/PackageSupport/README.md +17 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_export.h +20 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_version.h +14 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +4 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/config.h +41 -0
- data/ext/apex_ext/apex_src/README.md +452 -0
- data/ext/apex_ext/apex_src/VERSION +1 -0
- data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
- data/ext/apex_ext/apex_src/apex-plugins.json.example +20 -0
- data/ext/apex_ext/apex_src/apex.pc.in +11 -0
- data/ext/apex_ext/apex_src/cli/main.c +2720 -0
- data/ext/apex_ext/apex_src/debug_test.sh +22 -0
- data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +451 -0
- data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +166 -0
- data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +220 -0
- data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +501 -0
- data/ext/apex_ext/apex_src/docs/DEBUGGING.md +73 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +391 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +237 -0
- data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +456 -0
- data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +210 -0
- data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +344 -0
- data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +144 -0
- data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +278 -0
- data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +321 -0
- data/ext/apex_ext/apex_src/docs/PROGRESS.md +167 -0
- data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +174 -0
- data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +243 -0
- data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +316 -0
- data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +803 -0
- data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +91 -0
- data/ext/apex_ext/apex_src/documentation/README.md +160 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +365 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +24 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +1737 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +1420 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3574 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +1603 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +910 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +1003 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +1308 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +1078 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +1622 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +1698 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +1531 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +1980 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +1368 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +1151 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +2861 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +3981 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +1454 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +1200 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +2066 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +22 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +914 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +399 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +772 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +678 -0
- data/ext/apex_ext/apex_src/documentation/generate_docset.rb +873 -0
- data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +733 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +17073 -0
- data/ext/apex_ext/apex_src/documentation/shared_scripts.js +64 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +646 -0
- data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +260 -0
- data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +119 -0
- data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +11 -0
- data/ext/apex_ext/apex_src/examples/example.html +53 -0
- data/ext/apex_ext/apex_src/examples/example.md +85 -0
- data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +158 -0
- data/ext/apex_ext/apex_src/examples/kbd.md +8 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +250 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +9 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +247 -0
- data/ext/apex_ext/apex_src/include/apex/buffer.h +93 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +16 -0
- data/ext/apex_ext/apex_src/include/apex/parser.h +150 -0
- data/ext/apex_ext/apex_src/include/apex/renderer.h +39 -0
- data/ext/apex_ext/apex_src/man/apex-config.5 +374 -0
- data/ext/apex_ext/apex_src/man/apex-config.5.md +260 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7 +456 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7.md +365 -0
- data/ext/apex_ext/apex_src/man/apex.1 +828 -0
- data/ext/apex_ext/apex_src/man/apex.1.md +643 -0
- data/ext/apex_ext/apex_src/man/apex.1.new +338 -0
- data/ext/apex_ext/apex_src/objc/Apex.swift +237 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +117 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +332 -0
- data/ext/apex_ext/apex_src/src/_README.md +358 -0
- data/ext/apex_ext/apex_src/src/apex.c +6326 -0
- data/ext/apex_ext/apex_src/src/buffer.c +93 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +362 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.h +45 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.c +184 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.h +50 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +1897 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +215 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +53 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.c +2042 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.h +163 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.c +329 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.h +48 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +1670 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.c +710 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.h +38 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji_data.h +942 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.c +925 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.h +43 -0
- data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +869 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1121 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.h +33 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.c +626 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.h +60 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.c +135 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +408 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.c +4084 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.h +145 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.c +1536 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.h +54 -0
- data/ext/apex_ext/apex_src/src/extensions/index.c +967 -0
- data/ext/apex_ext/apex_src/src/extensions/index.h +90 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +205 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.c +332 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.h +13 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.c +248 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.h +18 -0
- data/ext/apex_ext/apex_src/src/extensions/math.c +279 -0
- data/ext/apex_ext/apex_src/src/extensions/math.h +32 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +3046 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.h +125 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +1297 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.h +39 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +194 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.h +29 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +405 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +468 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +44 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +2679 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.c +255 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.h +58 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +2762 -0
- data/ext/apex_ext/apex_src/src/html_renderer.h +126 -0
- data/ext/apex_ext/apex_src/src/parser.c +227 -0
- data/ext/apex_ext/apex_src/src/plugins.c +895 -0
- data/ext/apex_ext/apex_src/src/plugins.h +39 -0
- data/ext/apex_ext/apex_src/src/plugins_env.c +187 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +263 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +358 -0
- data/ext/apex_ext/apex_src/src/renderer.c +241 -0
- data/ext/apex_ext/apex_src/src/utf8.c +56 -0
- data/ext/apex_ext/apex_src/test-linux-build.sh +20 -0
- data/ext/apex_ext/apex_src/test.html +103 -0
- data/ext/apex_ext/apex_src/test_coverage.sh +121 -0
- data/ext/apex_ext/apex_src/test_ial_fenced.md +6 -0
- data/ext/apex_ext/apex_src/test_math_norm.py +79 -0
- data/ext/apex_ext/apex_src/test_pandoc_output.html +48 -0
- data/ext/apex_ext/apex_src/test_spm.sh +107 -0
- data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +50 -0
- data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +229 -0
- data/ext/apex_ext/apex_src/tests/CMakeLists.txt +24 -0
- data/ext/apex_ext/apex_src/tests/README.md +146 -0
- data/ext/apex_ext/apex_src/tests/benchmark.sh +113 -0
- data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +166 -0
- data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +31 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +25 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +24 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +33 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +26 -0
- data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +260 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +6 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +9 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +620 -0
- data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +177 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +74 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +60 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +16 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +1094 -0
- data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +96 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +43 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +53 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +37 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +93 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +38 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +15 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +15 -0
- data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +105 -0
- data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +143 -0
- data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +96 -0
- data/ext/apex_ext/apex_src/tests/gh_api_test.md +6 -0
- data/ext/apex_ext/apex_src/tests/ial_demo.html +186 -0
- data/ext/apex_ext/apex_src/tests/include_code.py +19 -0
- data/ext/apex_ext/apex_src/tests/include_snippet.md +15 -0
- data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +64 -0
- data/ext/apex_ext/apex_src/tests/sample_data.csv +7 -0
- data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +4 -0
- data/ext/apex_ext/apex_src/tests/test_basic.c +74 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +2116 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.c +183 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.h +91 -0
- data/ext/apex_ext/apex_src/tests/test_ial.c +282 -0
- data/ext/apex_ext/apex_src/tests/test_links.c +418 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +265 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +908 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +1118 -0
- data/ext/apex_ext/apex_src/tests/test_plugins.c +219 -0
- data/ext/apex_ext/apex_src/tests/test_refs.bib +31 -0
- data/ext/apex_ext/apex_src/tests/test_runner.c +244 -0
- data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +198 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +862 -0
- data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +9 -0
- data/ext/apex_ext/apex_src/tests/yaml_test.md +13 -0
- data/ext/apex_ext/apex_src/tests.rb +39 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +48 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/COPYING +170 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +74 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +206 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +30 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +111 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +1169 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +21 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +3 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +23 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +18 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +595 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +19 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +1245 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +1495 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +119 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +508 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/cmark-gfm-core-extensions.h +54 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/core-extensions.c +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.c +879 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +92 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.c +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.h +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +917 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.h +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.c +60 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.c +156 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +91 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +110 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +28 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +133 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +78 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +1041 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +1 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +230 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/arena.c +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +1622 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.c +278 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.h +116 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/case_fold_switch.inc +4327 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/chunk.h +135 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm-extension_api.h +737 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm.h +833 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +7 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark.c +55 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.c +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.h +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/commonmark.c +514 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +76 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/entities.inc +2138 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini.h +57 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_href_e.c +100 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_e.c +66 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_u.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.c +502 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.c +1788 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.h +29 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.c +159 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/latex.c +468 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/linked_list.c +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +328 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/man.c +274 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.c +129 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.h +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.c +1045 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.h +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/parser.h +59 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plaintext.c +218 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.c +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.c +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.c +213 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.h +62 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.c +14056 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.h +70 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +365 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.c +317 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/xml.c +182 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +114 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +49 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +58 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +105 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +920 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +194 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +160 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +375 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +50 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +4 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +177 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +10212 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +152 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +41 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +319 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +80 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +6 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +208 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +109 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +160 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Changes +372 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/License +20 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +51 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +46 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +89 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +73 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +222 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +24 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +14 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +1999 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +77 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +32 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +23 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +1393 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +394 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +2358 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +544 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +1416 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +469 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +3598 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +141 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +684 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +27 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +9 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +800 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +1127 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +217 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +202 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +314 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +290 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +327 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +196 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +88 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +354 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +16 -0
- data/ext/apex_ext/extconf.rb +103 -0
- data/lib/apex/configurable.rb +46 -0
- data/lib/apex/document.rb +66 -0
- data/lib/apex/version.rb +15 -0
- data/lib/apex.rb +28 -0
- metadata +544 -0
|
@@ -0,0 +1,2066 @@
|
|
|
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="xcode-integration">
|
|
708
|
+
Xcode Integration
|
|
709
|
+
</h1>
|
|
710
|
+
<nav class="page-toc" id="page-toc-top"><ul><li><a href="#xcode-integration">Xcode Integration</a><ul><li><a href="#production-readiness">Production Readiness</a></li><li><a href="#swift-package-manager-spm-recommended">Swift Package Manager (SPM) - Recommended</a><ul><li><a href="#adding-apex-via-spm">Adding Apex via SPM</a></li><li><a href="#using-apex-in-your-code">Using Apex in Your Code</a></li><li><a href="#platform-support">Platform Support</a></li><li><a href="#spm-benefits">SPM Benefits</a></li></ul></li><li><a href="#framework-build-alternative">Framework Build (Alternative)</a></li><li><a href="#adding-to-xcode-project">Adding to Xcode Project</a><ul><li><a href="#method-1-swift-package-manager-recommended">Method 1: Swift Package Manager (Recommended)</a></li><li><a href="#method-2-framework-reference">Method 2: Framework Reference</a></li><li><a href="#method-3-cmake-integration">Method 3: CMake Integration</a></li></ul></li><li><a href="#objective-c-wrapper">Objective-C Wrapper</a><ul><li><a href="#basic-usage">Basic Usage</a></li><li><a href="#api">API</a></li><li><a href="#convenience-methods">Convenience Methods</a><ul><li><a href="#standalone-html-documents">Standalone HTML Documents</a></li><li><a href="#pretty-printed-html">Pretty-Printed HTML</a></li><li><a href="#dictionary-based-options">Dictionary-Based Options</a></li><li><a href="#swift-friendly-convenience-method">Swift-Friendly Convenience Method</a></li><li><a href="#instance-methods">Instance Methods</a></li></ul></li></ul></li><li><a href="#mode-constants">Mode Constants</a></li><li><a href="#direct-c-api-usage">Direct C API Usage</a></li><li><a href="#integration-example">Integration Example</a><ul><li><a href="#adding-to-marked">Adding to Marked</a></li></ul></li><li><a href="#build-settings">Build Settings</a><ul><li><a href="#header-search-paths">Header Search Paths</a></li><li><a href="#framework-search-paths">Framework Search Paths</a></li><li><a href="#other-linker-flags">Other Linker Flags</a></li><li><a href="#swift-api-support">Swift API Support</a></li></ul></li><li><a href="#swift-integration">Swift Integration</a><ul><li><a href="#idiomatic-swift-api-recommended">Idiomatic Swift API (Recommended)</a></li><li><a href="#apexmode-enum">ApexMode Enum</a></li><li><a href="#apexoptions-struct">ApexOptions Struct</a></li><li><a href="#objective-c-bridge-alternative">Objective-C Bridge (Alternative)</a></li></ul></li><li><a href="#troubleshooting">Troubleshooting</a><ul><li><a href="#swift-package-manager-issues">Swift Package Manager Issues</a></li><li><a href="#framework-not-found">Framework Not Found</a></li><li><a href="#linker-errors">Linker Errors</a></li><li><a href="#runtime-errors">Runtime Errors</a></li></ul></li><li><a href="#performance">Performance</a></li><li><a href="#module-map">Module Map</a></li><li><a href="#comparison-of-integration-methods">Comparison of Integration Methods</a></li><li><a href="#related">Related</a></li></ul></li></ul></nav>
|
|
711
|
+
|
|
712
|
+
<p>
|
|
713
|
+
This guide covers integrating Apex into Xcode projects for macOS and iOS applications.
|
|
714
|
+
</p>
|
|
715
|
+
|
|
716
|
+
<h2 id="production-readiness">
|
|
717
|
+
Production Readiness
|
|
718
|
+
</h2>
|
|
719
|
+
|
|
720
|
+
<p>
|
|
721
|
+
<strong> Important:</strong> Apex is currently in a pre-1.0 development stage. The API and implementation are still evolving, and breaking changes may occur between versions. Apex should only be used for testing and development purposes at this time.
|
|
722
|
+
</p>
|
|
723
|
+
|
|
724
|
+
<p>
|
|
725
|
+
Once Apex reaches version 1.0, the project will follow <a href="https://semver.org/">Semantic Versioning</a>. This means:
|
|
726
|
+
</p>
|
|
727
|
+
|
|
728
|
+
<ul>
|
|
729
|
+
|
|
730
|
+
<li>
|
|
731
|
+
<strong> Major versions</strong> (1.0, 2.0, etc.) may include breaking API changes
|
|
732
|
+
</li>
|
|
733
|
+
|
|
734
|
+
<li>
|
|
735
|
+
<strong> Minor versions</strong> (1.1, 1.2, etc.) will add new features while maintaining backward compatibility
|
|
736
|
+
</li>
|
|
737
|
+
|
|
738
|
+
<li>
|
|
739
|
+
<strong> Patch versions</strong> (1.0.1, 1.0.2, etc.) will only include bug fixes and will maintain full backward compatibility
|
|
740
|
+
</li>
|
|
741
|
+
|
|
742
|
+
</ul>
|
|
743
|
+
|
|
744
|
+
<p>
|
|
745
|
+
For production use, please wait for the stable 1.0 release. Until then, please report any issues or provide feedback to help shape the final API.
|
|
746
|
+
</p>
|
|
747
|
+
|
|
748
|
+
<h2 id="swift-package-manager-spm-recommended">
|
|
749
|
+
Swift Package Manager (SPM) - Recommended
|
|
750
|
+
</h2>
|
|
751
|
+
|
|
752
|
+
<p>
|
|
753
|
+
The easiest way to integrate Apex into your Xcode project is using Swift Package Manager.
|
|
754
|
+
</p>
|
|
755
|
+
|
|
756
|
+
<h3 id="adding-apex-via-spm">
|
|
757
|
+
Adding Apex via SPM
|
|
758
|
+
</h3>
|
|
759
|
+
|
|
760
|
+
<ol>
|
|
761
|
+
|
|
762
|
+
<li>
|
|
763
|
+
In Xcode, select your project in the navigator
|
|
764
|
+
</li>
|
|
765
|
+
|
|
766
|
+
<li>
|
|
767
|
+
Select your target
|
|
768
|
+
</li>
|
|
769
|
+
|
|
770
|
+
<li>
|
|
771
|
+
Go to the “Package Dependencies” tab
|
|
772
|
+
</li>
|
|
773
|
+
|
|
774
|
+
<li>
|
|
775
|
+
Click the “+” button
|
|
776
|
+
</li>
|
|
777
|
+
|
|
778
|
+
<li>
|
|
779
|
+
Enter the repository URL: <code>https://github.com/ApexMarkdown/apex</code>
|
|
780
|
+
</li>
|
|
781
|
+
|
|
782
|
+
<li>
|
|
783
|
+
Select the version or branch you want to use
|
|
784
|
+
</li>
|
|
785
|
+
|
|
786
|
+
<li>
|
|
787
|
+
Click “Add Package”
|
|
788
|
+
</li>
|
|
789
|
+
|
|
790
|
+
<li>
|
|
791
|
+
Select the “Apex” library product
|
|
792
|
+
</li>
|
|
793
|
+
|
|
794
|
+
<li>
|
|
795
|
+
Click “Add Package”
|
|
796
|
+
</li>
|
|
797
|
+
|
|
798
|
+
</ol>
|
|
799
|
+
|
|
800
|
+
<h3 id="using-apex-in-your-code">
|
|
801
|
+
Using Apex in Your Code
|
|
802
|
+
</h3>
|
|
803
|
+
|
|
804
|
+
<p>
|
|
805
|
+
Once added via SPM, simply import and use:
|
|
806
|
+
</p>
|
|
807
|
+
|
|
808
|
+
<pre><code class="highlight language-swift"><span class="kd">import</span> <span class="kt">Apex</span>
|
|
809
|
+
|
|
810
|
+
<span class="kt">Basic</span> <span class="n">usage</span>
|
|
811
|
+
<span class="k">let</span> <span class="nv">markdown</span> <span class="o">=</span> <span class="s">"# Hello World"</span>
|
|
812
|
+
<span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">()</span>
|
|
813
|
+
|
|
814
|
+
<span class="kt">With</span> <span class="n">mode</span>
|
|
815
|
+
<span class="k">let</span> <span class="nv">html2</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">gfm</span><span class="p">)</span>
|
|
816
|
+
|
|
817
|
+
<span class="kt">With</span> <span class="n">options</span>
|
|
818
|
+
<span class="k">var</span> <span class="nv">options</span> <span class="o">=</span> <span class="kt">ApexOptions</span><span class="p">()</span>
|
|
819
|
+
<span class="n">options</span><span class="o">.</span><span class="n">pretty</span> <span class="o">=</span> <span class="kc">true</span>
|
|
820
|
+
<span class="n">options</span><span class="o">.</span><span class="n">generateHeaderIDs</span> <span class="o">=</span> <span class="kc">true</span>
|
|
821
|
+
<span class="k">let</span> <span class="nv">html3</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="n">options</span><span class="p">)</span>
|
|
822
|
+
</code></pre>
|
|
823
|
+
|
|
824
|
+
<h3 id="platform-support">
|
|
825
|
+
Platform Support
|
|
826
|
+
</h3>
|
|
827
|
+
|
|
828
|
+
<ul>
|
|
829
|
+
|
|
830
|
+
<li>
|
|
831
|
+
<strong> macOS</strong>: 10.13+ (High Sierra)
|
|
832
|
+
</li>
|
|
833
|
+
|
|
834
|
+
<li>
|
|
835
|
+
<strong> iOS</strong>: 11.0+
|
|
836
|
+
</li>
|
|
837
|
+
|
|
838
|
+
</ul>
|
|
839
|
+
|
|
840
|
+
<h3 id="spm-benefits">
|
|
841
|
+
SPM Benefits
|
|
842
|
+
</h3>
|
|
843
|
+
|
|
844
|
+
<ul>
|
|
845
|
+
|
|
846
|
+
<li>
|
|
847
|
+
Automatic dependency management
|
|
848
|
+
</li>
|
|
849
|
+
|
|
850
|
+
<li>
|
|
851
|
+
No manual framework embedding
|
|
852
|
+
</li>
|
|
853
|
+
|
|
854
|
+
<li>
|
|
855
|
+
Works with both macOS and iOS
|
|
856
|
+
</li>
|
|
857
|
+
|
|
858
|
+
<li>
|
|
859
|
+
Easy version updates
|
|
860
|
+
</li>
|
|
861
|
+
|
|
862
|
+
<li>
|
|
863
|
+
Integrated with Xcode’s build system
|
|
864
|
+
</li>
|
|
865
|
+
|
|
866
|
+
</ul>
|
|
867
|
+
|
|
868
|
+
<h2 id="framework-build-alternative">
|
|
869
|
+
Framework Build (Alternative)
|
|
870
|
+
</h2>
|
|
871
|
+
|
|
872
|
+
<p>
|
|
873
|
+
Apex can also be built as a framework for manual integration:
|
|
874
|
+
</p>
|
|
875
|
+
|
|
876
|
+
<pre><code class="highlight language-bash"><span class="nb">cd </span>apex
|
|
877
|
+
<span class="nb">mkdir </span>build <span class="o">&&</span> <span class="nb">cd </span>build
|
|
878
|
+
cmake <span class="nt">-DBUILD_FRAMEWORK</span><span class="o">=</span>ON ..
|
|
879
|
+
make
|
|
880
|
+
</code></pre>
|
|
881
|
+
|
|
882
|
+
<p>
|
|
883
|
+
The framework will be at <code>build/Apex.framework</code>.
|
|
884
|
+
</p>
|
|
885
|
+
|
|
886
|
+
<h2 id="adding-to-xcode-project">
|
|
887
|
+
Adding to Xcode Project
|
|
888
|
+
</h2>
|
|
889
|
+
|
|
890
|
+
<h3 id="method-1-swift-package-manager-recommended">
|
|
891
|
+
Method 1: Swift Package Manager (Recommended)
|
|
892
|
+
</h3>
|
|
893
|
+
|
|
894
|
+
<p>
|
|
895
|
+
See the SPM section above for the easiest integration method.
|
|
896
|
+
</p>
|
|
897
|
+
|
|
898
|
+
<h3 id="method-2-framework-reference">
|
|
899
|
+
Method 2: Framework Reference
|
|
900
|
+
</h3>
|
|
901
|
+
|
|
902
|
+
<ol>
|
|
903
|
+
|
|
904
|
+
<li>
|
|
905
|
+
Drag <code>Apex.framework</code> into your Xcode project
|
|
906
|
+
</li>
|
|
907
|
+
|
|
908
|
+
<li>
|
|
909
|
+
Add to “Frameworks, Libraries, and Embedded Content”
|
|
910
|
+
</li>
|
|
911
|
+
|
|
912
|
+
<li>
|
|
913
|
+
Set “Embed & Sign” for the framework
|
|
914
|
+
</li>
|
|
915
|
+
|
|
916
|
+
</ol>
|
|
917
|
+
|
|
918
|
+
<h3 id="method-3-cmake-integration">
|
|
919
|
+
Method 3: CMake Integration
|
|
920
|
+
</h3>
|
|
921
|
+
|
|
922
|
+
<p>
|
|
923
|
+
If your project uses CMake:
|
|
924
|
+
</p>
|
|
925
|
+
|
|
926
|
+
<pre><code class="highlight language-cmake"><span class="nb">add_subdirectory</span><span class="p">(</span>apex<span class="p">)</span>
|
|
927
|
+
<span class="nb">target_link_libraries</span><span class="p">(</span>your_app Apex<span class="p">)</span>
|
|
928
|
+
</code></pre>
|
|
929
|
+
|
|
930
|
+
<h2 id="objective-c-wrapper">
|
|
931
|
+
Objective-C Wrapper
|
|
932
|
+
</h2>
|
|
933
|
+
|
|
934
|
+
<p>
|
|
935
|
+
Apex includes an Objective-C wrapper for easy integration:
|
|
936
|
+
</p>
|
|
937
|
+
|
|
938
|
+
<p>
|
|
939
|
+
<strong> Files:</strong>
|
|
940
|
+
</p>
|
|
941
|
+
|
|
942
|
+
<ul>
|
|
943
|
+
|
|
944
|
+
<li>
|
|
945
|
+
<code>apex/objc/NSString+Apex.h</code>
|
|
946
|
+
</li>
|
|
947
|
+
|
|
948
|
+
<li>
|
|
949
|
+
<code>apex/objc/NSString+Apex.m</code>
|
|
950
|
+
</li>
|
|
951
|
+
|
|
952
|
+
</ul>
|
|
953
|
+
|
|
954
|
+
<h3 id="basic-usage">
|
|
955
|
+
Basic Usage
|
|
956
|
+
</h3>
|
|
957
|
+
|
|
958
|
+
<pre><code class="highlight language-objective-c"><span class="cp">#import "NSString+Apex.h"
|
|
959
|
+
</span>
|
|
960
|
+
<span class="n">Convert</span> <span class="n">with</span> <span class="k">default</span> <span class="n">unified</span> <span class="n">mode</span>
|
|
961
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span><span class="p">];</span>
|
|
962
|
+
|
|
963
|
+
<span class="n">Convert</span> <span class="n">with</span> <span class="n">specific</span> <span class="n">mode</span> <span class="n">using</span> <span class="n">constants</span> <span class="p">(</span><span class="n">recommended</span><span class="p">)</span>
|
|
964
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">gfmHtml</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeGFM</span><span class="p">];</span>
|
|
965
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">mmdHtml</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeMultiMarkdown</span><span class="p">];</span>
|
|
966
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">kramdownHtml</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeKramdown</span><span class="p">];</span>
|
|
967
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">commonmarkHtml</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeCommonmark</span><span class="p">];</span>
|
|
968
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">unifiedHtml</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeUnified</span><span class="p">];</span>
|
|
969
|
+
|
|
970
|
+
<span class="n">String</span> <span class="n">literals</span> <span class="n">also</span> <span class="n">work</span> <span class="p">(</span><span class="k">for</span> <span class="n">backward</span> <span class="n">compatibility</span><span class="p">)</span>
|
|
971
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">gfmHtml2</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="s">@"gfm"</span><span class="p">];</span>
|
|
972
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">mmdHtml2</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdownText</span> <span class="nf">mode</span><span class="p">:</span><span class="s">@"multimarkdown"</span><span class="p">];</span>
|
|
973
|
+
</code></pre>
|
|
974
|
+
|
|
975
|
+
<h3 id="api">
|
|
976
|
+
API
|
|
977
|
+
</h3>
|
|
978
|
+
|
|
979
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Mode</span> <span class="n">constants</span>
|
|
980
|
+
<span class="k">extern</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">ApexModeCommonmark</span><span class="p">;</span>
|
|
981
|
+
<span class="k">extern</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">ApexModeGFM</span><span class="p">;</span>
|
|
982
|
+
<span class="k">extern</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">ApexModeMultiMarkdown</span><span class="p">;</span>
|
|
983
|
+
<span class="k">extern</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">ApexModeKramdown</span><span class="p">;</span>
|
|
984
|
+
<span class="k">extern</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">ApexModeUnified</span><span class="p">;</span>
|
|
985
|
+
|
|
986
|
+
<span class="k">@interface</span> <span class="nc">NSString</span> <span class="p">(</span><span class="nl">Apex</span><span class="p">)</span>
|
|
987
|
+
|
|
988
|
+
<span class="n">Basic</span> <span class="n">conversion</span> <span class="n">methods</span>
|
|
989
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span><span class="p">;</span>
|
|
990
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span> <span class="nf">mode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span><span class="p">;</span>
|
|
991
|
+
|
|
992
|
+
<span class="n">Standalone</span> <span class="n">HTML</span> <span class="n">document</span> <span class="n">generation</span>
|
|
993
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span>
|
|
994
|
+
<span class="nf">mode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span>
|
|
995
|
+
<span class="nf">standalone</span><span class="p">:(</span><span class="n">BOOL</span><span class="p">)</span><span class="nv">standalone</span>
|
|
996
|
+
<span class="nf">stylesheet</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span> <span class="n">_Nullable</span><span class="p">)</span><span class="nv">stylesheetPath</span>
|
|
997
|
+
<span class="nf">title</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span> <span class="n">_Nullable</span><span class="p">)</span><span class="nv">title</span><span class="p">;</span>
|
|
998
|
+
|
|
999
|
+
<span class="n">Pretty</span><span class="k">-</span><span class="n">printed</span> <span class="n">HTML</span> <span class="n">output</span>
|
|
1000
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span>
|
|
1001
|
+
<span class="nf">mode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span>
|
|
1002
|
+
<span class="nf">pretty</span><span class="p">:(</span><span class="n">BOOL</span><span class="p">)</span><span class="nv">pretty</span><span class="p">;</span>
|
|
1003
|
+
|
|
1004
|
+
<span class="n">Dictionary</span><span class="k">-</span><span class="n">based</span> <span class="n">options</span> <span class="n">configuration</span>
|
|
1005
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span>
|
|
1006
|
+
<span class="nf">mode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span>
|
|
1007
|
+
<span class="nf">options</span><span class="p">:(</span><span class="n">NSDictionary</span><span class="o"><</span><span class="n">NSString</span> <span class="o">*</span><span class="p">,</span> <span class="n">id</span><span class="o">></span> <span class="o">*</span> <span class="n">_Nullable</span><span class="p">)</span><span class="nv">options</span><span class="p">;</span>
|
|
1008
|
+
|
|
1009
|
+
<span class="n">Swift</span><span class="k">-</span><span class="n">friendly</span> <span class="n">convenience</span> <span class="n">method</span> <span class="n">with</span> <span class="n">common</span> <span class="n">options</span>
|
|
1010
|
+
<span class="k">+</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertWithApex</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span>
|
|
1011
|
+
<span class="nf">mode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span>
|
|
1012
|
+
<span class="nf">generateHeaderIDs</span><span class="p">:(</span><span class="n">BOOL</span><span class="p">)</span><span class="nv">generateHeaderIDs</span>
|
|
1013
|
+
<span class="nf">hardBreaks</span><span class="p">:(</span><span class="n">BOOL</span><span class="p">)</span><span class="nv">hardBreaks</span>
|
|
1014
|
+
<span class="nf">pretty</span><span class="p">:(</span><span class="n">BOOL</span><span class="p">)</span><span class="nv">pretty</span><span class="p">;</span>
|
|
1015
|
+
|
|
1016
|
+
<span class="n">Instance</span> <span class="n">methods</span> <span class="k">for</span> <span class="n">convenient</span> <span class="n">usage</span>
|
|
1017
|
+
<span class="k">-</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">apexHTML</span><span class="p">;</span>
|
|
1018
|
+
<span class="k">-</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">apexHTMLWithMode</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">mode</span><span class="p">;</span>
|
|
1019
|
+
|
|
1020
|
+
<span class="k">@end</span>
|
|
1021
|
+
</code></pre>
|
|
1022
|
+
|
|
1023
|
+
<p>
|
|
1024
|
+
<strong> Parameters:</strong>
|
|
1025
|
+
</p>
|
|
1026
|
+
|
|
1027
|
+
<ul>
|
|
1028
|
+
|
|
1029
|
+
<li>
|
|
1030
|
+
<code>markdown</code> - Input Markdown text
|
|
1031
|
+
</li>
|
|
1032
|
+
|
|
1033
|
+
<li>
|
|
1034
|
+
<code>mode</code> - Processor mode: Use <code>ApexMode*</code> constants (recommended) or string literals:
|
|
1035
|
+
<ul>
|
|
1036
|
+
|
|
1037
|
+
<li>
|
|
1038
|
+
<code>ApexModeCommonmark</code> or <code>@"commonmark"</code> - Pure CommonMark specification
|
|
1039
|
+
</li>
|
|
1040
|
+
|
|
1041
|
+
<li>
|
|
1042
|
+
<code>ApexModeGFM</code> or <code>@"gfm"</code> - GitHub Flavored Markdown
|
|
1043
|
+
</li>
|
|
1044
|
+
|
|
1045
|
+
<li>
|
|
1046
|
+
<code>ApexModeMultiMarkdown</code> or <code>@"multimarkdown"</code> / <code>@"mmd"</code> - MultiMarkdown compatibility
|
|
1047
|
+
</li>
|
|
1048
|
+
|
|
1049
|
+
<li>
|
|
1050
|
+
<code>ApexModeKramdown</code> or <code>@"kramdown"</code> - Kramdown compatibility
|
|
1051
|
+
</li>
|
|
1052
|
+
|
|
1053
|
+
<li>
|
|
1054
|
+
<code>ApexModeUnified</code> or <code>@"unified"</code> - All features enabled (default)
|
|
1055
|
+
</li>
|
|
1056
|
+
|
|
1057
|
+
</ul>
|
|
1058
|
+
|
|
1059
|
+
</li>
|
|
1060
|
+
|
|
1061
|
+
</ul>
|
|
1062
|
+
|
|
1063
|
+
<p>
|
|
1064
|
+
<strong> Returns:</strong> HTML string (autoreleased)
|
|
1065
|
+
</p>
|
|
1066
|
+
|
|
1067
|
+
<p>
|
|
1068
|
+
<strong> Note:</strong> Using the <code>ApexMode*</code> constants is recommended to avoid typos and provides autocomplete support in Xcode. String literals are still supported for backward compatibility.
|
|
1069
|
+
</p>
|
|
1070
|
+
|
|
1071
|
+
<h3 id="convenience-methods">
|
|
1072
|
+
Convenience Methods
|
|
1073
|
+
</h3>
|
|
1074
|
+
|
|
1075
|
+
<p>
|
|
1076
|
+
Apex provides additional convenience methods for common use cases:
|
|
1077
|
+
</p>
|
|
1078
|
+
|
|
1079
|
+
<h4 id="standalone-html-documents">
|
|
1080
|
+
Standalone HTML Documents
|
|
1081
|
+
</h4>
|
|
1082
|
+
|
|
1083
|
+
<p>
|
|
1084
|
+
Generate complete HTML5 documents with stylesheet and title:
|
|
1085
|
+
</p>
|
|
1086
|
+
|
|
1087
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Generate</span> <span class="n">standalone</span> <span class="n">HTML</span> <span class="n">document</span>
|
|
1088
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span>
|
|
1089
|
+
<span class="nl">mode:</span><span class="n">ApexModeUnified</span>
|
|
1090
|
+
<span class="nl">standalone:</span><span class="nb">YES</span>
|
|
1091
|
+
<span class="nl">stylesheet:</span><span class="s">@"style.css"</span>
|
|
1092
|
+
<span class="nl">title:</span><span class="s">@"My Document"</span><span class="p">];</span>
|
|
1093
|
+
|
|
1094
|
+
<span class="n">Without</span> <span class="n">stylesheet</span> <span class="n">or</span> <span class="n">title</span>
|
|
1095
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html2</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span>
|
|
1096
|
+
<span class="nl">mode:</span><span class="n">ApexModeGFM</span>
|
|
1097
|
+
<span class="nl">standalone:</span><span class="nb">YES</span>
|
|
1098
|
+
<span class="nl">stylesheet:</span><span class="nb">nil</span>
|
|
1099
|
+
<span class="nl">title:</span><span class="nb">nil</span><span class="p">];</span>
|
|
1100
|
+
</code></pre>
|
|
1101
|
+
|
|
1102
|
+
<h4 id="pretty-printed-html">
|
|
1103
|
+
Pretty-Printed HTML
|
|
1104
|
+
</h4>
|
|
1105
|
+
|
|
1106
|
+
<p>
|
|
1107
|
+
Generate formatted HTML with indentation:
|
|
1108
|
+
</p>
|
|
1109
|
+
|
|
1110
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Pretty</span><span class="k">-</span><span class="n">print</span> <span class="n">HTML</span> <span class="n">output</span>
|
|
1111
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span>
|
|
1112
|
+
<span class="nl">mode:</span><span class="n">ApexModeUnified</span>
|
|
1113
|
+
<span class="nl">pretty:</span><span class="nb">YES</span><span class="p">];</span>
|
|
1114
|
+
</code></pre>
|
|
1115
|
+
|
|
1116
|
+
<h4 id="dictionary-based-options">
|
|
1117
|
+
Dictionary-Based Options
|
|
1118
|
+
</h4>
|
|
1119
|
+
|
|
1120
|
+
<p>
|
|
1121
|
+
Configure multiple options at once using a dictionary:
|
|
1122
|
+
</p>
|
|
1123
|
+
|
|
1124
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Configure</span> <span class="n">multiple</span> <span class="n">options</span>
|
|
1125
|
+
<span class="n">NSDictionary</span> <span class="o">*</span><span class="n">options</span> <span class="o">=</span> <span class="p">@{</span>
|
|
1126
|
+
<span class="s">@"pretty"</span><span class="o">:</span> <span class="nb">@YES</span><span class="p">,</span>
|
|
1127
|
+
<span class="s">@"standalone"</span><span class="o">:</span> <span class="nb">@YES</span><span class="p">,</span>
|
|
1128
|
+
<span class="s">@"stylesheet"</span><span class="o">:</span> <span class="s">@"style.css"</span><span class="p">,</span>
|
|
1129
|
+
<span class="s">@"title"</span><span class="o">:</span> <span class="s">@"My Document"</span><span class="p">,</span>
|
|
1130
|
+
<span class="s">@"hardBreaks"</span><span class="o">:</span> <span class="nb">@YES</span><span class="p">,</span>
|
|
1131
|
+
<span class="s">@"generateHeaderIDs"</span><span class="o">:</span> <span class="nb">@YES</span><span class="p">,</span>
|
|
1132
|
+
<span class="s">@"headerAnchors"</span><span class="o">:</span> <span class="nb">@NO</span><span class="p">,</span>
|
|
1133
|
+
<span class="s">@"obfuscateEmails"</span><span class="o">:</span> <span class="nb">@YES</span><span class="p">,</span>
|
|
1134
|
+
<span class="s">@"embedImages"</span><span class="o">:</span> <span class="nb">@NO</span>
|
|
1135
|
+
<span class="p">};</span>
|
|
1136
|
+
|
|
1137
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span>
|
|
1138
|
+
<span class="nl">mode:</span><span class="n">ApexModeUnified</span>
|
|
1139
|
+
<span class="nl">options:</span><span class="n">options</span><span class="p">];</span>
|
|
1140
|
+
</code></pre>
|
|
1141
|
+
|
|
1142
|
+
<p>
|
|
1143
|
+
<strong> Supported dictionary keys:</strong>
|
|
1144
|
+
</p>
|
|
1145
|
+
|
|
1146
|
+
<ul>
|
|
1147
|
+
|
|
1148
|
+
<li>
|
|
1149
|
+
<code>@"pretty"</code> - NSNumber (BOOL): Pretty-print HTML with indentation
|
|
1150
|
+
</li>
|
|
1151
|
+
|
|
1152
|
+
<li>
|
|
1153
|
+
<code>@"standalone"</code> - NSNumber (BOOL): Generate complete HTML5 document
|
|
1154
|
+
</li>
|
|
1155
|
+
|
|
1156
|
+
<li>
|
|
1157
|
+
<code>@"stylesheet"</code> - NSString: Path to CSS file to link in document head
|
|
1158
|
+
</li>
|
|
1159
|
+
|
|
1160
|
+
<li>
|
|
1161
|
+
<code>@"title"</code> - NSString: Document title
|
|
1162
|
+
</li>
|
|
1163
|
+
|
|
1164
|
+
<li>
|
|
1165
|
+
<code>@"hardBreaks"</code> - NSNumber (BOOL): Treat newlines as hard breaks
|
|
1166
|
+
</li>
|
|
1167
|
+
|
|
1168
|
+
<li>
|
|
1169
|
+
<code>@"generateHeaderIDs"</code> - NSNumber (BOOL): Generate IDs for headers
|
|
1170
|
+
</li>
|
|
1171
|
+
|
|
1172
|
+
<li>
|
|
1173
|
+
<code>@"unsafe"</code> - NSNumber (BOOL): Allow raw HTML in output
|
|
1174
|
+
</li>
|
|
1175
|
+
|
|
1176
|
+
<li>
|
|
1177
|
+
<code>@"headerAnchors"</code> - NSNumber (BOOL): Generate anchor tags instead of header IDs
|
|
1178
|
+
</li>
|
|
1179
|
+
|
|
1180
|
+
<li>
|
|
1181
|
+
<code>@"obfuscateEmails"</code> - NSNumber (BOOL): Obfuscate email links using HTML entities
|
|
1182
|
+
</li>
|
|
1183
|
+
|
|
1184
|
+
<li>
|
|
1185
|
+
<code>@"embedImages"</code> - NSNumber (BOOL): Embed local images as base64 data URLs
|
|
1186
|
+
</li>
|
|
1187
|
+
|
|
1188
|
+
</ul>
|
|
1189
|
+
|
|
1190
|
+
<h4 id="swift-friendly-convenience-method">
|
|
1191
|
+
Swift-Friendly Convenience Method
|
|
1192
|
+
</h4>
|
|
1193
|
+
|
|
1194
|
+
<p>
|
|
1195
|
+
Combine common options in a single method call (ideal for Swift):
|
|
1196
|
+
</p>
|
|
1197
|
+
|
|
1198
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Combine</span> <span class="n">common</span> <span class="n">options</span>
|
|
1199
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span>
|
|
1200
|
+
<span class="nl">mode:</span><span class="n">ApexModeUnified</span>
|
|
1201
|
+
<span class="nl">generateHeaderIDs:</span><span class="nb">YES</span>
|
|
1202
|
+
<span class="nl">hardBreaks:</span><span class="nb">YES</span>
|
|
1203
|
+
<span class="nl">pretty:</span><span class="nb">YES</span><span class="p">];</span>
|
|
1204
|
+
</code></pre>
|
|
1205
|
+
|
|
1206
|
+
<h4 id="instance-methods">
|
|
1207
|
+
Instance Methods
|
|
1208
|
+
</h4>
|
|
1209
|
+
|
|
1210
|
+
<p>
|
|
1211
|
+
Use instance methods for more natural, fluent syntax:
|
|
1212
|
+
</p>
|
|
1213
|
+
|
|
1214
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Instance</span> <span class="n">method</span> <span class="n">with</span> <span class="k">default</span> <span class="n">unified</span> <span class="n">mode</span>
|
|
1215
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">markdown</span> <span class="o">=</span> <span class="s">@"# Hello World"</span><span class="p">;</span>
|
|
1216
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">markdown</span> <span class="nf">apexHTML</span><span class="p">];</span>
|
|
1217
|
+
|
|
1218
|
+
<span class="n">Instance</span> <span class="n">method</span> <span class="n">with</span> <span class="n">specific</span> <span class="n">mode</span>
|
|
1219
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html2</span> <span class="o">=</span> <span class="p">[</span><span class="n">markdown</span> <span class="nf">apexHTMLWithMode</span><span class="p">:</span><span class="n">ApexModeGFM</span><span class="p">];</span>
|
|
1220
|
+
</code></pre>
|
|
1221
|
+
|
|
1222
|
+
<h2 id="mode-constants">
|
|
1223
|
+
Mode Constants
|
|
1224
|
+
</h2>
|
|
1225
|
+
|
|
1226
|
+
<p>
|
|
1227
|
+
Apex provides NSString constants for processor modes to avoid ambiguity and typos:
|
|
1228
|
+
</p>
|
|
1229
|
+
|
|
1230
|
+
<pre><code class="highlight language-objective-c"> <span class="n">Available</span> <span class="n">constants</span>
|
|
1231
|
+
<span class="n">ApexModeCommonmark</span> <span class="c1">// @"commonmark"</span>
|
|
1232
|
+
<span class="n">ApexModeGFM</span> <span class="c1">// @"gfm"</span>
|
|
1233
|
+
<span class="n">ApexModeMultiMarkdown</span> <span class="c1">// @"multimarkdown"</span>
|
|
1234
|
+
<span class="n">ApexModeKramdown</span> <span class="c1">// @"kramdown"</span>
|
|
1235
|
+
<span class="n">ApexModeUnified</span> <span class="c1">// @"unified"</span>
|
|
1236
|
+
</code></pre>
|
|
1237
|
+
|
|
1238
|
+
<p>
|
|
1239
|
+
<strong> Benefits:</strong>
|
|
1240
|
+
</p>
|
|
1241
|
+
|
|
1242
|
+
<ul>
|
|
1243
|
+
|
|
1244
|
+
<li>
|
|
1245
|
+
<strong> Type safety</strong>: Xcode autocomplete suggests available modes
|
|
1246
|
+
</li>
|
|
1247
|
+
|
|
1248
|
+
<li>
|
|
1249
|
+
<strong> No typos</strong>: Compile-time checking prevents invalid mode strings
|
|
1250
|
+
</li>
|
|
1251
|
+
|
|
1252
|
+
<li>
|
|
1253
|
+
<strong> Self-documenting</strong>: Constants make code more readable
|
|
1254
|
+
</li>
|
|
1255
|
+
|
|
1256
|
+
<li>
|
|
1257
|
+
<strong> Refactoring</strong>: Easy to find all usages if mode names change
|
|
1258
|
+
</li>
|
|
1259
|
+
|
|
1260
|
+
</ul>
|
|
1261
|
+
|
|
1262
|
+
<p>
|
|
1263
|
+
<strong> Example:</strong>
|
|
1264
|
+
</p>
|
|
1265
|
+
|
|
1266
|
+
<pre><code class="highlight language-objective-c"> <span class="nl">Good:</span> <span class="n">Using</span> <span class="n">constants</span>
|
|
1267
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span> <span class="nf">mode</span><span class="p">:</span><span class="n">ApexModeMultiMarkdown</span><span class="p">];</span>
|
|
1268
|
+
|
|
1269
|
+
<span class="n">Also</span> <span class="n">works</span><span class="o">:</span> <span class="n">String</span> <span class="n">literals</span> <span class="p">(</span><span class="k">for</span> <span class="n">backward</span> <span class="n">compatibility</span><span class="p">)</span>
|
|
1270
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">html2</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">markdown</span> <span class="nf">mode</span><span class="p">:</span><span class="s">@"multimarkdown"</span><span class="p">];</span>
|
|
1271
|
+
</code></pre>
|
|
1272
|
+
|
|
1273
|
+
<h2 id="direct-c-api-usage">
|
|
1274
|
+
Direct C API Usage
|
|
1275
|
+
</h2>
|
|
1276
|
+
|
|
1277
|
+
<p>
|
|
1278
|
+
For more control, use the C API directly:
|
|
1279
|
+
</p>
|
|
1280
|
+
|
|
1281
|
+
<pre><code class="highlight language-objective-c"><span class="cp">#include</span> <span class="cpf"><Apex/apex.h></span><span class="cp">
|
|
1282
|
+
</span>
|
|
1283
|
+
<span class="k">-</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">convertMarkdown</span><span class="p">:(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">markdown</span> <span class="p">{</span>
|
|
1284
|
+
<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>
|
|
1285
|
+
<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>
|
|
1286
|
+
|
|
1287
|
+
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">md</span> <span class="o">=</span> <span class="p">[</span><span class="n">markdown</span> <span class="nf">UTF8String</span><span class="p">];</span>
|
|
1288
|
+
<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">md</span><span class="p">,</span> <span class="n">strlen</span><span class="p">(</span><span class="n">md</span><span class="p">),</span> <span class="o">&</span><span class="n">opts</span><span class="p">);</span>
|
|
1289
|
+
|
|
1290
|
+
<span class="k">if</span> <span class="p">(</span><span class="n">html</span><span class="p">)</span> <span class="p">{</span>
|
|
1291
|
+
<span class="n">NSString</span> <span class="o">*</span><span class="n">result</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">stringWithUTF8String</span><span class="p">:</span><span class="n">html</span><span class="p">];</span>
|
|
1292
|
+
<span class="n">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">);</span>
|
|
1293
|
+
<span class="k">return</span> <span class="n">result</span><span class="p">;</span>
|
|
1294
|
+
<span class="p">}</span>
|
|
1295
|
+
|
|
1296
|
+
<span class="k">return</span> <span class="nb">nil</span><span class="p">;</span>
|
|
1297
|
+
<span class="p">}</span>
|
|
1298
|
+
</code></pre>
|
|
1299
|
+
|
|
1300
|
+
<h2 id="integration-example">
|
|
1301
|
+
Integration Example
|
|
1302
|
+
</h2>
|
|
1303
|
+
|
|
1304
|
+
<h3 id="adding-to-marked">
|
|
1305
|
+
Adding to Marked
|
|
1306
|
+
</h3>
|
|
1307
|
+
|
|
1308
|
+
<p>
|
|
1309
|
+
Here’s how to add Apex support to an existing Marked-style application:
|
|
1310
|
+
</p>
|
|
1311
|
+
|
|
1312
|
+
<p>
|
|
1313
|
+
<strong> 1. Add to processor selection:</strong>
|
|
1314
|
+
</p>
|
|
1315
|
+
|
|
1316
|
+
<pre><code class="highlight language-objective-c"> <span class="n">In</span> <span class="n">MKConductorTransformer</span><span class="p">.</span><span class="n">m</span> <span class="n">or</span> <span class="n">similar</span>
|
|
1317
|
+
<span class="err">}</span> <span class="k">else</span> <span class="nf">if</span> <span class="p">([</span><span class="n">processor</span> <span class="nf">isEqualToString</span><span class="p">:</span><span class="s">@"Apex"</span><span class="p">])</span> <span class="p">{</span>
|
|
1318
|
+
<span class="n">result</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithApex</span><span class="p">:</span><span class="n">text</span><span class="p">];</span>
|
|
1319
|
+
<span class="p">}</span> <span class="k">else</span> <span class="nf">if</span> <span class="p">([</span><span class="n">processor</span> <span class="nf">isEqualToString</span><span class="p">:</span><span class="s">@"MultiMarkdown"</span><span class="p">])</span> <span class="p">{</span>
|
|
1320
|
+
<span class="n">result</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nf">convertWithMultiMarkdown</span><span class="p">:</span><span class="n">text</span><span class="p">];</span>
|
|
1321
|
+
<span class="p">}</span>
|
|
1322
|
+
</code></pre>
|
|
1323
|
+
|
|
1324
|
+
<p>
|
|
1325
|
+
<strong> 2. Add to preferences:</strong>
|
|
1326
|
+
</p>
|
|
1327
|
+
|
|
1328
|
+
<pre><code class="highlight language-objective-c"> <span class="n">In</span> <span class="n">processor</span> <span class="n">dropdown</span>
|
|
1329
|
+
<span class="n">NSArray</span> <span class="o">*</span><span class="n">processors</span> <span class="o">=</span> <span class="p">@[</span>
|
|
1330
|
+
<span class="s">@"MultiMarkdown"</span><span class="p">,</span>
|
|
1331
|
+
<span class="s">@"Discount (GFM)"</span><span class="p">,</span>
|
|
1332
|
+
<span class="s">@"CommonMark"</span><span class="p">,</span>
|
|
1333
|
+
<span class="s">@"Kramdown"</span><span class="p">,</span>
|
|
1334
|
+
<span class="s">@"Apex"</span> <span class="c1">// Add this</span>
|
|
1335
|
+
<span class="p">];</span>
|
|
1336
|
+
</code></pre>
|
|
1337
|
+
|
|
1338
|
+
<p>
|
|
1339
|
+
<strong> 3. Handle custom processor rules:</strong>
|
|
1340
|
+
</p>
|
|
1341
|
+
|
|
1342
|
+
<pre><code class="highlight language-objective-c"> <span class="n">In</span> <span class="n">custom</span> <span class="n">processor</span> <span class="n">handling</span>
|
|
1343
|
+
<span class="err">}</span> <span class="k">else</span> <span class="nf">if</span> <span class="p">([</span><span class="n">outputString</span><span class="p">.</span><span class="n">uppercaseString</span> <span class="nf">isEqualToString</span><span class="p">:</span><span class="s">@"APEX"</span><span class="p">])</span> <span class="p">{</span>
|
|
1344
|
+
<span class="p">[</span><span class="n">defaults</span> <span class="nf">setValue</span><span class="p">:</span><span class="s">@"Apex"</span> <span class="nf">forKey</span><span class="p">:</span><span class="s">@"defaultProcessor"</span><span class="p">];</span>
|
|
1345
|
+
<span class="p">}</span>
|
|
1346
|
+
</code></pre>
|
|
1347
|
+
|
|
1348
|
+
<h2 id="build-settings">
|
|
1349
|
+
Build Settings
|
|
1350
|
+
</h2>
|
|
1351
|
+
|
|
1352
|
+
<h3 id="header-search-paths">
|
|
1353
|
+
Header Search Paths
|
|
1354
|
+
</h3>
|
|
1355
|
+
|
|
1356
|
+
<p>
|
|
1357
|
+
Add to “Header Search Paths”:
|
|
1358
|
+
</p>
|
|
1359
|
+
|
|
1360
|
+
<pre><code class="highlight ">$(SRCROOT)/apex/include
|
|
1361
|
+
</code></pre>
|
|
1362
|
+
|
|
1363
|
+
<h3 id="framework-search-paths">
|
|
1364
|
+
Framework Search Paths
|
|
1365
|
+
</h3>
|
|
1366
|
+
|
|
1367
|
+
<p>
|
|
1368
|
+
Add to “Framework Search Paths”:
|
|
1369
|
+
</p>
|
|
1370
|
+
|
|
1371
|
+
<pre><code class="highlight ">$(SRCROOT)/apex/build
|
|
1372
|
+
</code></pre>
|
|
1373
|
+
|
|
1374
|
+
<h3 id="other-linker-flags">
|
|
1375
|
+
Other Linker Flags
|
|
1376
|
+
</h3>
|
|
1377
|
+
|
|
1378
|
+
<p>
|
|
1379
|
+
If using static library:
|
|
1380
|
+
</p>
|
|
1381
|
+
|
|
1382
|
+
<pre><code class="highlight ">-L$(SRCROOT)/apex/build -lapex
|
|
1383
|
+
</code></pre>
|
|
1384
|
+
|
|
1385
|
+
<h3 id="swift-api-support">
|
|
1386
|
+
Swift API Support
|
|
1387
|
+
</h3>
|
|
1388
|
+
|
|
1389
|
+
<p>
|
|
1390
|
+
To use the idiomatic Swift API (<code>Apex.swift</code>):
|
|
1391
|
+
</p>
|
|
1392
|
+
|
|
1393
|
+
<ol>
|
|
1394
|
+
|
|
1395
|
+
<li>
|
|
1396
|
+
<strong> If using the framework:</strong> The Swift file is automatically included when you link <code>Apex.framework</code>
|
|
1397
|
+
</li>
|
|
1398
|
+
|
|
1399
|
+
<li>
|
|
1400
|
+
<strong> If using source files directly:</strong> Add <code>apex/objc/Apex.swift</code> to your Xcode project
|
|
1401
|
+
</li>
|
|
1402
|
+
|
|
1403
|
+
<li>
|
|
1404
|
+
<strong> Swift/Objective-C Bridging:</strong> Xcode will automatically create a bridging header if needed
|
|
1405
|
+
</li>
|
|
1406
|
+
|
|
1407
|
+
</ol>
|
|
1408
|
+
|
|
1409
|
+
<p>
|
|
1410
|
+
The Swift API provides:
|
|
1411
|
+
</p>
|
|
1412
|
+
|
|
1413
|
+
<ul>
|
|
1414
|
+
|
|
1415
|
+
<li>
|
|
1416
|
+
Type-safe <code>ApexMode</code> enum instead of string constants
|
|
1417
|
+
</li>
|
|
1418
|
+
|
|
1419
|
+
<li>
|
|
1420
|
+
<code>ApexOptions</code> struct for configuration
|
|
1421
|
+
</li>
|
|
1422
|
+
|
|
1423
|
+
<li>
|
|
1424
|
+
Idiomatic String extensions
|
|
1425
|
+
</li>
|
|
1426
|
+
|
|
1427
|
+
<li>
|
|
1428
|
+
Static <code>Apex</code> converter struct
|
|
1429
|
+
</li>
|
|
1430
|
+
|
|
1431
|
+
</ul>
|
|
1432
|
+
|
|
1433
|
+
<h2 id="swift-integration">
|
|
1434
|
+
Swift Integration
|
|
1435
|
+
</h2>
|
|
1436
|
+
|
|
1437
|
+
<p>
|
|
1438
|
+
Apex provides an idiomatic Swift API wrapper (<code>Apex.swift</code>) that offers type-safe enums and structs over the Objective-C API.
|
|
1439
|
+
</p>
|
|
1440
|
+
|
|
1441
|
+
<h3 id="idiomatic-swift-api-recommended">
|
|
1442
|
+
Idiomatic Swift API (Recommended)
|
|
1443
|
+
</h3>
|
|
1444
|
+
|
|
1445
|
+
<pre><code class="highlight language-swift"><span class="kd">import</span> <span class="kt">Foundation</span>
|
|
1446
|
+
<span class="kt">Import</span> <span class="kt">Apex</span><span class="o">.</span><span class="nf">swift</span> <span class="p">(</span><span class="n">automatically</span> <span class="n">available</span> <span class="n">when</span> <span class="n">framework</span> <span class="k">is</span> <span class="n">linked</span><span class="p">)</span>
|
|
1447
|
+
|
|
1448
|
+
<span class="kt">Basic</span> <span class="n">conversion</span> <span class="n">with</span> <span class="k">default</span> <span class="n">unified</span> <span class="n">mode</span>
|
|
1449
|
+
<span class="k">let</span> <span class="nv">markdown</span> <span class="o">=</span> <span class="s">"# Hello World"</span>
|
|
1450
|
+
<span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">()</span>
|
|
1451
|
+
|
|
1452
|
+
<span class="kt">With</span> <span class="n">type</span><span class="o">-</span><span class="n">safe</span> <span class="n">mode</span> <span class="kd">enum</span>
|
|
1453
|
+
<span class="k">let</span> <span class="nv">gfmHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">gfm</span><span class="p">)</span>
|
|
1454
|
+
<span class="k">let</span> <span class="nv">mmdHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">multimarkdown</span><span class="p">)</span>
|
|
1455
|
+
<span class="k">let</span> <span class="nv">kramdownHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">kramdown</span><span class="p">)</span>
|
|
1456
|
+
<span class="k">let</span> <span class="nv">commonmarkHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">commonmark</span><span class="p">)</span>
|
|
1457
|
+
<span class="k">let</span> <span class="nv">unifiedHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">)</span>
|
|
1458
|
+
|
|
1459
|
+
<span class="kt">Using</span> <span class="kt">ApexOptions</span> <span class="nf">struct</span> <span class="p">(</span><span class="n">type</span><span class="o">-</span><span class="n">safe</span><span class="p">)</span>
|
|
1460
|
+
<span class="k">var</span> <span class="nv">options</span> <span class="o">=</span> <span class="kt">ApexOptions</span><span class="p">()</span>
|
|
1461
|
+
<span class="n">options</span><span class="o">.</span><span class="n">pretty</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1462
|
+
<span class="n">options</span><span class="o">.</span><span class="n">standalone</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1463
|
+
<span class="n">options</span><span class="o">.</span><span class="n">stylesheet</span> <span class="o">=</span> <span class="s">"style.css"</span>
|
|
1464
|
+
<span class="n">options</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="s">"My Document"</span>
|
|
1465
|
+
<span class="n">options</span><span class="o">.</span><span class="n">generateHeaderIDs</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1466
|
+
<span class="n">options</span><span class="o">.</span><span class="n">hardBreaks</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1467
|
+
<span class="n">options</span><span class="o">.</span><span class="n">obfuscateEmails</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1468
|
+
|
|
1469
|
+
<span class="k">let</span> <span class="nv">configuredHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="n">options</span><span class="p">)</span>
|
|
1470
|
+
|
|
1471
|
+
<span class="kt">Or</span> <span class="n">use</span> <span class="kd">static</span> <span class="kt">Apex</span> <span class="n">converter</span>
|
|
1472
|
+
<span class="k">let</span> <span class="nv">html2</span> <span class="o">=</span> <span class="kt">Apex</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span><span class="n">markdown</span><span class="p">)</span>
|
|
1473
|
+
<span class="k">let</span> <span class="nv">html3</span> <span class="o">=</span> <span class="kt">Apex</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">gfm</span><span class="p">)</span>
|
|
1474
|
+
<span class="k">let</span> <span class="nv">html4</span> <span class="o">=</span> <span class="kt">Apex</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="n">options</span><span class="p">)</span>
|
|
1475
|
+
|
|
1476
|
+
<span class="kt">Standalone</span> <span class="kt">HTML</span> <span class="n">document</span>
|
|
1477
|
+
<span class="k">let</span> <span class="nv">standaloneHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span>
|
|
1478
|
+
<span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">,</span>
|
|
1479
|
+
<span class="nv">standalone</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
1480
|
+
<span class="nv">stylesheet</span><span class="p">:</span> <span class="s">"style.css"</span><span class="p">,</span>
|
|
1481
|
+
<span class="nv">title</span><span class="p">:</span> <span class="s">"My Document"</span>
|
|
1482
|
+
<span class="p">)</span>
|
|
1483
|
+
|
|
1484
|
+
<span class="kt">Pretty</span><span class="o">-</span><span class="n">printed</span> <span class="kt">HTML</span>
|
|
1485
|
+
<span class="k">let</span> <span class="nv">prettyHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">pretty</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">)</span>
|
|
1486
|
+
|
|
1487
|
+
<span class="kt">Common</span> <span class="n">options</span> <span class="n">combined</span>
|
|
1488
|
+
<span class="k">let</span> <span class="nv">commonOptionsHtml</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span>
|
|
1489
|
+
<span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">unified</span><span class="p">,</span>
|
|
1490
|
+
<span class="nv">generateHeaderIDs</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
1491
|
+
<span class="nv">hardBreaks</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
1492
|
+
<span class="nv">pretty</span><span class="p">:</span> <span class="kc">true</span>
|
|
1493
|
+
<span class="p">)</span>
|
|
1494
|
+
</code></pre>
|
|
1495
|
+
|
|
1496
|
+
<h3 id="apexmode-enum">
|
|
1497
|
+
ApexMode Enum
|
|
1498
|
+
</h3>
|
|
1499
|
+
|
|
1500
|
+
<p>
|
|
1501
|
+
Type-safe processor mode enum:
|
|
1502
|
+
</p>
|
|
1503
|
+
|
|
1504
|
+
<pre><code class="highlight language-swift"><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ApexMode</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="kt">CaseIterable</span> <span class="p">{</span>
|
|
1505
|
+
<span class="k">case</span> <span class="n">commonmark</span>
|
|
1506
|
+
<span class="k">case</span> <span class="n">gfm</span>
|
|
1507
|
+
<span class="k">case</span> <span class="n">multimarkdown</span>
|
|
1508
|
+
<span class="k">case</span> <span class="n">kramdown</span>
|
|
1509
|
+
<span class="k">case</span> <span class="n">unified</span>
|
|
1510
|
+
<span class="p">}</span>
|
|
1511
|
+
</code></pre>
|
|
1512
|
+
|
|
1513
|
+
<h3 id="apexoptions-struct">
|
|
1514
|
+
ApexOptions Struct
|
|
1515
|
+
</h3>
|
|
1516
|
+
|
|
1517
|
+
<p>
|
|
1518
|
+
Type-safe options configuration:
|
|
1519
|
+
</p>
|
|
1520
|
+
|
|
1521
|
+
<pre><code class="highlight language-swift"><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">ApexOptions</span> <span class="p">{</span>
|
|
1522
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">pretty</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1523
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">standalone</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1524
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">stylesheet</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span>
|
|
1525
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">title</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span>
|
|
1526
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">hardBreaks</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1527
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">generateHeaderIDs</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1528
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">unsafe</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1529
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">headerAnchors</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1530
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">obfuscateEmails</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1531
|
+
<span class="kd">public</span> <span class="k">var</span> <span class="nv">embedImages</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span>
|
|
1532
|
+
|
|
1533
|
+
<span class="kd">public</span> <span class="kd">static</span> <span class="kd">let</span> <span class="p">`</span><span class="nv">default</span><span class="p">`</span> <span class="o">=</span> <span class="kt">ApexOptions</span><span class="p">()</span>
|
|
1534
|
+
<span class="p">}</span>
|
|
1535
|
+
</code></pre>
|
|
1536
|
+
|
|
1537
|
+
<p>
|
|
1538
|
+
<strong> Example usage:</strong>
|
|
1539
|
+
</p>
|
|
1540
|
+
|
|
1541
|
+
<pre><code class="highlight language-swift"><span class="k">var</span> <span class="nv">options</span> <span class="o">=</span> <span class="kt">ApexOptions</span><span class="o">.</span><span class="k">default</span>
|
|
1542
|
+
<span class="n">options</span><span class="o">.</span><span class="n">pretty</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1543
|
+
<span class="n">options</span><span class="o">.</span><span class="n">generateHeaderIDs</span> <span class="o">=</span> <span class="kc">true</span>
|
|
1544
|
+
<span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="n">markdown</span><span class="o">.</span><span class="nf">apexHTML</span><span class="p">(</span><span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">gfm</span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="n">options</span><span class="p">)</span>
|
|
1545
|
+
</code></pre>
|
|
1546
|
+
|
|
1547
|
+
<h3 id="objective-c-bridge-alternative">
|
|
1548
|
+
Objective-C Bridge (Alternative)
|
|
1549
|
+
</h3>
|
|
1550
|
+
|
|
1551
|
+
<p>
|
|
1552
|
+
You can also use the Objective-C API directly from Swift:
|
|
1553
|
+
</p>
|
|
1554
|
+
|
|
1555
|
+
<pre><code class="highlight language-swift"><span class="kd">import</span> <span class="kt">Foundation</span>
|
|
1556
|
+
|
|
1557
|
+
<span class="kt">Use</span> <span class="kt">Objective</span><span class="o">-</span><span class="kt">C</span> <span class="n">wrapper</span>
|
|
1558
|
+
<span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="kt">NSString</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span><span class="nv">withApex</span><span class="p">:</span> <span class="n">markdownText</span><span class="p">)</span>
|
|
1559
|
+
|
|
1560
|
+
<span class="kt">With</span> <span class="n">mode</span> <span class="n">constants</span>
|
|
1561
|
+
<span class="k">let</span> <span class="nv">gfmHtml</span> <span class="o">=</span> <span class="kt">NSString</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span><span class="nv">withApex</span><span class="p">:</span> <span class="n">markdownText</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="kt">ApexModeGFM</span><span class="p">)</span>
|
|
1562
|
+
|
|
1563
|
+
<span class="kt">Dictionary</span><span class="o">-</span><span class="n">based</span> <span class="n">options</span>
|
|
1564
|
+
<span class="k">let</span> <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
|
|
1565
|
+
<span class="s">"pretty"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
1566
|
+
<span class="s">"standalone"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
1567
|
+
<span class="s">"stylesheet"</span><span class="p">:</span> <span class="s">"style.css"</span>
|
|
1568
|
+
<span class="p">]</span>
|
|
1569
|
+
<span class="k">let</span> <span class="nv">configuredHtml</span> <span class="o">=</span> <span class="kt">NSString</span><span class="o">.</span><span class="nf">convert</span><span class="p">(</span>
|
|
1570
|
+
<span class="nv">withApex</span><span class="p">:</span> <span class="n">markdownText</span><span class="p">,</span>
|
|
1571
|
+
<span class="nv">mode</span><span class="p">:</span> <span class="kt">ApexModeUnified</span><span class="p">,</span>
|
|
1572
|
+
<span class="nv">options</span><span class="p">:</span> <span class="n">options</span>
|
|
1573
|
+
<span class="p">)</span>
|
|
1574
|
+
</code></pre>
|
|
1575
|
+
|
|
1576
|
+
<p>
|
|
1577
|
+
For direct C API access, create a Swift bridging header:
|
|
1578
|
+
</p>
|
|
1579
|
+
|
|
1580
|
+
<pre><code class="highlight language-swift"> <span class="kt">Bridging</span> <span class="n">header</span>
|
|
1581
|
+
<span class="cp">#import <Apex/apex.h></span>
|
|
1582
|
+
|
|
1583
|
+
<span class="kt">Swift</span> <span class="n">code</span>
|
|
1584
|
+
<span class="kd">func</span> <span class="nf">convertMarkdown</span><span class="p">(</span><span class="n">_</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">String</span><span class="p">?</span> <span class="p">{</span>
|
|
1585
|
+
<span class="k">let</span> <span class="nv">opts</span> <span class="o">=</span> <span class="nf">apex_options_default</span><span class="p">()</span>
|
|
1586
|
+
<span class="k">let</span> <span class="nv">cString</span> <span class="o">=</span> <span class="n">text</span><span class="o">.</span><span class="n">utf8CString</span>
|
|
1587
|
+
<span class="k">guard</span> <span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="nf">apex_markdown_to_html</span><span class="p">(</span><span class="n">cString</span><span class="p">,</span> <span class="n">text</span><span class="o">.</span><span class="n">utf8</span><span class="o">.</span><span class="n">count</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">)</span> <span class="k">else</span> <span class="p">{</span>
|
|
1588
|
+
<span class="k">return</span> <span class="kc">nil</span>
|
|
1589
|
+
<span class="p">}</span>
|
|
1590
|
+
<span class="k">defer</span> <span class="p">{</span> <span class="nf">apex_free_string</span><span class="p">(</span><span class="n">html</span><span class="p">)</span> <span class="p">}</span>
|
|
1591
|
+
<span class="k">return</span> <span class="kt">String</span><span class="p">(</span><span class="nv">cString</span><span class="p">:</span> <span class="n">html</span><span class="p">)</span>
|
|
1592
|
+
<span class="p">}</span>
|
|
1593
|
+
</code></pre>
|
|
1594
|
+
|
|
1595
|
+
<h2 id="troubleshooting">
|
|
1596
|
+
Troubleshooting
|
|
1597
|
+
</h2>
|
|
1598
|
+
|
|
1599
|
+
<h3 id="swift-package-manager-issues">
|
|
1600
|
+
Swift Package Manager Issues
|
|
1601
|
+
</h3>
|
|
1602
|
+
|
|
1603
|
+
<p>
|
|
1604
|
+
<strong> Package Resolution Fails:</strong>
|
|
1605
|
+
</p>
|
|
1606
|
+
|
|
1607
|
+
<ul>
|
|
1608
|
+
|
|
1609
|
+
<li>
|
|
1610
|
+
Ensure you have an active internet connection
|
|
1611
|
+
</li>
|
|
1612
|
+
|
|
1613
|
+
<li>
|
|
1614
|
+
Check that the repository URL is correct: <code>https://github.com/ApexMarkdown/apex</code>
|
|
1615
|
+
</li>
|
|
1616
|
+
|
|
1617
|
+
<li>
|
|
1618
|
+
Try cleaning derived data: <code>File > Packages > Reset Package Caches</code>
|
|
1619
|
+
</li>
|
|
1620
|
+
|
|
1621
|
+
<li>
|
|
1622
|
+
Verify your Xcode version supports the required Swift tools version (5.7+)
|
|
1623
|
+
</li>
|
|
1624
|
+
|
|
1625
|
+
</ul>
|
|
1626
|
+
|
|
1627
|
+
<p>
|
|
1628
|
+
<strong> Build Errors:</strong>
|
|
1629
|
+
</p>
|
|
1630
|
+
|
|
1631
|
+
<ul>
|
|
1632
|
+
|
|
1633
|
+
<li>
|
|
1634
|
+
Ensure your deployment target matches Apex’s requirements (macOS 10.13+, iOS 11+)
|
|
1635
|
+
</li>
|
|
1636
|
+
|
|
1637
|
+
<li>
|
|
1638
|
+
Clean build folder: <code>Product > Clean Build Folder</code> (Shift+Cmd+K)
|
|
1639
|
+
</li>
|
|
1640
|
+
|
|
1641
|
+
<li>
|
|
1642
|
+
Try removing and re-adding the package dependency
|
|
1643
|
+
</li>
|
|
1644
|
+
|
|
1645
|
+
</ul>
|
|
1646
|
+
|
|
1647
|
+
<p>
|
|
1648
|
+
<strong> Module Not Found:</strong>
|
|
1649
|
+
</p>
|
|
1650
|
+
|
|
1651
|
+
<ul>
|
|
1652
|
+
|
|
1653
|
+
<li>
|
|
1654
|
+
Ensure you’ve imported the module: <code>import Apex</code>
|
|
1655
|
+
</li>
|
|
1656
|
+
|
|
1657
|
+
<li>
|
|
1658
|
+
Check that the Apex library product is added to your target’s dependencies
|
|
1659
|
+
</li>
|
|
1660
|
+
|
|
1661
|
+
<li>
|
|
1662
|
+
Verify the package resolved successfully in the Package Dependencies tab
|
|
1663
|
+
</li>
|
|
1664
|
+
|
|
1665
|
+
</ul>
|
|
1666
|
+
|
|
1667
|
+
<h3 id="framework-not-found">
|
|
1668
|
+
Framework Not Found
|
|
1669
|
+
</h3>
|
|
1670
|
+
|
|
1671
|
+
<p>
|
|
1672
|
+
Ensure the framework is:
|
|
1673
|
+
</p>
|
|
1674
|
+
|
|
1675
|
+
<ol>
|
|
1676
|
+
|
|
1677
|
+
<li>
|
|
1678
|
+
Added to “Frameworks, Libraries, and Embedded Content”
|
|
1679
|
+
</li>
|
|
1680
|
+
|
|
1681
|
+
<li>
|
|
1682
|
+
Set to “Embed & Sign”
|
|
1683
|
+
</li>
|
|
1684
|
+
|
|
1685
|
+
<li>
|
|
1686
|
+
Framework search paths are correct
|
|
1687
|
+
</li>
|
|
1688
|
+
|
|
1689
|
+
</ol>
|
|
1690
|
+
|
|
1691
|
+
<h3 id="linker-errors">
|
|
1692
|
+
Linker Errors
|
|
1693
|
+
</h3>
|
|
1694
|
+
|
|
1695
|
+
<ul>
|
|
1696
|
+
|
|
1697
|
+
<li>
|
|
1698
|
+
Ensure <code>Apex.framework</code> is linked (or Apex package is added via SPM)
|
|
1699
|
+
</li>
|
|
1700
|
+
|
|
1701
|
+
<li>
|
|
1702
|
+
Check framework search paths
|
|
1703
|
+
</li>
|
|
1704
|
+
|
|
1705
|
+
<li>
|
|
1706
|
+
Verify architecture matches (arm64 vs x86_64)
|
|
1707
|
+
</li>
|
|
1708
|
+
|
|
1709
|
+
</ul>
|
|
1710
|
+
|
|
1711
|
+
<h3 id="runtime-errors">
|
|
1712
|
+
Runtime Errors
|
|
1713
|
+
</h3>
|
|
1714
|
+
|
|
1715
|
+
<ul>
|
|
1716
|
+
|
|
1717
|
+
<li>
|
|
1718
|
+
Ensure framework is embedded (not just linked) if using framework method
|
|
1719
|
+
</li>
|
|
1720
|
+
|
|
1721
|
+
<li>
|
|
1722
|
+
Check code signing settings
|
|
1723
|
+
</li>
|
|
1724
|
+
|
|
1725
|
+
<li>
|
|
1726
|
+
Verify framework is built for correct deployment target
|
|
1727
|
+
</li>
|
|
1728
|
+
|
|
1729
|
+
<li>
|
|
1730
|
+
For SPM: Ensure the package is properly resolved and built
|
|
1731
|
+
</li>
|
|
1732
|
+
|
|
1733
|
+
</ul>
|
|
1734
|
+
|
|
1735
|
+
<h2 id="performance">
|
|
1736
|
+
Performance
|
|
1737
|
+
</h2>
|
|
1738
|
+
|
|
1739
|
+
<p>
|
|
1740
|
+
Apex is built on cmark-gfm, which is highly optimized:
|
|
1741
|
+
</p>
|
|
1742
|
+
|
|
1743
|
+
<ul>
|
|
1744
|
+
|
|
1745
|
+
<li>
|
|
1746
|
+
Small documents (< 10KB): < 10ms
|
|
1747
|
+
</li>
|
|
1748
|
+
|
|
1749
|
+
<li>
|
|
1750
|
+
Medium documents (< 100KB): < 100ms
|
|
1751
|
+
</li>
|
|
1752
|
+
|
|
1753
|
+
<li>
|
|
1754
|
+
Large documents (< 1MB): < 1s
|
|
1755
|
+
</li>
|
|
1756
|
+
|
|
1757
|
+
</ul>
|
|
1758
|
+
|
|
1759
|
+
<p>
|
|
1760
|
+
The Objective-C wrapper adds minimal overhead.
|
|
1761
|
+
</p>
|
|
1762
|
+
|
|
1763
|
+
<h2 id="module-map">
|
|
1764
|
+
Module Map
|
|
1765
|
+
</h2>
|
|
1766
|
+
|
|
1767
|
+
<p>
|
|
1768
|
+
Apex includes a module map (<code>include/apex/module.modulemap</code>) that allows Swift to import the C API directly:
|
|
1769
|
+
</p>
|
|
1770
|
+
|
|
1771
|
+
<pre><code class="highlight language-swift"><span class="kd">import</span> <span class="kt">Apex</span>
|
|
1772
|
+
|
|
1773
|
+
<span class="kt">Direct</span> <span class="kt">C</span> <span class="kt">API</span> <span class="nf">access</span> <span class="p">(</span><span class="n">advanced</span> <span class="n">usage</span><span class="p">)</span>
|
|
1774
|
+
<span class="k">let</span> <span class="nv">opts</span> <span class="o">=</span> <span class="nf">apex_options_default</span><span class="p">()</span>
|
|
1775
|
+
<span class="o">...</span> <span class="n">configure</span> <span class="n">options</span> <span class="o">...</span>
|
|
1776
|
+
<span class="k">let</span> <span class="nv">html</span> <span class="o">=</span> <span class="nf">apex_markdown_to_html</span><span class="p">(</span><span class="n">markdown</span><span class="p">,</span> <span class="n">markdown</span><span class="o">.</span><span class="n">count</span><span class="p">,</span> <span class="o">&</span><span class="n">opts</span><span class="p">)</span>
|
|
1777
|
+
</code></pre>
|
|
1778
|
+
|
|
1779
|
+
<p>
|
|
1780
|
+
The module map is automatically included when using SPM or the framework.
|
|
1781
|
+
</p>
|
|
1782
|
+
|
|
1783
|
+
<h2 id="comparison-of-integration-methods">
|
|
1784
|
+
Comparison of Integration Methods
|
|
1785
|
+
</h2>
|
|
1786
|
+
|
|
1787
|
+
<table>
|
|
1788
|
+
|
|
1789
|
+
<thead>
|
|
1790
|
+
|
|
1791
|
+
<tr>
|
|
1792
|
+
|
|
1793
|
+
<th>
|
|
1794
|
+
Method
|
|
1795
|
+
</th>
|
|
1796
|
+
|
|
1797
|
+
<th>
|
|
1798
|
+
Ease of Use
|
|
1799
|
+
</th>
|
|
1800
|
+
|
|
1801
|
+
<th>
|
|
1802
|
+
Platform Support
|
|
1803
|
+
</th>
|
|
1804
|
+
|
|
1805
|
+
<th>
|
|
1806
|
+
Maintenance
|
|
1807
|
+
</th>
|
|
1808
|
+
|
|
1809
|
+
</tr>
|
|
1810
|
+
|
|
1811
|
+
</thead>
|
|
1812
|
+
|
|
1813
|
+
<tbody>
|
|
1814
|
+
|
|
1815
|
+
<tr>
|
|
1816
|
+
|
|
1817
|
+
<td>
|
|
1818
|
+
<strong> Swift Package Manager</strong>
|
|
1819
|
+
</td>
|
|
1820
|
+
|
|
1821
|
+
<td>
|
|
1822
|
+
⭐⭐⭐⭐⭐
|
|
1823
|
+
</td>
|
|
1824
|
+
|
|
1825
|
+
<td>
|
|
1826
|
+
macOS + iOS
|
|
1827
|
+
</td>
|
|
1828
|
+
|
|
1829
|
+
<td>
|
|
1830
|
+
Automatic updates
|
|
1831
|
+
</td>
|
|
1832
|
+
|
|
1833
|
+
</tr>
|
|
1834
|
+
<tr>
|
|
1835
|
+
|
|
1836
|
+
<td>
|
|
1837
|
+
Framework
|
|
1838
|
+
</td>
|
|
1839
|
+
|
|
1840
|
+
<td>
|
|
1841
|
+
⭐⭐⭐
|
|
1842
|
+
</td>
|
|
1843
|
+
|
|
1844
|
+
<td>
|
|
1845
|
+
macOS only
|
|
1846
|
+
</td>
|
|
1847
|
+
|
|
1848
|
+
<td>
|
|
1849
|
+
Manual updates
|
|
1850
|
+
</td>
|
|
1851
|
+
|
|
1852
|
+
</tr>
|
|
1853
|
+
<tr>
|
|
1854
|
+
|
|
1855
|
+
<td>
|
|
1856
|
+
CMake
|
|
1857
|
+
</td>
|
|
1858
|
+
|
|
1859
|
+
<td>
|
|
1860
|
+
⭐⭐
|
|
1861
|
+
</td>
|
|
1862
|
+
|
|
1863
|
+
<td>
|
|
1864
|
+
macOS + Linux
|
|
1865
|
+
</td>
|
|
1866
|
+
|
|
1867
|
+
<td>
|
|
1868
|
+
Manual integration
|
|
1869
|
+
</td>
|
|
1870
|
+
|
|
1871
|
+
</tr>
|
|
1872
|
+
</tbody>
|
|
1873
|
+
|
|
1874
|
+
</table>
|
|
1875
|
+
|
|
1876
|
+
<p>
|
|
1877
|
+
<strong> Recommendation:</strong> Use Swift Package Manager for the easiest integration and best cross-platform support.
|
|
1878
|
+
</p>
|
|
1879
|
+
|
|
1880
|
+
<h2 id="related">
|
|
1881
|
+
Related
|
|
1882
|
+
</h2>
|
|
1883
|
+
|
|
1884
|
+
<ul>
|
|
1885
|
+
|
|
1886
|
+
<li>
|
|
1887
|
+
<a href="C-API.html"> C API</a> - Direct C API documentation
|
|
1888
|
+
</li>
|
|
1889
|
+
|
|
1890
|
+
<li>
|
|
1891
|
+
<a href="Usage.html"> Usage</a> - Basic usage examples
|
|
1892
|
+
</li>
|
|
1893
|
+
|
|
1894
|
+
<li>
|
|
1895
|
+
<a href="Modes.html"> Modes</a> - Processor mode details
|
|
1896
|
+
</li>
|
|
1897
|
+
|
|
1898
|
+
</ul>
|
|
1899
|
+
|
|
1900
|
+
<script>
|
|
1901
|
+
// Hamburger menu functionality
|
|
1902
|
+
(function() {
|
|
1903
|
+
function initHamburgerMenu() {
|
|
1904
|
+
var hamburger = document.getElementById('hamburger-menu');
|
|
1905
|
+
var sidebar = document.querySelector('.main-toc, .sidebar');
|
|
1906
|
+
var overlay = document.getElementById('mobile-menu-overlay');
|
|
1907
|
+
|
|
1908
|
+
if (!hamburger || !sidebar) return;
|
|
1909
|
+
|
|
1910
|
+
function toggleMenu() {
|
|
1911
|
+
var isOpen = sidebar.classList.contains('mobile-open');
|
|
1912
|
+
if (isOpen) {
|
|
1913
|
+
sidebar.classList.remove('mobile-open');
|
|
1914
|
+
hamburger.classList.remove('active');
|
|
1915
|
+
if (overlay) overlay.classList.remove('active');
|
|
1916
|
+
} else {
|
|
1917
|
+
sidebar.classList.add('mobile-open');
|
|
1918
|
+
hamburger.classList.add('active');
|
|
1919
|
+
if (overlay) overlay.classList.add('active');
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
hamburger.addEventListener('click', function(e) {
|
|
1924
|
+
e.stopPropagation();
|
|
1925
|
+
toggleMenu();
|
|
1926
|
+
});
|
|
1927
|
+
|
|
1928
|
+
if (overlay) {
|
|
1929
|
+
overlay.addEventListener('click', function() {
|
|
1930
|
+
toggleMenu();
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
// Close menu when clicking on a sidebar link (mobile only)
|
|
1935
|
+
if (window.innerWidth <= 768) {
|
|
1936
|
+
var sidebarLinks = sidebar.querySelectorAll('a');
|
|
1937
|
+
sidebarLinks.forEach(function(link) {
|
|
1938
|
+
link.addEventListener('click', function() {
|
|
1939
|
+
setTimeout(function() {
|
|
1940
|
+
sidebar.classList.remove('mobile-open');
|
|
1941
|
+
hamburger.classList.remove('active');
|
|
1942
|
+
if (overlay) overlay.classList.remove('active');
|
|
1943
|
+
}, 100);
|
|
1944
|
+
});
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
// Close menu on window resize if going to desktop
|
|
1949
|
+
window.addEventListener('resize', function() {
|
|
1950
|
+
if (window.innerWidth > 768) {
|
|
1951
|
+
sidebar.classList.remove('mobile-open');
|
|
1952
|
+
hamburger.classList.remove('active');
|
|
1953
|
+
if (overlay) overlay.classList.remove('active');
|
|
1954
|
+
}
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
// Initialize when DOM is ready
|
|
1959
|
+
if (document.readyState === 'loading') {
|
|
1960
|
+
document.addEventListener('DOMContentLoaded', initHamburgerMenu);
|
|
1961
|
+
} else {
|
|
1962
|
+
initHamburgerMenu();
|
|
1963
|
+
}
|
|
1964
|
+
})();
|
|
1965
|
+
|
|
1966
|
+
</script>
|
|
1967
|
+
<script>
|
|
1968
|
+
(function() {
|
|
1969
|
+
// Clone the page TOC for floating TOC
|
|
1970
|
+
function initFloatingTOC() {
|
|
1971
|
+
var pageTOC = document.getElementById('page-toc-top');
|
|
1972
|
+
var floatingTOCContent = document.getElementById('floating-toc-content');
|
|
1973
|
+
var floatingTOC = document.getElementById('floating-toc');
|
|
1974
|
+
|
|
1975
|
+
if (!pageTOC || !floatingTOCContent || !floatingTOC) return;
|
|
1976
|
+
|
|
1977
|
+
// Clone the TOC structure
|
|
1978
|
+
var tocClone = pageTOC.cloneNode(true);
|
|
1979
|
+
tocClone.id = 'floating-toc-clone';
|
|
1980
|
+
floatingTOCContent.appendChild(tocClone);
|
|
1981
|
+
|
|
1982
|
+
// Update all links to use smooth scrolling
|
|
1983
|
+
var allTOCLinks = document.querySelectorAll('.page-toc a, .floating-toc-content a');
|
|
1984
|
+
allTOCLinks.forEach(function(link) {
|
|
1985
|
+
link.addEventListener('click', function(e) {
|
|
1986
|
+
var href = this.getAttribute('href');
|
|
1987
|
+
if (href && href.startsWith('#')) {
|
|
1988
|
+
e.preventDefault();
|
|
1989
|
+
var targetId = href.substring(1);
|
|
1990
|
+
var targetElement = document.getElementById(targetId);
|
|
1991
|
+
if (targetElement) {
|
|
1992
|
+
var offset = 20; // Offset from top
|
|
1993
|
+
|
|
1994
|
+
// Function to calculate absolute position from document top
|
|
1995
|
+
function getAbsoluteTop(element) {
|
|
1996
|
+
var top = 0;
|
|
1997
|
+
while (element) {
|
|
1998
|
+
top += element.offsetTop;
|
|
1999
|
+
element = element.offsetParent;
|
|
2000
|
+
}
|
|
2001
|
+
return top;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
var absoluteTop = getAbsoluteTop(targetElement);
|
|
2005
|
+
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
2006
|
+
var offsetPosition = absoluteTop - offset;
|
|
2007
|
+
|
|
2008
|
+
// Only scroll if we're not already at the target position
|
|
2009
|
+
if (Math.abs(scrollTop - offsetPosition) > 10) {
|
|
2010
|
+
window.scrollTo({
|
|
2011
|
+
top: Math.max(0, offsetPosition),
|
|
2012
|
+
behavior: 'smooth'
|
|
2013
|
+
});
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
// Update URL hash without triggering scroll
|
|
2017
|
+
if (history.pushState) {
|
|
2018
|
+
history.pushState(null, null, href);
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
});
|
|
2023
|
+
});
|
|
2024
|
+
|
|
2025
|
+
// Handle scroll to show/hide floating TOC
|
|
2026
|
+
var tocTop = pageTOC.getBoundingClientRect().top + window.pageYOffset;
|
|
2027
|
+
var tocBottom = tocTop + pageTOC.offsetHeight;
|
|
2028
|
+
|
|
2029
|
+
function updateFloatingTOC() {
|
|
2030
|
+
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
|
|
2031
|
+
|
|
2032
|
+
if (scrollY > tocBottom) {
|
|
2033
|
+
floatingTOC.classList.add('visible');
|
|
2034
|
+
} else {
|
|
2035
|
+
floatingTOC.classList.remove('visible');
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
// Throttle scroll events
|
|
2040
|
+
var ticking = false;
|
|
2041
|
+
window.addEventListener('scroll', function() {
|
|
2042
|
+
if (!ticking) {
|
|
2043
|
+
window.requestAnimationFrame(function() {
|
|
2044
|
+
updateFloatingTOC();
|
|
2045
|
+
ticking = false;
|
|
2046
|
+
});
|
|
2047
|
+
ticking = true;
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
2050
|
+
|
|
2051
|
+
// Initial check
|
|
2052
|
+
updateFloatingTOC();
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
// Initialize when DOM is ready
|
|
2056
|
+
if (document.readyState === 'loading') {
|
|
2057
|
+
document.addEventListener('DOMContentLoaded', initFloatingTOC);
|
|
2058
|
+
} else {
|
|
2059
|
+
initFloatingTOC();
|
|
2060
|
+
}
|
|
2061
|
+
})();
|
|
2062
|
+
</script>
|
|
2063
|
+
<footer class="page-footer"><p>Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License</p></footer></body>
|
|
2064
|
+
|
|
2065
|
+
</html>
|
|
2066
|
+
|