apex-ruby 1.0.8 → 1.0.10

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ext/apex_ext/apex_src/CHANGELOG.md +69 -0
  3. data/ext/apex_ext/apex_src/CMakeLists.txt +2 -1
  4. data/ext/apex_ext/apex_src/Formula/apex.rb +2 -2
  5. data/ext/apex_ext/apex_src/Package.swift +14 -2
  6. data/ext/apex_ext/apex_src/README.md +12 -9
  7. data/ext/apex_ext/apex_src/VERSION +1 -1
  8. data/ext/apex_ext/apex_src/cli/main.c +625 -98
  9. data/ext/apex_ext/apex_src/ial.html +24 -0
  10. data/ext/apex_ext/apex_src/include/apex/apex.h +57 -7
  11. data/ext/apex_ext/apex_src/include/apex/ast_markdown.h +3 -0
  12. data/ext/apex_ext/apex_src/include/apex/module.modulemap +8 -0
  13. data/ext/apex_ext/apex_src/include/apexc.h +6 -0
  14. data/ext/apex_ext/apex_src/include/module.modulemap +4 -0
  15. data/ext/apex_ext/apex_src/man/apex-config.5 +8 -2
  16. data/ext/apex_ext/apex_src/man/apex-plugins.7 +13 -13
  17. data/ext/apex_ext/apex_src/man/apex.1 +150 -442
  18. data/ext/apex_ext/apex_src/man/apex.1.md +13 -0
  19. data/ext/apex_ext/apex_src/src/_README.md +3 -1
  20. data/ext/apex_ext/apex_src/src/apex.c +151 -6
  21. data/ext/apex_ext/apex_src/src/ast_terminal.c +459 -8
  22. data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +6 -6
  23. data/ext/apex_ext/apex_src/src/extensions/callouts.c +1 -1
  24. data/ext/apex_ext/apex_src/src/extensions/citations.c +24 -12
  25. data/ext/apex_ext/apex_src/src/extensions/critic.c +14 -6
  26. data/ext/apex_ext/apex_src/src/extensions/emoji.c +2 -2
  27. data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1 -1
  28. data/ext/apex_ext/apex_src/src/extensions/header_ids.c +19 -6
  29. data/ext/apex_ext/apex_src/src/extensions/ial.c +25 -13
  30. data/ext/apex_ext/apex_src/src/extensions/includes.c +7 -7
  31. data/ext/apex_ext/apex_src/src/extensions/index.c +19 -7
  32. data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +2 -2
  33. data/ext/apex_ext/apex_src/src/extensions/insert.c +1 -1
  34. data/ext/apex_ext/apex_src/src/extensions/math.c +11 -2
  35. data/ext/apex_ext/apex_src/src/extensions/metadata.c +46 -0
  36. data/ext/apex_ext/apex_src/src/extensions/metadata.h +12 -0
  37. data/ext/apex_ext/apex_src/src/html_renderer.c +2 -2
  38. data/ext/apex_ext/apex_src/src/plugins.c +97 -55
  39. data/ext/apex_ext/apex_src/src/plugins.h +0 -10
  40. data/ext/apex_ext/apex_src/src/pretty_html.c +1 -1
  41. data/ext/apex_ext/apex_src/tests/fixtures/metadata/mmd-metadata.md +5 -0
  42. data/ext/apex_ext/apex_src/tests/fixtures/metadata/pandoc-meta.md +4 -0
  43. data/ext/apex_ext/apex_src/tests/fixtures/metadata/yaml-frontmatter.md +6 -0
  44. data/ext/apex_ext/apex_src/tests/metadata_cli_test.sh +119 -0
  45. data/ext/apex_ext/apex_src/tests/test_custom_plugins.c +78 -0
  46. data/ext/apex_ext/apex_src/tests/test_extensions.c +27 -0
  47. data/ext/apex_ext/apex_src/tests/test_metadata.c +42 -0
  48. data/ext/apex_ext/apex_src/tests/test_output.c +83 -0
  49. data/ext/apex_ext/apex_src/tests/test_runner.c +4 -1
  50. data/lib/apex/version.rb +1 -1
  51. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d9d2cda95e5896112f209b03223dc28a0188734c076bb06faf207444e1c42c4
4
- data.tar.gz: e459f864e424a5de55c730e160083afa070a9287ed9f002c40aa97ca2fe1444c
3
+ metadata.gz: d98442a5a9768db3ab8b0d192de70e2b72989102787a37d554fac8521b65b13f
4
+ data.tar.gz: e00c66bd55923af39c47f17481a3a34c4a28fc2d6445946bee4c7515aba0b9be
5
5
  SHA512:
6
- metadata.gz: 04e7e651d63995560ee4bbbf720f6c399aad0baeda0fa0c44df81e339188c870b2f8ee0101a1edf72c9a1352c2fa206bf170f0827735798e9be599b0f72b8cd9
7
- data.tar.gz: 32ebb59fdde780bbb681923ad333392157e7aea7eb6636e20227fc409086abb8d38537e82b068937a5807878ae7acb8591265fb34a2cb1444b43bae82710402a
6
+ metadata.gz: 9f58e9b703fdf1d093563938dc2ffa93345ab1f7e56cc216af954fef7e9b8eda191d20b1a3e017a4239f685933ee15299a68ab3e7bb3aa1af7a11e97125ba758
7
+ data.tar.gz: 73938d7b28bf05cefb94bbdc54d0f6a4871ce6c5abb783ab9094a098c2fe439dd492a5f5b26b108c773bb0a91010fb71fdc2c5ab75f7cac577ad9c3a83749769
@@ -2,6 +2,67 @@
2
2
 
3
3
  All notable changes to Apex will be documented in this file.
4
4
 
