apex-ruby 1.0.6 → 1.0.8

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/ext/apex_ext/apex_ext.c +6 -0
  3. data/ext/apex_ext/apex_src/AGENTS.md +41 -0
  4. data/ext/apex_ext/apex_src/CHANGELOG.md +412 -2
  5. data/ext/apex_ext/apex_src/CMakeLists.txt +41 -29
  6. data/ext/apex_ext/apex_src/Formula/apex.rb +2 -2
  7. data/ext/apex_ext/apex_src/Package.swift +9 -0
  8. data/ext/apex_ext/apex_src/README.md +31 -9
  9. data/ext/apex_ext/apex_src/ROADMAP.md +5 -0
  10. data/ext/apex_ext/apex_src/VERSION +1 -1
  11. data/ext/apex_ext/apex_src/cli/main.c +1125 -13
  12. data/ext/apex_ext/apex_src/docs/index.md +459 -0
  13. data/ext/apex_ext/apex_src/include/apex/apex.h +67 -5
  14. data/ext/apex_ext/apex_src/include/apex/ast_man.h +20 -0
  15. data/ext/apex_ext/apex_src/include/apex/ast_markdown.h +39 -0
  16. data/ext/apex_ext/apex_src/include/apex/ast_terminal.h +40 -0
  17. data/ext/apex_ext/apex_src/include/apex/module.modulemap +1 -1
  18. data/ext/apex_ext/apex_src/man/apex-config.5 +333 -258
  19. data/ext/apex_ext/apex_src/man/apex-config.5.md +3 -1
  20. data/ext/apex_ext/apex_src/man/apex-plugins.7 +401 -316
  21. data/ext/apex_ext/apex_src/man/apex.1 +663 -620
  22. data/ext/apex_ext/apex_src/man/apex.1.html +703 -0
  23. data/ext/apex_ext/apex_src/man/apex.1.md +160 -90
  24. data/ext/apex_ext/apex_src/objc/Apex.swift +6 -0
  25. data/ext/apex_ext/apex_src/objc/NSString+Apex.h +12 -0
  26. data/ext/apex_ext/apex_src/objc/NSString+Apex.m +9 -0
  27. data/ext/apex_ext/apex_src/pages/index.md +459 -0
  28. data/ext/apex_ext/apex_src/src/_README.md +4 -4
  29. data/ext/apex_ext/apex_src/src/apex.c +702 -44
  30. data/ext/apex_ext/apex_src/src/ast_json.c +1130 -0
  31. data/ext/apex_ext/apex_src/src/ast_json.h +46 -0
  32. data/ext/apex_ext/apex_src/src/ast_man.c +948 -0
  33. data/ext/apex_ext/apex_src/src/ast_markdown.c +409 -0
  34. data/ext/apex_ext/apex_src/src/ast_terminal.c +2516 -0
  35. data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +8 -5
  36. data/ext/apex_ext/apex_src/src/extensions/definition_list.c +491 -1514
  37. data/ext/apex_ext/apex_src/src/extensions/definition_list.h +8 -15
  38. data/ext/apex_ext/apex_src/src/extensions/emoji.c +207 -0
  39. data/ext/apex_ext/apex_src/src/extensions/emoji.h +14 -0
  40. data/ext/apex_ext/apex_src/src/extensions/header_ids.c +178 -71
  41. data/ext/apex_ext/apex_src/src/extensions/highlight.c +37 -5
  42. data/ext/apex_ext/apex_src/src/extensions/ial.c +416 -47
  43. data/ext/apex_ext/apex_src/src/extensions/includes.c +241 -10
  44. data/ext/apex_ext/apex_src/src/extensions/includes.h +1 -0
  45. data/ext/apex_ext/apex_src/src/extensions/metadata.c +166 -3
  46. data/ext/apex_ext/apex_src/src/extensions/metadata.h +7 -0
  47. data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +34 -3
  48. data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +55 -10
  49. data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +7 -4
  50. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +84 -52
  51. data/ext/apex_ext/apex_src/src/extensions/toc.c +133 -19
  52. data/ext/apex_ext/apex_src/src/filters_ast.c +194 -0
  53. data/ext/apex_ext/apex_src/src/filters_ast.h +36 -0
  54. data/ext/apex_ext/apex_src/src/html_renderer.c +1265 -35
  55. data/ext/apex_ext/apex_src/src/html_renderer.h +21 -0
  56. data/ext/apex_ext/apex_src/src/plugins_remote.c +40 -14
  57. data/ext/apex_ext/apex_src/tests/CMakeLists.txt +1 -0
  58. data/ext/apex_ext/apex_src/tests/README.md +11 -5
  59. data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +13 -2
  60. data/ext/apex_ext/apex_src/tests/fixtures/filters/filter_output_with_rawblock.json +1 -0
  61. data/ext/apex_ext/apex_src/tests/fixtures/filters/unwrap.md +7 -0
  62. data/ext/apex_ext/apex_src/tests/fixtures/images/auto-wildcard.md +8 -0
  63. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.avif +0 -0
  64. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.jpg +0 -0
  65. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.webp +0 -0
  66. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.avif +0 -0
  67. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.jpg +0 -0
  68. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.webp +0 -0
  69. data/ext/apex_ext/apex_src/tests/fixtures/images/media_formats_test.md +63 -0
  70. data/ext/apex_ext/apex_src/tests/fixtures/includes/data-semi.csv +3 -0
  71. data/ext/apex_ext/apex_src/tests/fixtures/includes/with space.txt +1 -0
  72. data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +4 -1
  73. data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +64 -0
  74. data/ext/apex_ext/apex_src/tests/terminal_width_test.sh +29 -0
  75. data/ext/apex_ext/apex_src/tests/test-swift-package.sh +14 -0
  76. data/ext/apex_ext/apex_src/tests/test_cmark_callback.c +189 -0
  77. data/ext/apex_ext/apex_src/tests/test_extensions.c +374 -0
  78. data/ext/apex_ext/apex_src/tests/test_metadata.c +68 -0
  79. data/ext/apex_ext/apex_src/tests/test_output.c +291 -2
  80. data/ext/apex_ext/apex_src/tests/test_runner.c +10 -0
  81. data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +1 -1
  82. data/ext/apex_ext/apex_src/tests/test_tables.c +17 -1
  83. data/lib/apex/version.rb +1 -1
  84. metadata +32 -2
  85. data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +0 -456
