Sha256: d7833831ec78674f396bb899ba6d371b3b8729ed1d871efcb496ef298846c802

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 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 attributes[1] == 'background' || attributes[1] == 'canvas'
  - inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ')
  = html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes)))
    - if attr? :link
      a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
        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

6 entries across 6 versions & 1 rubygems

Version Path
asciidoctor-revealjs-5.0.0.rc1 templates/image.html.slim
asciidoctor-revealjs-4.1.0 templates/image.html.slim
asciidoctor-revealjs-4.1.0.rc5 templates/image.html.slim
asciidoctor-revealjs-4.1.0.rc4 templates/image.html.slim
asciidoctor-revealjs-4.1.0.rc3 templates/image.html.slim
asciidoctor-revealjs-4.1.0.rc2 templates/image.html.slim