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,516 @@
|
|
|
1
|
+
# Inline Attribute Lists (IALs) and Attribute List Definitions (ALDs)
|
|
2
|
+
|
|
3
|
+
Inline Attribute Lists (IALs) allow you to add HTML attributes (IDs, classes, and custom key-value pairs) to Markdown elements. Attribute List Definitions (ALDs) let you define reusable attribute sets that can be referenced multiple times.
|
|
4
|
+
|
|
5
|
+
This feature is available in **Kramdown** and **unified** modes.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
IALs use the syntax `{: attributes}` (Kramdown-style) or `{#id .class}` (Pandoc-style) and can be applied to:
|
|
10
|
+
- **Block-level elements**: Headings, paragraphs, lists, blockquotes, code blocks, tables
|
|
11
|
+
- **Span-level elements**: Links, images, emphasis (italic), strong (bold), code spans
|
|
12
|
+
|
|
13
|
+
Apex supports both formats:
|
|
14
|
+
- **Kramdown-style**: `{: #id .class key="value"}` - requires a colon after the opening brace
|
|
15
|
+
- **Pandoc-style**: `{#id .class key="value"}` - no colon required
|
|
16
|
+
|
|
17
|
+
Both formats work identically. For example, `{#my-id .my-class}` is equivalent to `{:#my-id .my-class}`.
|
|
18
|
+
|
|
19
|
+
ALDs define reusable attribute sets with the syntax `{:ref-name: attributes}` and can be referenced in IALs using `{:ref-name}`.
|
|
20
|
+
|
|
21
|
+
## Block-Level IALs
|
|
22
|
+
|
|
23
|
+
For block-level elements, IALs appear on a separate line immediately after the element (no blank line).
|
|
24
|
+
|
|
25
|
+
### Paragraphs
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
This is a paragraph with an ID and classes.
|
|
29
|
+
{: #para-id .important .note}
|
|
30
|
+
|
|
31
|
+
This is a paragraph using Pandoc-style IAL.
|
|
32
|
+
{#para-id-2 .important .note}
|
|
33
|
+
|
|
34
|
+
Another paragraph with custom attributes.
|
|
35
|
+
{: title="Important Note" lang="en"}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Output:
|
|
39
|
+
```html
|
|
40
|
+
<p id="para-id" class="important note">This is a paragraph with an ID and classes.</p>
|
|
41
|
+
<p id="para-id-2" class="important note">This is a paragraph using Pandoc-style IAL.</p>
|
|
42
|
+
<p title="Important Note" lang="en">Another paragraph with custom attributes.</p>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Headings
|
|
46
|
+
|
|
47
|
+
Headings can have IALs on the same line or the next line:
|
|
48
|
+
|
|
49
|
+
**Same line:**
|
|
50
|
+
```markdown
|
|
51
|
+
# Heading {: #custom-id}
|
|
52
|
+
## Another Heading {: .highlight .large}
|
|
53
|
+
## Pandoc-style Heading {#pandoc-id .highlight}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Next line:**
|
|
57
|
+
```markdown
|
|
58
|
+
# Heading
|
|
59
|
+
{: #custom-id .highlight}
|
|
60
|
+
|
|
61
|
+
# Pandoc-style Heading
|
|
62
|
+
{#pandoc-id-2 .highlight}
|
|
63
|
+
|
|
64
|
+
## Another Heading
|
|
65
|
+
{: .section-title lang="en"}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Output:
|
|
69
|
+
```html
|
|
70
|
+
<h1 id="custom-id">Heading</h1>
|
|
71
|
+
<h2 class="highlight large">Another Heading</h2>
|
|
72
|
+
<h2 id="pandoc-id" class="highlight">Pandoc-style Heading</h2>
|
|
73
|
+
<h1 id="custom-id" class="highlight">Heading</h1>
|
|
74
|
+
<h1 id="pandoc-id-2" class="highlight">Pandoc-style Heading</h1>
|
|
75
|
+
<h2 class="section-title" lang="en">Another Heading</h2>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Lists
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
- Item 1
|
|
82
|
+
- Item 2
|
|
83
|
+
- Item 3
|
|
84
|
+
{: .unordered-list .compact}
|
|
85
|
+
|
|
86
|
+
1. First
|
|
87
|
+
2. Second
|
|
88
|
+
3. Third
|
|
89
|
+
{: #ordered-list .numbered}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Output:
|
|
93
|
+
```html
|
|
94
|
+
<ul class="unordered-list compact">
|
|
95
|
+
<li>Item 1</li>
|
|
96
|
+
<li>Item 2</li>
|
|
97
|
+
<li>Item 3</li>
|
|
98
|
+
</ul>
|
|
99
|
+
<ol id="ordered-list" class="numbered">
|
|
100
|
+
<li>First</li>
|
|
101
|
+
<li>Second</li>
|
|
102
|
+
<li>Third</li>
|
|
103
|
+
</ol>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Blockquotes
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
> This is a quote.
|
|
110
|
+
{: .quote .inspirational}
|
|
111
|
+
|
|
112
|
+
> Another quote with attribution.
|
|
113
|
+
{: cite="https://example.com"}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Output:
|
|
117
|
+
```html
|
|
118
|
+
<blockquote class="quote inspirational">
|
|
119
|
+
<p>This is a quote.</p>
|
|
120
|
+
</blockquote>
|
|
121
|
+
<blockquote cite="https://example.com">
|
|
122
|
+
<p>Another quote with attribution.</p>
|
|
123
|
+
</blockquote>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Tables
|
|
127
|
+
|
|
128
|
+
Tables can have IALs applied on a separate line after the table:
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
| Key | Value |
|
|
132
|
+
| --- | :---: |
|
|
133
|
+
| one | 1 |
|
|
134
|
+
| two | 2 |
|
|
135
|
+
{: #data-table .striped .bordered}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Output:
|
|
139
|
+
```html
|
|
140
|
+
<table id="data-table" class="striped bordered">
|
|
141
|
+
<!-- table content -->
|
|
142
|
+
</table>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Pandoc table_attributes extension:**
|
|
146
|
+
|
|
147
|
+
Apex also supports Pandoc's `table_attributes` extension, which allows IAL attributes to be specified in table captions. When using Pandoc-style captions with the `: Caption` syntax, IAL attributes in the caption are extracted and applied to the table:
|
|
148
|
+
|
|
149
|
+
```markdown
|
|
150
|
+
| Key | Value |
|
|
151
|
+
| --- | :---: |
|
|
152
|
+
| one | 1 |
|
|
153
|
+
| two | 2 |
|
|
154
|
+
|
|
155
|
+
: Key value table {#table-id .testing key="value"}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This is equivalent to:
|
|
159
|
+
|
|
160
|
+
```markdown
|
|
161
|
+
| Key | Value |
|
|
162
|
+
| --- | :---: |
|
|
163
|
+
| one | 1 |
|
|
164
|
+
| two | 2 |
|
|
165
|
+
{: #table-id .testing key="value"}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Both Kramdown-style IALs (`{: #id .class}`) and Pandoc-style IALs without the colon (`{#id .class}`) are supported in table captions.
|
|
169
|
+
|
|
170
|
+
**Note:** The `: Caption` syntax only works when adjacent to a table to avoid conflicts with definition list syntax. See [Syntax](Syntax) for more details on table captions.
|
|
171
|
+
|
|
172
|
+
## Inline IALs
|
|
173
|
+
|
|
174
|
+
Inline IALs appear immediately after the element they apply to, within the same paragraph.
|
|
175
|
+
|
|
176
|
+
### Links
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
This is a [regular link](https://example.com) without attributes.
|
|
180
|
+
|
|
181
|
+
Here's a [styled link](https://example.com){:.button} with a button class.
|
|
182
|
+
|
|
183
|
+
Here's a [Pandoc-style link](https://example.com){#link-id .button} with attributes.
|
|
184
|
+
|
|
185
|
+
You can have [multiple links](https://example.com){:.link-primary} with [different classes](https://example.com){:.link-secondary} in the same paragraph.
|
|
186
|
+
|
|
187
|
+
A link with [custom attributes](https://example.com){:rel="nofollow" title="External Link"}.
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Output:
|
|
191
|
+
```html
|
|
192
|
+
<p>This is a <a href="https://example.com">regular link</a> without attributes.</p>
|
|
193
|
+
<p>Here's a <a href="https://example.com" class="button">styled link</a> with a button class.</p>
|
|
194
|
+
<p>Here's a <a href="https://example.com" id="link-id" class="button">Pandoc-style link</a> with attributes.</p>
|
|
195
|
+
<p>You can have <a href="https://example.com" class="link-primary">multiple links</a> with <a href="https://example.com" class="link-secondary">different classes</a> in the same paragraph.</p>
|
|
196
|
+
<p>A link with <a href="https://example.com" rel="nofollow" title="External Link">custom attributes</a>.</p>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Images
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+

|
|
203
|
+
|
|
204
|
+
{:.logo .centered}
|
|
205
|
+
|
|
206
|
+
{:#site-icon .icon}
|
|
207
|
+
|
|
208
|
+
{:title="Photo Title" alt="Photo description"}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Output:
|
|
212
|
+
```html
|
|
213
|
+
<p><img src="image.png" alt="Regular image" /></p>
|
|
214
|
+
<p><img src="logo.png" alt="Styled image" class="logo centered" /></p>
|
|
215
|
+
<p><img src="icon.png" alt="Image with ID" id="site-icon" class="icon" /></p>
|
|
216
|
+
<p><img src="photo.jpg" alt="Image with title" title="Photo Title" alt="Photo description" /></p>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Emphasis and Strong
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
This paragraph has **bold text**{:.bold-style} with a custom class and *italic text*{:.italic-style} with another class.
|
|
223
|
+
|
|
224
|
+
You can combine **bold**{:.bold} and *italic*{:.italic} in the same paragraph with different styles.
|
|
225
|
+
|
|
226
|
+
Nested **bold with *italic*{:.nested-italic} inside**{:.bold-wrapper} works too.
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Output:
|
|
230
|
+
```html
|
|
231
|
+
<p>This paragraph has <strong class="bold-style">bold text</strong> with a custom class and <em class="italic-style">italic text</em> with another class.</p>
|
|
232
|
+
<p>You can combine <strong class="bold">bold</strong> and <em class="italic">italic</em> in the same paragraph with different styles.</p>
|
|
233
|
+
<p>Nested <strong class="bold-wrapper">bold with <em class="nested-italic">italic</em> inside</strong> works too.</p>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Code Spans
|
|
237
|
+
|
|
238
|
+
```markdown
|
|
239
|
+
Use `inline code`{:.code-inline} for code snippets with styling.
|
|
240
|
+
|
|
241
|
+
You can have multiple `code spans`{:.code-1} and `more code`{:.code-2} with different classes.
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Output:
|
|
245
|
+
```html
|
|
246
|
+
<p>Use <code class="code-inline">inline code</code> for code snippets with styling.</p>
|
|
247
|
+
<p>You can have multiple <code class="code-1">code spans</code> and <code class="code-2">more code</code> with different classes.</p>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Attribute Syntax
|
|
251
|
+
|
|
252
|
+
IALs support three types of attributes:
|
|
253
|
+
|
|
254
|
+
### 1. IDs
|
|
255
|
+
|
|
256
|
+
Use `#` followed by the ID name:
|
|
257
|
+
|
|
258
|
+
```markdown
|
|
259
|
+
# Heading {: #section-1}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Output: `<h1 id="section-1">Heading</h1>`
|
|
263
|
+
|
|
264
|
+
### 2. Classes
|
|
265
|
+
|
|
266
|
+
Use `.` followed by the class name. Multiple classes can be specified:
|
|
267
|
+
|
|
268
|
+
```markdown
|
|
269
|
+
Paragraph.
|
|
270
|
+
{: .important .note .highlight}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Output: `<p class="important note highlight">Paragraph.</p>`
|
|
274
|
+
|
|
275
|
+
**Note:** Multiple `.class` specifiers are equivalent to a single `class` attribute with space-separated values.
|
|
276
|
+
|
|
277
|
+
### 3. Key-Value Pairs
|
|
278
|
+
|
|
279
|
+
Use `key="value"` or `key='value'` for custom attributes. Values can be quoted (single or double quotes) or unquoted:
|
|
280
|
+
|
|
281
|
+
```markdown
|
|
282
|
+
Paragraph.
|
|
283
|
+
{: title="Important Note" lang="en" data-id="123"}
|
|
284
|
+
|
|
285
|
+
Link with attributes.
|
|
286
|
+
[Click here](url){:rel="nofollow" target="_blank"}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Output:
|
|
290
|
+
```html
|
|
291
|
+
<p title="Important Note" lang="en" data-id="123">Paragraph.</p>
|
|
292
|
+
<p>Link with attributes.
|
|
293
|
+
<a href="url" rel="nofollow" target="_blank">Click here</a></p>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Quoted values:** Use quotes when values contain spaces or special characters:
|
|
297
|
+
```markdown
|
|
298
|
+
{: title="This is a title with spaces" lang="en-US"}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Unquoted values:** Simple values without spaces can be unquoted:
|
|
302
|
+
```markdown
|
|
303
|
+
{: lang=en data-visible=true}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Escaping quotes:** Inside quoted values, escape quotes with backslash:
|
|
307
|
+
```markdown
|
|
308
|
+
{: title="He said \"Hello\""}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Combining Attributes
|
|
312
|
+
|
|
313
|
+
All three types can be combined in a single IAL:
|
|
314
|
+
|
|
315
|
+
```markdown
|
|
316
|
+
# Heading
|
|
317
|
+
{: #section-1 .important .highlight title="Section Title" lang="en"}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Output: `<h1 id="section-1" class="important highlight" title="Section Title" lang="en">Heading</h1>`
|
|
321
|
+
|
|
322
|
+
## Attribute List Definitions (ALDs)
|
|
323
|
+
|
|
324
|
+
ALDs let you define reusable attribute sets that can be referenced multiple times. This is useful for maintaining consistent styling across a document.
|
|
325
|
+
|
|
326
|
+
### Defining ALDs
|
|
327
|
+
|
|
328
|
+
ALDs use the syntax `{:ref-name: attributes}` and can appear anywhere in your document (though typically at the end for organization):
|
|
329
|
+
|
|
330
|
+
```markdown
|
|
331
|
+
# Header 1
|
|
332
|
+
{:header-style}
|
|
333
|
+
|
|
334
|
+
# Header 2
|
|
335
|
+
{:header-style}
|
|
336
|
+
|
|
337
|
+
# Header 3
|
|
338
|
+
{:header-style}
|
|
339
|
+
|
|
340
|
+
{:header-style: #section-title .large .bold lang="en"}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Output:
|
|
344
|
+
```html
|
|
345
|
+
<h1 id="section-title" class="large bold" lang="en">Header 1</h1>
|
|
346
|
+
<h1 id="section-title" class="large bold" lang="en">Header 2</h1>
|
|
347
|
+
<h1 id="section-title" class="large bold" lang="en">Header 3</h1>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### ALD Syntax
|
|
351
|
+
|
|
352
|
+
ALD definitions follow the same attribute syntax as IALs:
|
|
353
|
+
|
|
354
|
+
```markdown
|
|
355
|
+
{:my-style: #my-id .class1 .class2 title="My Title" lang="en"}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Referencing ALDs
|
|
359
|
+
|
|
360
|
+
Reference an ALD in an IAL using just the reference name:
|
|
361
|
+
|
|
362
|
+
```markdown
|
|
363
|
+
# Heading
|
|
364
|
+
{:my-style}
|
|
365
|
+
|
|
366
|
+
Paragraph.
|
|
367
|
+
{:my-style}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
If the ALD `{:my-style: ...}` is defined, both elements will receive those attributes.
|
|
371
|
+
|
|
372
|
+
### Mixed Usage
|
|
373
|
+
|
|
374
|
+
You can mix ALD references with additional attributes in the same IAL. The additional attributes override or extend the ALD:
|
|
375
|
+
|
|
376
|
+
```markdown
|
|
377
|
+
{:base-style: #main .class1 .class2}
|
|
378
|
+
|
|
379
|
+
# Heading 1
|
|
380
|
+
{:base-style}
|
|
381
|
+
|
|
382
|
+
# Heading 2
|
|
383
|
+
{:base-style .class3}
|
|
384
|
+
|
|
385
|
+
# Heading 3
|
|
386
|
+
{:base-style #override-id}
|
|
387
|
+
|
|
388
|
+
# Heading 4
|
|
389
|
+
{:base-style .class3 rel="nofollow"}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Output:
|
|
393
|
+
```html
|
|
394
|
+
<h1 id="main" class="class1 class2">Heading 1</h1>
|
|
395
|
+
<h1 id="main" class="class1 class2 class3">Heading 2</h1>
|
|
396
|
+
<h1 id="override-id" class="class1 class2">Heading 3</h1>
|
|
397
|
+
<h1 id="main" class="class1 class2 class3" rel="nofollow">Heading 4</h1>
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Behavior:**
|
|
401
|
+
- **Classes**: Additional classes are appended to the ALD classes
|
|
402
|
+
- **IDs**: If an ID is specified in the IAL, it overrides the ALD's ID
|
|
403
|
+
- **Key-value attributes**: If a key exists in both ALD and IAL, the IAL value overrides the ALD value
|
|
404
|
+
|
|
405
|
+
## Important Notes
|
|
406
|
+
|
|
407
|
+
### Block-Level IAL Positioning
|
|
408
|
+
|
|
409
|
+
For block-level elements, the IAL **must** appear immediately after the element with **no blank line** between them:
|
|
410
|
+
|
|
411
|
+
**Correct:**
|
|
412
|
+
```markdown
|
|
413
|
+
Paragraph text.
|
|
414
|
+
{: .class}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Incorrect:**
|
|
418
|
+
```markdown
|
|
419
|
+
Paragraph text.
|
|
420
|
+
|
|
421
|
+
{: .class}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
The blank line will cause the IAL to be treated as a separate paragraph.
|
|
425
|
+
|
|
426
|
+
### Inline IAL Positioning
|
|
427
|
+
|
|
428
|
+
For inline elements, the IAL must appear immediately after the element, with optional whitespace:
|
|
429
|
+
|
|
430
|
+
```markdown
|
|
431
|
+
[link](url){:.class} text after
|
|
432
|
+
**bold**{:.bold-style} more text
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Multiple Elements with Same Attributes
|
|
436
|
+
|
|
437
|
+
When multiple links share the same URL, IALs are correctly matched using element indexing:
|
|
438
|
+
|
|
439
|
+
```markdown
|
|
440
|
+
Here's a [regular link](https://example.com) and [another link](https://example.com){:.button}.
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Both links point to the same URL, but only the second one receives the `button` class.
|
|
444
|
+
|
|
445
|
+
### Nested Elements
|
|
446
|
+
|
|
447
|
+
IALs work with nested inline elements:
|
|
448
|
+
|
|
449
|
+
```markdown
|
|
450
|
+
**Bold text with *italic*{:.nested} inside**{:.wrapper}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
The italic element gets the `nested` class, and the bold element gets the `wrapper` class.
|
|
454
|
+
|
|
455
|
+
## Examples
|
|
456
|
+
|
|
457
|
+
### Complete Example
|
|
458
|
+
|
|
459
|
+
```markdown
|
|
460
|
+
# Main Title
|
|
461
|
+
{: #main-title .page-title}
|
|
462
|
+
|
|
463
|
+
## Section 1
|
|
464
|
+
{:section-heading}
|
|
465
|
+
|
|
466
|
+
This paragraph has [a link](https://example.com){:.external-link} with styling.
|
|
467
|
+
|
|
468
|
+
Another paragraph with **bold text**{:.highlight}.
|
|
469
|
+
|
|
470
|
+
## Section 2
|
|
471
|
+
{:section-heading}
|
|
472
|
+
|
|
473
|
+
More content here.
|
|
474
|
+
|
|
475
|
+
{:section-heading: .section .important lang="en"}
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Output:
|
|
479
|
+
```html
|
|
480
|
+
<h1 id="main-title" class="page-title">Main Title</h1>
|
|
481
|
+
<h2 class="section important" lang="en">Section 1</h2>
|
|
482
|
+
<p>This paragraph has <a href="https://example.com" class="external-link">a link</a> with styling.</p>
|
|
483
|
+
<p>Another paragraph with <strong class="highlight">bold text</strong>.</p>
|
|
484
|
+
<h2 class="section important" lang="en">Section 2</h2>
|
|
485
|
+
<p>More content here.</p>
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Using ALDs for Consistent Styling
|
|
489
|
+
|
|
490
|
+
```markdown
|
|
491
|
+
# Introduction
|
|
492
|
+
{:intro}
|
|
493
|
+
|
|
494
|
+
## Overview
|
|
495
|
+
{:intro}
|
|
496
|
+
|
|
497
|
+
## Details
|
|
498
|
+
{:intro}
|
|
499
|
+
|
|
500
|
+
{:intro: .chapter .first lang="en"}
|
|
501
|
+
|
|
502
|
+
# Conclusion
|
|
503
|
+
{:conclusion}
|
|
504
|
+
|
|
505
|
+
## Summary
|
|
506
|
+
{:conclusion}
|
|
507
|
+
|
|
508
|
+
{:conclusion: .chapter .last lang="en"}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
This allows you to maintain consistent styling across multiple elements by defining the attributes once and referencing them multiple times.
|
|
512
|
+
|
|
513
|
+
## Related
|
|
514
|
+
|
|
515
|
+
- [Syntax](Syntax) - Complete syntax reference
|
|
516
|
+
- [Modes](Modes) - Understanding processor modes (IALs available in Kramdown and unified modes)
|