@@ -1,5 +1,5 @@
1
1
 
2
- [![Version: 0.1.72](https://img.shields.io/badge/Version-0.1.72-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 1304/1304](https://img.shields.io/badge/Tests-1304/1304-a5da78)<!--END TESTS_BADGE-->
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-->
3
3
 
4
4
 
5
5
  # Apex
@@ -42,7 +42,7 @@ one tool.
42
42
  - **Smart typography**: Automatic conversion of quotes, dashes, ellipses, and more
43
43
  - **Math support**: LaTeX math expressions with `$...$` (inline) and `$$...$$` (display)
44
44
 
45
- - **Syntax highlighting**: External syntax highlighting for fenced code blocks via Pygments or Skylighting with `--code-highlight` flag.
45
+ - **Syntax highlighting**: External syntax highlighting for fenced code blocks via Pygments, Skylighting, or Shiki with `--code-highlight` flag.
46
46
 
47
47
  Supports language-aware highlighting, auto-detection, and line numbers with `--code-line-numbers`
48
48
 
@@ -119,7 +119,7 @@ one tool.
119
119
  - **Flexible output**: Compact HTML fragments, pretty-printed HTML, or complete standalone documents
120
120
  - **Standalone documents**: Generate complete HTML5 documents with `<html>`, `<head>`, `<body>` tags
121
121
  - **Custom styling**: Link multiple external CSS files in standalone mode (use `--css` multiple times or comma-separated list)
122
- - **Syntax highlighting**: External syntax highlighting via Pygments or Skylighting with `--code-highlight` flag, includes automatic GitHub-style CSS in standalone mode
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
124
  - **Header ID generation**: Automatic or manual header IDs with multiple format options (GFM, MMD, Kramdown)
125
125
  - **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
@@ -237,6 +237,10 @@ apex input.md --mode kramdown
237
237
 
238
238
  - `--pretty` - Pretty-print HTML with indentation
239
239
 
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
+
240
244
  `--standalone` - Generate complete HTML document with `<html>`, `<head>`, `<body>`
241
245
 
242
246
  `--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`)
@@ -292,14 +296,14 @@ apex input.md --mode kramdown
292
296
 
293
297
  `--spans` / `--no-spans` - Enable/disable bracketed spans `[text]{IAL}` syntax (enabled by default in unified mode)
294
298
 
295
- `--code-highlight TOOL` - Use external tool for syntax highlighting (supports `pygments`/`p`/`pyg` or `skylighting`/`s`/`sky`). Automatically includes GitHub-style CSS in standalone mode
299
+ `--code-highlight TOOL` - Use external tool for syntax highlighting (supports `pygments`/`p`/`pyg`, `skylighting`/`s`/`sky`, or `shiki`/`sh`). Uses HTML or ANSI output based on destination format. Automatically includes GitHub-style CSS in standalone mode
296
300
 
297
301
  `--code-line-numbers` - Include line numbers in syntax-highlighted code blocks (requires `--code-highlight`)
298
302
 
299
303
  ### All Options
300
304
 
301
305
  ```
302
- Apex Markdown Processor v0.1.72
306
+ Apex Markdown Processor v0.1.97
303
307
  One Markdown processor to rule them all
304
308
 
305
309
  Project homepage: https://github.com/ApexMarkdown/apex
@@ -315,17 +319,21 @@ Options:
315
319
  --base-dir DIR Base directory for resolving relative paths (for images, includes, wiki links)
316
320
  --bibliography FILE Bibliography file (BibTeX, CSL JSON, or CSL YAML) - can be used multiple times
317
321
  --captions POSITION Table caption position: above or below (default: below)
318
- --code-highlight TOOL Use external tool for syntax highlighting (pygments, skylighting, or abbreviations p, s)
322
+ --code-highlight TOOL Use external tool for syntax highlighting (pygments, skylighting, shiki, or abbreviations p, s, sh)
323
+ --code-highlight-theme THEME Theme/style name for external syntax highlighters (tool-specific)
324
+ --list-themes List available syntax highlighting themes for pygments, skylighting, and Shiki
319
325
  --code-line-numbers Include line numbers in syntax-highlighted code blocks (requires --code-highlight)
320
326
  --highlight-language-only Only highlight code blocks that have a language specified (requires --code-highlight)
321
327
  --combine Concatenate Markdown files (expanding includes) into a single Markdown stream
322
328
  When a SUMMARY.md file is provided, treat it as a GitBook index and combine
323
329
  the linked files in order. Output is raw Markdown suitable for piping back into Apex.
324
330
  --csl FILE Citation style file (CSL format)
325
- --css FILE, --style FILE Link to CSS file(s) in document head (requires --standalone, overrides CSS metadata)
326
- Can be used multiple times or accept comma-separated list (e.g., --css style.css,syntax.css)
331
+ --css FILE, --style FILE Link to CSS file(s) in document head. With HTML: requires -s/--standalone.
332
+ With -t man-html -s: include custom CSS in the man page. Can be used multiple times or comma-separated (e.g., --css style.css)
327
333
  --embed-css Embed CSS file contents into a <style> tag in the document head (used with --css)
328
334
  --embed-images Embed local images as base64 data URLs in HTML output
335
+ --[no-]image-captions Wrap images with title or alt text in <figure>/<figcaption> (default: on in unified/mmd)
336
+ --[no-]title-captions-only Only add captions for images with title; alt-only images get no caption
329
337
  --hardbreaks Treat newlines as hard breaks
330
338
  --header-anchors Generate <a> anchor tags instead of header IDs
331
339
  -h, --help Show this help message
@@ -334,6 +342,13 @@ Options:
334
342
  --[no-]includes Enable file inclusion (enabled by default in unified mode)
335
343
  --indices Enable index processing (mmark, TextIndex, and Leanpub syntax)
336
344
  --install-plugin ID Install plugin by id from directory, or by Git URL/GitHub shorthand (user/repo)
345
+ --list-filters List installed filters and available filters from the remote directory
346
+ --install-filter ID Install AST filter by id from the central filters directory or by Git URL/GitHub shorthand
347
+ --uninstall-filter ID Uninstall filter by id
348
+ --filter NAME Run a single AST filter from ~/.config/apex/filters/NAME (Pandoc-style JSON filter)
349
+ --filters Run all executable filters in ~/.config/apex/filters (sorted by name)
350
+ --lua-filter FILE Run a Lua script as an AST filter via 'lua FILE' (Pandoc-style JSON filter)
351
+ --no-strict-filters Do not abort on AST filter errors/invalid JSON; skip failing filters instead
337
352
  --link-citations Link citations to bibliography entries
338
353
  --list-plugins List installed plugins and available plugins from the remote directory
339
354
  --uninstall-plugin ID Uninstall plugin by id
@@ -343,6 +358,7 @@ Options:
343
358
  --mmd-merge Merge files from one or more mmd_merge-style index files into a single Markdown stream
344
359
  Index files list document parts line-by-line; indentation controls header level shifting.
345
360
  -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
346
362
  --no-bibliography Suppress bibliography output
347
363
  --no-footnotes Disable footnote support
348
364
  --no-ids Disable automatic header ID generation
@@ -355,6 +371,7 @@ Options:
355
371
  --no-smart Disable smart typography
356
372
  --no-sup-sub Disable superscript/subscript syntax
357
373
  --[no-]divs Enable or disable Pandoc fenced divs (Unified mode only)
374
+ --[no-]one-line-definitions Enable or disable one-line definition lists (Term :: Definition)
358
375
  --[no-]spans Enable or disable bracketed spans [text]{IAL} (Pandoc-style, enabled by default in unified mode)
359
376
  --no-tables Disable table support
360
377
  --no-transforms Disable metadata variable transforms
@@ -366,13 +383,15 @@ Options:
366
383
  --[no-]progress Show progress indicator during processing (enabled by default for TTY)
367
384
  --plugins Enable external/plugin processing
368
385
  --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.
369
388
  --reject Reject all Critic Markup changes (revert edits)
370
389
  --[no-]relaxed-tables Enable or disable relaxed table parsing (no separator rows required)
371
390
  --[no-]per-cell-alignment Enable or disable per-cell alignment markers (colons at start/end of cells, enabled by default in unified mode)
372
391
  --script VALUE Inject <script> tags before </body> (standalone) or at end of HTML (snippet).
373
392
  VALUE can be a path, URL, or shorthand (mermaid, mathjax, katex). Can be used multiple times or as a comma-separated list.
374
393
  --show-tooltips Show tooltips on citations
375
- -s, --standalone Generate complete HTML document (with <html>, <head>, <body>)
394
+ -s, --standalone Generate complete HTML document (with <html>, <head>, <body>). For -t man-html, -s adds nav sidebar and full page; without -s, output is snippet only.
376
395
  --[no-]sup-sub Enable or disable MultiMarkdown-style superscript (^text^) and subscript (~text~) syntax
377
396
  --[no-]strikethrough Enable or disable GFM-style ~~strikethrough~~ processing
378
397
  --title TITLE Document title (requires --standalone, default: "Document")
@@ -393,6 +412,9 @@ Options:
393
412
  --wikilink-space MODE Space replacement for wiki links: dash, none, underscore, space (default: dash)
394
413
  --wikilink-extension EXT File extension to append to wiki links (e.g., html, md)
395
414
  --[no-]wikilink-sanitize Sanitize wiki link URLs (lowercase, remove apostrophes, etc.)
415
+ --theme NAME Terminal theme name for -t terminal/terminal256 (from ~/.config/apex/terminal/themes/NAME.theme)
416
+ --width N Hard-wrap terminal/terminal256 output at N visible columns
417
+ -p, --paginate Page terminal/cli/terminal256 output through a pager (APEX_PAGER, then PAGER, then less -R)
396
418
 
397
419
  If no file is specified, reads from stdin.
398
420
 
@@ -0,0 +1,5 @@
1
+ ## Cleanup
2
+
3
+ - **Todo**: Replace pointer-difference lengths (`long` / `ptrdiff_t`) assigned to `int` in parsers (`advanced_tables.c`, `callouts.c`, `citations.c`, `critic.c`, `emoji.c`, `ial.c`, etc.) with a two-step, range-checked pattern (e.g. compute to `ptrdiff_t`, validate against `INT_MAX`, then cast to `int`) or refactor to use `size_t` consistently.
4
+ - **Todo**: Gradually standardize length/index types across parsing code to avoid implicit narrowing conversions and make warnings-free builds the default in Xcode and Swift package targets.
5
+
@@ -1 +1 @@
1
- 0.1.73
1
+ 0.1.98