apex-ruby 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/ext/apex_ext/apex_ext.c +260 -91
- data/ext/apex_ext/apex_src/CHANGELOG.md +440 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +15 -1
- data/ext/apex_ext/apex_src/Formula/apex.rb +7 -2
- data/ext/apex_ext/apex_src/Package.swift +15 -4
- data/ext/apex_ext/apex_src/README.md +94 -35
- data/ext/apex_ext/apex_src/VERSION +1 -1
- data/ext/apex_ext/apex_src/apex-debug.log +4 -0
- data/ext/apex_ext/apex_src/apex.code-workspace +38 -0
- data/ext/apex_ext/apex_src/apex.taskpaper +12 -0
- data/ext/apex_ext/apex_src/apex_deflist_debug.log +25 -0
- data/ext/apex_ext/apex_src/buildnotes.md +1435 -0
- data/ext/apex_ext/apex_src/cli/main.c +262 -33
- data/ext/apex_ext/apex_src/debug.log +7 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +274 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +749 -0
- data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +744 -0
- data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +382 -0
- data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +351 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +745 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +829 -0
- data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +1148 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +161 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +184 -0
- data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +211 -0
- data/ext/apex_ext/apex_src/documentation/app-settings-table.md +67 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +340 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +11 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +234 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +516 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +461 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +193 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +201 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +678 -0
- data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +1367 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +6 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +774 -300
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +1194 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +416 -216
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3544 -1094
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +371 -97
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +153 -23
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +358 -124
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +1656 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +1226 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +201 -56
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +279 -109
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +200 -53
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +2327 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +690 -271
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +201 -55
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +238 -68
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +421 -221
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +340 -78
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +251 -86
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +1362 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +277 -90
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +673 -346
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +1405 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +1902 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +1939 -1698
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +1781 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +315 -140
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +307 -113
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +1132 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +1754 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +872 -376
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +8746 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +20 -15
- data/ext/apex_ext/apex_src/documentation/transform_for_app.md +55 -0
- data/ext/apex_ext/apex_src/escaping-repro.md +103 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +8 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +547 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
- data/ext/apex_ext/apex_src/examples/quick-actions/README.md +33 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +92 -6
- data/ext/apex_ext/apex_src/include/apex/ast_rtf.h +23 -0
- data/ext/apex_ext/apex_src/include/apex/ast_terminal.h +6 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +5 -0
- data/ext/apex_ext/apex_src/include/apex/plugins.h +105 -0
- data/ext/apex_ext/apex_src/include/apexc.h +1 -0
- data/ext/apex_ext/apex_src/man/apex.1 +82 -78
- data/ext/apex_ext/apex_src/man/apex.1.md +81 -4
- data/ext/apex_ext/apex_src/objc/Apex.swift +73 -0
- data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +79 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +83 -5
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +244 -1
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +76 -0
- data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +169 -0
- data/ext/apex_ext/apex_src/output.html +87 -0
- data/ext/apex_ext/apex_src/plans/quarto-mode.md +442 -0
- data/ext/apex_ext/apex_src/src/_README.md +85 -32
- data/ext/apex_ext/apex_src/src/apex.c +770 -200
- data/ext/apex_ext/apex_src/src/ast_rtf.c +848 -0
- data/ext/apex_ext/apex_src/src/ast_terminal.c +184 -7
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +10 -3
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +7 -11
- data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.c +467 -0
- data/ext/apex_ext/apex_src/src/extensions/bear_image_attrs.h +27 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +400 -4
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +15 -5
- data/ext/apex_ext/apex_src/src/extensions/citations.c +26 -5
- data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.c +632 -0
- data/ext/apex_ext/apex_src/src/extensions/code_fence_attrs.h +22 -0
- data/ext/apex_ext/apex_src/src/extensions/concordance.c +632 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +129 -15
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1050 -121
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +569 -16
- data/ext/apex_ext/apex_src/src/extensions/ial.c +502 -52
- data/ext/apex_ext/apex_src/src/extensions/ial.h +2 -1
- data/ext/apex_ext/apex_src/src/extensions/includes.c +532 -33
- data/ext/apex_ext/apex_src/src/extensions/includes.h +7 -1
- data/ext/apex_ext/apex_src/src/extensions/index.c +1427 -140
- data/ext/apex_ext/apex_src/src/extensions/index.h +28 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +200 -161
- data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.c +251 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_diagrams.h +22 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_lists.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_lists.h +35 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_polish.c +264 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_polish.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.c +307 -0
- data/ext/apex_ext/apex_src/src/extensions/quarto_shortcodes.h +21 -0
- data/ext/apex_ext/apex_src/src/extensions/raw_content.c +351 -0
- data/ext/apex_ext/apex_src/src/extensions/raw_content.h +20 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +117 -3
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +53 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +23 -1
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +83 -92
- data/ext/apex_ext/apex_src/src/extensions/toc.c +446 -25
- data/ext/apex_ext/apex_src/src/extensions/toc.h +26 -1
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +28 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +387 -17
- data/ext/apex_ext/apex_src/src/plugin_catalog.c +517 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +88 -14
- data/ext/apex_ext/apex_src/src/plugins_remote.h +34 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +6 -1
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +21 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +10 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +19 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +46 -0
- data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +47 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +19 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +81 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +47 -0
- data/ext/apex_ext/apex_src/tests/fixtures/speed.md +192 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +37 -0
- data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +16 -0
- data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +301 -0
- data/ext/apex_ext/apex_src/tests/test_concordance.tsv +4 -0
- data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +82 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +821 -1
- data/ext/apex_ext/apex_src/tests/test_ial.c +7 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +25 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +129 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +568 -2
- data/ext/apex_ext/apex_src/tests/test_runner.c +11 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +420 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +1 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +77 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +135 -5
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +56 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +1 -1
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +69 -0
- data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +74 -0
- data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +22 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +44 -0
- data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +128 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +5118 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +99 -0
- data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +452 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +52 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +55 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +2455 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +171 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +55 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +220 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +43 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +7 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +76 -0
- data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +10 -0
- data/ext/apex_ext/extconf.rb +35 -0
- data/lib/apex/version.rb +2 -2
- metadata +117 -2
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
## Multi-file documents with Apex
|
|
2
|
+
|
|
3
|
+
Apex can assemble larger documents from many smaller Markdown files. There are two primary tools for this:
|
|
4
|
+
|
|
5
|
+
- **Combine**: Apex's native Markdown combiner, with optional GitBook-style `SUMMARY.md` support.
|
|
6
|
+
- **MMD Merge**: A MultiMarkdown-compatible mode that reads a plain-text index file to stitch documents together.
|
|
7
|
+
|
|
8
|
+
Both modes output **raw Markdown**, which Apex then processes into full HTML.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Using Combine
|
|
13
|
+
|
|
14
|
+
### Basic usage with multiple files
|
|
15
|
+
|
|
16
|
+
You can combine multiple Markdown files. Apex will:
|
|
17
|
+
|
|
18
|
+
- Read each file in order
|
|
19
|
+
- Expand any include syntax it supports (Marked, MultiMarkdown, iA Writer)
|
|
20
|
+
- Separate each document with blank lines
|
|
21
|
+
|
|
22
|
+
To combine files in Marked, select multiple files and enable **Settings->Processor->Combine Files**. The app will automatically process them in order.
|
|
23
|
+
|
|
24
|
+
### Using a GitBook-style `SUMMARY.md`
|
|
25
|
+
|
|
26
|
+
When one of the files is named `SUMMARY.md`, Apex treats it as a **GitBook index**. It scans the file for Markdown links and combines the referenced pages in order:
|
|
27
|
+
|
|
28
|
+
Example `SUMMARY.md`:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
# My Book
|
|
32
|
+
|
|
33
|
+
- [Introduction](intro.md)
|
|
34
|
+
- [Getting Started](getting-started.md)
|
|
35
|
+
- [Advanced Topics](advanced.md)
|
|
36
|
+
- [Performance](performance.md)
|
|
37
|
+
- [Appendix](appendix.md)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
When you open `SUMMARY.md` in Marked with combine mode enabled, Apex will:
|
|
41
|
+
|
|
42
|
+
- Follow the link targets (`intro.md`, `getting-started.md`, etc.)
|
|
43
|
+
- Expand any file includes inside those documents
|
|
44
|
+
- Process everything into a single document
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Using MMD Merge (MultiMarkdown-style)
|
|
49
|
+
|
|
50
|
+
MMD Merge emulates the original MultiMarkdown `mmd_merge.pl` script. It reads one or more **plain text index files** and:
|
|
51
|
+
|
|
52
|
+
- Skips blank lines
|
|
53
|
+
- Treats lines whose first non-whitespace character is `#` as **comments**
|
|
54
|
+
- Treats all other lines as filenames to include
|
|
55
|
+
- Uses **indentation** (tabs or groups of four spaces) to increase the header level of the included file
|
|
56
|
+
|
|
57
|
+
**Important:** MMD merge documents must start with a `#merge` line to be automatically detected by Marked.
|
|
58
|
+
|
|
59
|
+
### Example mmd_merge index file
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
#merge
|
|
63
|
+
metadata.txt
|
|
64
|
+
Chapter-1.md
|
|
65
|
+
sub-chapter-1-1.md
|
|
66
|
+
sub-chapter-1-2.md
|
|
67
|
+
Chapter-2.md
|
|
68
|
+
sub-chapter-2-1.md
|
|
69
|
+
sub-chapter-2-2.md
|
|
70
|
+
FAQ.md
|
|
71
|
+
Acknowledgments.md
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Behavior:
|
|
75
|
+
|
|
76
|
+
- `metadata.txt`, `Chapter-1.md`, `Chapter-2.md`, `FAQ.md`, `Acknowledgments.md` are included at their original heading levels.
|
|
77
|
+
- Files indented by **one tab or four spaces** (`sub-chapter-1-1.md`, `sub-chapter-1-2.md`, etc.) have all headings shifted **down one level**:
|
|
78
|
+
- `# Heading` → `## Heading`
|
|
79
|
+
- `## Subheading` → `### Subheading`, etc.
|
|
80
|
+
|
|
81
|
+
Comments are supported:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
#merge
|
|
85
|
+
# This is my book index
|
|
86
|
+
metadata.txt
|
|
87
|
+
|
|
88
|
+
# Part 1
|
|
89
|
+
Chapter-1.md
|
|
90
|
+
sub-chapter-1-1.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Lines starting with `#` after optional whitespace are ignored (except for the required `#merge` line at the start).
|
|
94
|
+
|
|
95
|
+
When you open an MMD merge index file in Marked, the app will automatically detect the `#merge` line and process the file accordingly. You can also enable **Settings->Processor->MMD Merge** to force this mode.
|
|
96
|
+
|
|
97
|
+
Notes:
|
|
98
|
+
|
|
99
|
+
- MMD Merge does **not** itself expand includes; it just concatenates files and shifts headings.
|
|
100
|
+
- For full MultiMarkdown semantics, set the processor mode to MultiMarkdown in **Settings->Processor->Mode**.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Combining multiple files directly
|
|
105
|
+
|
|
106
|
+
You don't need an index file to combine documents. With combine mode enabled, you can select multiple files and Marked will process them in order.
|
|
107
|
+
|
|
108
|
+
This approach works well when:
|
|
109
|
+
|
|
110
|
+
- The order is simple and fixed
|
|
111
|
+
- You don't need header-level shifting based on indentation
|
|
112
|
+
|
|
113
|
+
If you need finer control over header levels, use:
|
|
114
|
+
|
|
115
|
+
- MMD Merge with an index file (indentation-based)
|
|
116
|
+
- Or explicit headings inside your individual files
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Building multi-file documents with include syntax
|
|
121
|
+
|
|
122
|
+
In addition to combine and MMD merge modes, Apex supports **file includes** inside Markdown. This lets you treat one file as the "root" and pull in other files at specific points.
|
|
123
|
+
|
|
124
|
+
Supported include syntaxes:
|
|
125
|
+
|
|
126
|
+
- **MultiMarkdown**: `{{file.md}}`
|
|
127
|
+
- **Marked**: `<<[file.md]` (Markdown include), `<<(file.ext)` (code include), `<<{file.html}` (raw HTML)
|
|
128
|
+
- **iA Writer**: `/file.md` at the start of a line
|
|
129
|
+
|
|
130
|
+
### MultiMarkdown include example
|
|
131
|
+
|
|
132
|
+
`book.md`:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
Title: My Included Book
|
|
136
|
+
|
|
137
|
+
{{metadata.md}}
|
|
138
|
+
|
|
139
|
+
{{intro.md}}
|
|
140
|
+
{{chapter1.md}}
|
|
141
|
+
{{chapter2.md}}
|
|
142
|
+
{{appendix.md}}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
When you open `book.md` in Marked, Apex will automatically expand all the includes.
|
|
146
|
+
|
|
147
|
+
### Marked-style include example
|
|
148
|
+
|
|
149
|
+
`book.md`:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
# My Marked-Style Book
|
|
153
|
+
|
|
154
|
+
<<[intro.md]
|
|
155
|
+
<<[chapter1.md]
|
|
156
|
+
<<[chapter2.md]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Marked will process these includes automatically.
|
|
160
|
+
|
|
161
|
+
### iA Writer-style include example
|
|
162
|
+
|
|
163
|
+
`book.md`:
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
# My iA Writer-Style Book
|
|
167
|
+
|
|
168
|
+
/intro.md
|
|
169
|
+
/chapter1.md
|
|
170
|
+
/chapter2.md
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Marked will process these includes automatically.
|
|
174
|
+
|
|
175
|
+
### Combining includes with combine mode
|
|
176
|
+
|
|
177
|
+
You can combine both approaches: use includes inside files and then use combine mode on top. This is especially useful when:
|
|
178
|
+
|
|
179
|
+
- Each part has its own local includes
|
|
180
|
+
- You want a single final HTML output
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Choosing between Combine, MMD Merge, and includes
|
|
185
|
+
|
|
186
|
+
- **Use Combine** when:
|
|
187
|
+
- You want Apex to expand includes
|
|
188
|
+
- You like GitBook-style `SUMMARY.md` navigation
|
|
189
|
+
- You just want to pass multiple files and let Apex concatenate them
|
|
190
|
+
|
|
191
|
+
- **Use MMD Merge** when:
|
|
192
|
+
- You have existing MultiMarkdown workflows or `mmd_merge.pl` index files
|
|
193
|
+
- You want indentation-based header level shifting
|
|
194
|
+
- You want a very simple, text-only index format
|
|
195
|
+
- Remember: files must start with `#merge` to be auto-detected
|
|
196
|
+
|
|
197
|
+
- **Use include syntax** when:
|
|
198
|
+
- You want one "master" document that controls where content appears
|
|
199
|
+
- You prefer to keep structure inside Markdown files rather than an external index
|
|
200
|
+
|
|
201
|
+
All three can be mixed and matched, and all ultimately produce **Markdown** that Apex processes into HTML, PDF (via Pandoc), or other formats in your toolchain.
|