5
+ ## [1.0.4] - 2026-03-31
6
+
7
+ ### Fixed
8
+
9
+ - Prevent heading ID generation crashes on very large headings by making heading text extraction buffer growth handle required size safely.
10
+
11
+ ## [1.0.3] - 2026-03-29
12
+
13
+ ## [1.0.2] - 2026-03-29
14
+
15
+ ## [1.0.1] - 2026-03-29
16
+
17
+ ## [0.1.104] - 2026-03-29
18
+
19
+ ### Fixed
20
+
21
+ - After merging global/project/document/`--meta` metadata, the CLI now re-applies every option that was set on the command line so config and YAML metadata cannot override explicit flags (including `--mode`, `-t`/`--to`, feature toggles, `--standalone`, `--style`/`--css`, bibliography/CSL, and the rest of the documented CLI surface).
22
+ - Track argv-set fields with apex_cli_option_mask, snapshot options after wiring bibliography/stylesheet, and re-apply after apex_apply_metadata_to_options so global/project/document metadata cannot override explicit flags.
23
+
24
+ ## [0.1.103] - 2026-03-29
25
+
26
+ ### New
27
+
28
+ - `i/--info` prints version, merged config (global, project, --meta-file, --meta),
29
+ - `--extract-meta` and `-e KEY` merge per-file document metadata in order (mode-aware)
30
+ - Add metadata_yaml_emit unit tests and man page entries.
31
+ - CLI `-s`/`--standalone` (and `--style`/`--css`, which imply standalone) now wins over `standalone: false` from document or config metadata, so explicit standalone output is not downgraded to an HTML fragment.
32
+
33
+ ### Fixed
34
+
35
+ - Track explicit -s/--standalone and --style/--css and re-apply standalone after apex_apply_metadata_to_options so document or config YAML cannot force a fragment when the user asked for a full document.
36
+
37
+ ## [0.1.102] - 2026-03-22
38
+
39
+ ### Changed
40
+
41
+ - Use `--to xhtml`/`-t strict-xhtml` for semantic reasons, original `--[strict-]xhtml` flags left in place
42
+
43
+ ## [0.1.100] - 2026-03-22
44
+
45
+ ### Changed
46
+
47
+ - Homebrew formula bumped to 0.1.97.
48
+ - Bump Homebrew formula to v0.1.98 with updated release tarball SHA256.
49
+
50
+ ### New
51
+
52
+ - Display inline images in terminal output using imgcat, chafa, viu, or catimg
53
+ - `--[no-]terminal-images`, `--terminal-image-width
54
+ - Remote images are downloaded to temp directory for terminal display (requires curl)
55
+ - Rough tests for image output
56
+
57
+ ### Improved
58
+
59
+ - SwiftPM now exports the raw C API via the `ApexC` product.
60
+
61
+ ### Fixed
62
+
63
+ - Avoid Swift module-name collisions so `apex_*` symbols are visible from Swift.
64
+ - Include new module map
65
+
5
66
  ## [0.1.98] - 2026-03-19
6
67
 
7
68
  ### Changed
@@ -2741,6 +2802,14 @@ Based on [cmark-gfm](https://github.com/github/cmark-gfm) by GitHub
2741
2802
 
2742
2803
  Developed for [Marked](https://marked2app.com) by Brett Terpstra
2743
2804
 
2805
+ [1.0.4]: https://github.com/ApexMarkdown/apex/releases/tag/v1.0.4
2806
+ [1.0.3]: https://github.com/ApexMarkdown/apex/releases/tag/v1.0.3
2807
+ [1.0.2]: https://github.com/ApexMarkdown/apex/releases/tag/v1.0.2
2808
+ [1.0.1]: https://github.com/ApexMarkdown/apex/releases/tag/v1.0.1
2809
+ [0.1.104]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.104
2810
+ [0.1.103]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.103
2811
+ [0.1.102]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.102
2812
+ [0.1.100]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.100
2744
2813
  [0.1.98]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.98
2745
2814
  [0.1.97]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.97
2746
2815
  [0.1.96]: https://github.com/ApexMarkdown/apex/releases/tag/v0.1.96
@@ -6,7 +6,7 @@ if(POLICY CMP0000)
6
6
  endif()
7
7
  set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "Minimum CMake policy version" FORCE)
8
8
 
9
- project(apex VERSION 0.1.98 LANGUAGES C)
9
+ project(apex VERSION 1.0.4 LANGUAGES C)
10
10
 
11
11
  # Set C standard
12
12
  set(CMAKE_C_STANDARD 99)
@@ -340,6 +340,7 @@ add_executable(apex_test_runner
340
340
  tests/test_runner.c
341
341
  tests/test_basic.c
342
342
  tests/test_cmark_callback.c
343
+ tests/test_custom_plugins.c
343
344
  tests/test_metadata.c
344
345
  tests/test_links.c
345
346
  tests/test_tables.c
@@ -7,14 +7,14 @@
7
7
  class Apex < Formula
8
8
  desc "Unified Markdown processor supporting CommonMark, GFM, MultiMarkdown, and Kramdown"
9
9
  homepage "https://github.com/ApexMarkdown/apex"
10
- version "0.1.97"
10
+ version "1.0.4"
11
11
  license "MIT"
12
12
 
13
13
  depends_on "libyaml"
14
14
 
15
15
  on_macos do
16
16
  url "https://github.com/ApexMarkdown/apex/releases/download/v#{version}/apex-#{version}-macos-universal.tar.gz"
17
- sha256 "4ca3d97305e94275397dfe9e3803feef7fb98fcbb0e472f56fcc0daff65f0f07"
17
+ sha256 "67aae33bd1417f4fec147004b0c858364f1dc452f42f3bb6dd5bb930abccd27b"
18
18
  end
19
19
 
20
20
  def install
@@ -1,8 +1,18 @@
1
1
  // swift-tools-version:5.7
2
2
  // The swift-tools-version declares the minimum version of Swift required to build this package.
3
3
 
4
+ import Foundation
4
5
  import PackageDescription
5
6
 
7
+ /// Clang discovers `include/apex/module.modulemap` next to headers and builds a precompiled
8
+ /// `ApexHeaders` module, but SPM only loads `include/module.modulemap` (ApexC). Without passing
9
+ /// this path explicitly, `ApexObjC`/`Apex` fail with: module 'ApexHeaders' is not defined in any
10
+ /// loaded module map file.
11
+ private let apexHeadersModuleMap = URL(fileURLWithPath: #filePath)
12
+ .deletingLastPathComponent()
13
+ .appendingPathComponent("include/apex/module.modulemap")
14
+ .path
15
+
6
16
  let package = Package(
7
17
  name: "Apex",
8
18
  platforms: [
@@ -150,7 +160,8 @@ let package = Package(
150
160
  sources: ["NSString+Apex.m"],
151
161
  publicHeadersPath: ".",
152
162
  cSettings: [
153
- .headerSearchPath("../include")
163
+ .headerSearchPath("../include"),
164
+ .unsafeFlags(["-fmodule-map-file=\(apexHeadersModuleMap)"]),
154
165
  ]
155
166
  ),
156
167
  // Swift wrapper
@@ -162,7 +173,8 @@ let package = Package(
162
173
  sources: ["Apex.swift"],
163
174
  publicHeadersPath: ".",
164
175
  swiftSettings: [
165
- .define("APEX_HAVE_LIBYAML") // Always enabled when bundled
176
+ .define("APEX_HAVE_LIBYAML"), // Always enabled when bundled
177
+ .unsafeFlags(["-Xcc", "-fmodule-map-file=\(apexHeadersModuleMap)"]),
166
178
  ]
167
179
  ),
168
180
  ]
@@ -1,5 +1,5 @@
1
1
 
2
- [![Version: 0.1.97](https://img.shields.io/badge/Version-0.1.97-528c9e)](https://github.com/ApexMarkdown/apex/releases/latest) ![](https://img.shields.io/badge/CMake-064F8C?style=for-the-badge&logo=cmake&logoColor=white) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) <!--TESTS_BADGE-->![Tests passing 1475/1475](https://img.shields.io/badge/Tests-1475/1475-a5da78)<!--END TESTS_BADGE-->
2
+ [![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-528c9e)](https://github.com/ApexMarkdown/apex/releases/latest) ![](https://img.shields.io/badge/CMake-064F8C?style=for-the-badge&logo=cmake&logoColor=white) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) <!--TESTS_BADGE-->![Tests passing 1502/1502](https://img.shields.io/badge/Tests-1502/1502-a5da78)<!--END TESTS_BADGE-->
3
3
 
4
4
 
5
5
  # Apex
@@ -121,10 +121,12 @@ one tool.
121
121
  - **Custom styling**: Link multiple external CSS files in standalone mode (use `--css` multiple times or comma-separated list)
122
122
  - **Syntax highlighting**: External syntax highlighting via Pygments, Skylighting, or Shiki with `--code-highlight` flag, includes automatic GitHub-style CSS in standalone mode
123
123
  - **Pretty-print**: Formatted HTML with proper indentation for readability
124
+ - **XHTML output**: `--xhtml` writes void/empty elements in XML form (`<br />`, `<meta ... />`). `--strict-xhtml` adds polyglot XHTML document scaffolding when used with `--standalone` (XML declaration, XHTML namespace, `Content-Type` meta). You can also select the same behavior with `-t xhtml` or `-t strict-xhtml` (aliases for HTML output with those flags). In **fragment** mode, strict mode does not validate or repair all markup as XML???raw HTML can still be ill-formed; see the main README.
124
125
  - **Header ID generation**: Automatic or manual header IDs with multiple format options (GFM, MMD, Kramdown)
125
126
  - **Emoji-to-name conversion**: In GFM mode, emojis in headers are converted to their textual names in IDs (e.g., `# ???? Support` ??? `id="smile-support"`), matching Pandoc's GFM behavior
126
127
  - **Header anchors**: Option to generate `<a>` anchor tags instead of header IDs
127
128
  - **ARIA accessibility**: Add ARIA labels and accessibility attributes (`--aria`) for better screen reader support, including aria-label on TOC navigation, role attributes on figures and tables, and aria-describedby linking tables to their captions
129
+ - **Terminal inline images**: With `-t terminal` / `-t terminal256`, when stdout is a TTY and a viewer is available on `PATH`, Markdown images are rendered as inline terminal graphics (viewer order: `imgcat`, `chafa`, `viu`, `catimg`). Width is controlled with `--terminal-image-width` (default 50 character cells). HTTP(S) URLs are downloaded with `curl` (60s timeout, 10 MiB max) to a temp file under `TMPDIR` or `/tmp`. Use `--no-terminal-images` to always show images as styled link text plus URL instead. Metadata: `terminal.inline_images` / `terminal_inline_images`, `terminal.image_width` / `terminal_image_width`.
128
130
 
129
131
  ### Advanced Features
130
132
 
@@ -237,10 +239,6 @@ apex input.md --mode kramdown
237
239
 
238
240
  - `--pretty` - Pretty-print HTML with indentation
239
241
 
240
- - `--xhtml` - HTML5 output with XML-style self-closing void tags (`<br />`, `<meta charset="UTF-8" />`, etc.)
241
-
242
- - `--strict-xhtml` - Polyglot XHTML/XML for `application/xhtml+xml` consumers: XML declaration, XHTML namespace, `Content-Type` meta; implies `--xhtml` serialization. Cannot be combined with `--xhtml` (use `--strict-xhtml` alone).
243
-
244
242
  `--standalone` - Generate complete HTML document with `<html>`, `<head>`, `<body>`
245
243
 
