Skip to content

Conversation

@toc-assistant
Copy link
Contributor

Summary

Improves Apple News Format specification compliance based on cross-referencing with official Apple documentation.

Changes

New Components

  • ArticleThumbnail - Custom thumbnail for article feeds (role: article_thumbnail)
  • ArticleTitle - Enhanced title component for feeds (role: article_title)

TextComponent Enhancement

  • Added additions property for applying links to text ranges
  • This enables linking portions of body text without using HTML/Markdown format

MultipartBuilder

  • Added WebP support to MIME type detection (image/webp)

Logo Component

  • Added explicitContent property (was already present on Photo, Image, Figure, Portrait)

Usage Examples

Text with link additions:

$body = new Body('Check out our website for more info.');
$body->setAdditions([
    [
        'type' => 'link',
        'rangeStart' => 14,
        'rangeLength' => 7,
        'URL' => 'https://example.com',
    ],
]);

Article thumbnail:

$thumbnail = ArticleThumbnail::fromBundle('feed-image.jpg')
    ->setAccessibilityCaption('Article preview image');
$article->addComponent($thumbnail);

Tests

  • Added TextComponentAdditionsTest for additions property

Based on code review against Apple's official documentation at developer.apple.com

- Add 'additions' property to TextComponent for link ranges
- Add WebP support to MultipartBuilder MIME detection
- Add 'explicitContent' property to Logo component
- Add ArticleThumbnail component for custom feed images
- Add ArticleTitle component with enhanced formatting
- Add test for TextComponent additions

These changes improve Apple News Format spec compliance.
@tomgould tomgould closed this Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants