Sha256: d17620977739a66c6f3569e75ad5a9b78b85799b1f2430830c8bf2a692de98c2

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

- width = (attr? :width) ? (attr :width) : nil
- height = (attr? :height) ? (attr :height) : nil

/ When the stretch class is present, block images will take the most space
/ they can take. Setting width and height can override that.
/ We pinned the 100% to height to avoid aspect ratio breakage and since
/ widescreen monitors are the most popular, chances are that height will
/ be the biggest constraint
- if (has_role? 'stretch') && !((attr? :width) || (attr? :height))
  - height = "100%"

- unless attr(1) == 'background' || attr(1) == "canvas"
  .imageblock(id=@id class=roles
      style=[("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; '))
    - if attr? :link
      a.image href=(attr :link)
        img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil)
    - else
      img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil)
  - if title?
    .title=captioned_title

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
asciidoctor-revealjs-1.0.4 templates/slim/block_image.html.slim
asciidoctor-revealjs-1.0.3 templates/slim/block_image.html.slim
asciidoctor-revealjs-1.0.2 templates/slim/block_image.html.slim
asciidoctor-revealjs-1.0.1 templates/slim/block_image.html.slim
asciidoctor-revealjs-1.0.0 templates/slim/block_image.html.slim