246
244
  `--style FILE` / `--css FILE` - Link to CSS file(s) in document head (requires `--standalone`). Can be used multiple times or with comma-separated list (e.g., `--css style.css --css syntax.css` or `--css style.css,syntax.css`)
@@ -303,7 +301,7 @@ apex input.md --mode kramdown
303
301
  ### All Options
304
302
 
305
303
  ```
306
- Apex Markdown Processor v0.1.97
304
+ Apex Markdown Processor v1.0.3
307
305
  One Markdown processor to rule them all
308
306
 
309
307
  Project homepage: https://github.com/ApexMarkdown/apex
@@ -337,6 +335,9 @@ Options:
337
335
  --hardbreaks Treat newlines as hard breaks
338
336
  --header-anchors Generate <a> anchor tags instead of header IDs
339
337
  -h, --help Show this help message
338
+ -i, --info Show version, merged config (YAML), and plugin ids; to stdout without files, to stderr when processing files
339
+ --extract-meta Print merged document metadata from input file(s) as YAML and exit
340
+ -e, --extract-meta-value KEY Print one metadata value for KEY and exit (uses merged metadata from files, last wins)
340
341
  --id-format FORMAT Header ID format: gfm (default), mmd, or kramdown
341
342
  (modes auto-set format; use this to override in unified mode)
342
343
  --[no-]includes Enable file inclusion (enabled by default in unified mode)
@@ -358,7 +359,7 @@ Options:
358
359
  --mmd-merge Merge files from one or more mmd_merge-style index files into a single Markdown stream
359
360
  Index files list document parts line-by-line; indentation controls header level shifting.
360
361
  -m, --mode MODE Processor mode: commonmark, gfm, mmd, kramdown, unified (default)
361
- -t, --to FORMAT Output format: html (default), json (before filters), json-filtered/ast-json/ast (after filters), markdown/md, mmd, commonmark/cmark, kramdown, gfm, terminal/cli, terminal256, man, man-html
362
+ -t, --to FORMAT Output format: html (default), xhtml (alias for html + --xhtml), strict-xhtml (alias for html + --strict-xhtml), json (before filters), json-filtered/ast-json/ast (after filters), markdown/md, mmd, commonmark/cmark, kramdown, gfm, terminal/cli, terminal256, man, man-html
362
363
  --no-bibliography Suppress bibliography output
363
364
  --no-footnotes Disable footnote support
364
365
  --no-ids Disable automatic header ID generation
@@ -383,8 +384,8 @@ Options:
383
384
  --[no-]progress Show progress indicator during processing (enabled by default for TTY)
384
385
  --plugins Enable external/plugin processing
385
386
  --pretty Pretty-print HTML with indentation and whitespace
386
- --xhtml HTML5 output with self-closing void tags (<br />, <meta ... />)
387
- --strict-xhtml Polyglot XHTML/XML (xmlns, application/xhtml+xml meta; implies --xhtml). Not with --xhtml.
387
+ --xhtml HTML5 output with self-closing void tags (<br />, <meta ... />). Same as -t xhtml.
388
+ --strict-xhtml Polyglot XHTML/XML for parsers (xmlns, application/xhtml+xml meta; implies --xhtml). Mutually exclusive with --xhtml. Same as -t strict-xhtml.
388
389
  --reject Reject all Critic Markup changes (revert edits)
389
390
  --[no-]relaxed-tables Enable or disable relaxed table parsing (no separator rows required)
390
391
  --[no-]per-cell-alignment Enable or disable per-cell alignment markers (colons at start/end of cells, enabled by default in unified mode)
@@ -414,6 +415,8 @@ Options:
414
415
  --[no-]wikilink-sanitize Sanitize wiki link URLs (lowercase, remove apostrophes, etc.)
415
416
  --theme NAME Terminal theme name for -t terminal/terminal256 (from ~/.config/apex/terminal/themes/NAME.theme)
416
417
  --width N Hard-wrap terminal/terminal256 output at N visible columns
418
+ --no-terminal-images Do not render local images via imgcat/chafa/viu/catimg on terminal output
419
+ --terminal-image-width N Max width/cells for terminal image tools (default: 50)
417
420
  -p, --paginate Page terminal/cli/terminal256 output through a pager (APEX_PAGER, then PAGER, then less -R)
418
421
 
419
422
  If no file is specified, reads from stdin.
@@ -1 +1 @@
1
- 0.1.98
1
+ 1.0.4