Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-15315] [Swift-DocC] @Image directive requires an explicit file extension while images described in Markdown do not #227

ethan-kusters opened this issue Oct 13, 2021 · 2 comments


Copy link

@ethan-kusters ethan-kusters commented Oct 13, 2021

Previous ID SR-15315
Radar rdar://79140625
Original Reporter @ethan-kusters
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Swift-DocC
Labels Bug, StarterBug
Assignee @Kyle-Ye
Priority Medium

md5: c536abd6e1f81618ac79693f894f0da9

Issue Description:

Swift-DocC generally allows users to describe images with just the filename (ImageName), leaving out the file extension (.png).

For example, if a user included ImageName.png in their documentation catalog, they could refer to it with:

![Image description](ImageName)

However, when referencing images in Tutorials using the @image directive, DocC requires users to be explicit and use the file extension:

@Image(source: "ImageName.png", alt: "Image description")

This is confusing, so we should allow the following syntax:

@Image(source: "ImageName", alt: "Image description")

Copy link

@Kyle-Ye Kyle-Ye commented Oct 15, 2021

Located the bug in Sources/SwiftDocC/Model/Rending/RenderNodeTranslator.swift line 1226

Copy link

@Kyle-Ye Kyle-Ye commented Oct 15, 2021

Pull Request link #3

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 3, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants