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
Inline images don't have a scaledwidth with docbook5 output #4552
Comments
The scaledwidth attribute value is, in fact, carried through. However, it gets remapped to the |
The
yields
while the documentation reads
This behavior breaks pandoc's DOCX export, as it requires the |
I see where the confusion is. The scaledwidth is honored for block images, but not for inline images. (In the back of my mind, I just assumed that what was done for a block image was done for an inline image, but on closer examination that's not the case). You can see that the DocBook converter never checks for the scaledwidth attribute when converting an inline image. https://github.com/asciidoctor/asciidoctor/blob/main/lib/asciidoctor/converter/docbook5.rb#L556-L557 The reason this is the case is because Asciidoctor's predecessor (AsciiDoc.py) never supported scaledwidth on inline images. However, Asciidoctor PDF does...so it's reasonable to expect that the DocBook converter does too. Note that the only time an inline image should be used is when it's in the middle of a paragraph or a normal table cell. It should never be used in place of a block image. |
My use case is a documentation of an app. I need to add screenshots of the app to show the different features. I like to have them side by side, so that I can put more than 2 screenshots on a page - right now I scale them so that I can put 4 of them in 1 row. This allows me to put the screenshots together with the description text on one page of the DOCX document. It's internal technical documentation, so we care more about tracking it in Git than the styling. From your answer I understand that I could use tables, but this feels wrong to me. Still, I'll use what is there. |
I wasn't disagreeing that this should be added. Since you mixed block and inline images in the example you provided, I thought you were suggesting that scaledwidth was not supported at all. But when I examined it closer, I realized you were making a distinction between the two image macros. (To your credit, you did write "inline images" in the subject). I'm going to add support for scaledwidth for inline images in the next point release. |
…butes on inline image macro in DocBook output
…line image macro in DocBook output (PR #4554)
…es on inline image macro in DocBook output
If I use
scaledwidth
on an inline image like this.then the resulting DocBook5 xml lacks the
width
attribute:Longer example:
yields
Asciidoctor 2.0.20 [https://asciidoctor.org]
Runtime Environment (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
Sample project (you need a PNG to actually run it - any one will work): inline-image-scale.zip
The text was updated successfully, but these errors were encountered: