Skip to content
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

uniform use of image_uri #67

Closed
obilodeau opened this issue Apr 13, 2016 · 2 comments
Closed

uniform use of image_uri #67

obilodeau opened this issue Apr 13, 2016 · 2 comments

Comments

@obilodeau
Copy link
Member

While looking for a way to get a list of all images so I can easily package a presentation for the web, I realized that we don't use image_uri anywhere.

$ grep -rn background-image asciidoctor-reveal.js/
asciidoctor-reveal.js/templates/slim/document.html.slim:73:          - bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil
asciidoctor-reveal.js/templates/slim/document.html.slim:80:            data-background-image=bg_image
asciidoctor-reveal.js/templates/slim/section.html.slim:5:    section id=(hide_title ? nil : @id) data-state=(attr 'data-state') data-transition=(attr 'data-transition') data-transition-speed=(attr 'data-transition-speed') data-background=(attr 'data-background') data-background-size=(attr 'data-background-size') data-background-repeat=(attr 'data-background-repeat') data-background-transition=(attr 'data-background-transition') data-background-image=(attr 'data-background-image')
asciidoctor-reveal.js/templates/slim/section.html.slim:14:  section id=(hide_title ? nil : @id) data-state=(attr 'data-state') data-transition=(attr 'data-transition') data-transition-speed=(attr 'data-transition-speed') data-background=(attr 'data-background') data-background-size=(attr 'data-background-size') data-background-repeat=(attr 'data-background-repeat') data-background-transition=(attr 'data-background-transition') data-background-image=(attr 'data-background-image')

vs

$ grep -rn image_uri asciidoctor-reveal.js/
asciidoctor-reveal.js/templates/slim/inline_image.html.slim:19:    - src = (@type == 'icon' ? (icon_uri @target) : (image_uri @target))
asciidoctor-reveal.js/templates/slim/document.html.slim:73:          - bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil
asciidoctor-reveal.js/templates/slim/block_image.html.slim:6:        img src=image_uri(attr :target) alt=(attr :alt) width=(attr :width) height=(attr :height) style=((attr? :background) ? "background: #{attr :background}" : nil)
asciidoctor-reveal.js/templates/slim/block_image.html.slim:8:      img src=image_uri(attr :target) alt=(attr :alt) width=(attr :width) height=(attr :height) style=((attr? :background) ? "background: #{attr :background}" : nil)

It looks like we forgot to use it in section templates' data-background-image cases.

Reading image_uri's documentation I have the feeling we should be using that everywhere.

Opened the ticket as a reminder to fix this later.

@mojavelinux
Copy link
Member

I believe that the switch to image_uri is coming as part of #52.

@obilodeau
Copy link
Member Author

This will be fixed by PR #52 which will get merged once reviewed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants