Sha256: 647d487e7bfcddd562f69bab9cfff83c06fd5fc962260367d12454c38f28dd75

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

- _target, _alt, _width, _height, _format, _link, _reload = (local_attr :target), (local_attr :alt), (local_attr :width), (local_attr :height), (local_attr :format), (local_attr :link), ('true' if option? :reload)
/ QUESTION support default image role?
figure.image id=id class=[role, ('flux' if option? :flux)]
  / TODO append an index/counter to the alt attribute (since it's otherwise shared)
  - _target.split(/[#,]/).each do |_target|
    =newline
    - content_for :img
      - if _format == 'svg' || (_target.include? '.svg') && ((_svg = option? :inline) || (_obj = option? :interactive))
        - case
        - when _svg
          =include_svg _target
        - when _obj
          object type='image/svg+xml' data=(image_uri _target) width=_width height=_height data-reload=_reload
            / TODO support fallback option
            span.alt=_alt
      - else
        img src=(image_uri _target) alt=_alt width=_width height=_height data-reload=_reload
    - if _link
      a.image href=_link
        - yield_content :img
    - else
      - yield_content :img
  - if title?
    =newline
    figcaption=title
  - if local_attr? :credit
    =newline
    / QUESTION sould we use data-credit on <figure> element instead?
    small.credit=local_attr :credit

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asciidoctor-bespoke-1.0.0.alpha.2 templates/slim/image.html.slim