-
Notifications
You must be signed in to change notification settings - Fork 140
@Image seems to be ignored in Articles, one has to use ![]() #274
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
Comments
@image and alike are Block Directive elements only avaiable for Swift-DocC's tutorial files. I do not think we should support it in normal markdown file. Maybe the best we can do is add a warning to indict this for possible misuse. But if we add this warning and someone really wants the "@image (source:" in text form, should we add the ability to suppress this warning(via a flag)? cc @franklinsch |
Issuing a warning sounds good to me -- as long as we do something to inform that "this indeed is intended to not work" with a warning 👍 |
A warning and a fix-it to help you convert to the plain Markdown syntax would be great indeed! cc @binamaniar |
Oh, in fact, you've even already implemented the fix-it 😄 https://github.com/apple/swift-docc/pull/278/files#diff-847d4b05a98aad06680f5d1bac967b919be24832c16332a5a324bb89d0f4c589R42 |
Should we consider just supporting Markdown's image syntax is one of the things I see newcomers to Markdown get tripped up on the most and Of course, Swift-DocC should continue to support the plain Markdown syntax, but if a user reaches for the |
I believe the initial motivation for |
-1 for this. Personally, I do not think Since eg.
We can make |
DocC emits variant information (dark, 2x, etc.) for images in |
Right as @franklinsch said- the |
Got it. One more question here. How we should treat the external link for |
Hmm, I don't think there would be a way for DocC to find what variants are available automatically. However, if you could manually specify the available variants of images, I think that'd be nice. This would require more arguments so that @Image(source: "https://example.com/a.png", alt: "Alt text") {
@Variant(trait: "dark@2x", source: "https://example.com/a-dark.png")
} |
Let's summary on what we agree on
Any suggestion or supplement on the above summary is welcomed. |
Cool, looking forward to the |
Mark this is closed since #381 is merged and should fix this issue. |
Cool, looking forward to trying that out 👍 |
You can try it with swift-DEVELOPMENT-SNAPSHOT-2022-10-03-a. Or just clone the latest swift-docc and swift-docc-render(This is needed for Image/Video caption support). |
While reading abut docc one learns about directives and
@Image
so one wants to use it... yet it does not seem to work in Articles, and one has to resort to the markdown method![]()
this is rather confusing, as no warning is issued about the "wrong" use or anything else, leading one to dig through and start guessing if one messed up paths, names or something else.Expected behavior
Option 1: Can we make
@Image(source:
work in articles, in addition to the markdown style?Option 2: Actually banning
@Image
could be an option as in Articles it might be better to use![]()
? But then we should issue warnings when this not supported use is detected.Actual behavior
When using
@Image(source: "example.png", alt: "...")
nothing happens, not even an empty<img>
is rendered.Steps to Reproduce
Make some article, and use @image in it; I did so in the following PR and it did not work: apple/swift-distributed-actors@0262b75 (open source package)
rdar://94284119
The text was updated successfully, but these errors were encountered: