Skip to content

opt-in HTML render#51

Merged
johnnychen94 merged 1 commit intomasterfrom
jc/opthtml
May 12, 2022
Merged

opt-in HTML render#51
johnnychen94 merged 1 commit intomasterfrom
jc/opthtml

Conversation

@johnnychen94
Copy link
Copy Markdown
Member

@johnnychen94 johnnychen94 commented May 12, 2022

This is a quick patch to "fix" the Pluto compatibility issue #50 (comment)

Since this may affect potentially too many pluto notebooks, I decide to make it an opt-in feature. Eventually this will be opt-out when things get better supported. @lorenzoh Will this be okay to you?

cc: @fonsp @lorenzh

@codecov
Copy link
Copy Markdown

codecov bot commented May 12, 2022

Codecov Report

Merging #51 (b0e7d1c) into master (6403896) will decrease coverage by 0.69%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
- Coverage   87.98%   87.28%   -0.70%     
==========================================
  Files           6        6              
  Lines         233      236       +3     
==========================================
+ Hits          205      206       +1     
- Misses         28       30       +2     
Impacted Files Coverage Δ
src/ImageShow.jl 25.00% <33.33%> (+25.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6403896...b0e7d1c. Read the comment docs.

@fonsp
Copy link
Copy Markdown
Contributor

fonsp commented May 12, 2022

Thanks! @lorenzoh let's have a short call to discuss?

@johnnychen94
Copy link
Copy Markdown
Member Author

Send me an invitation (slack Johnny Chen) if you like; I'm also interested in the new Pollen.jl system :)

@lorenzoh
Copy link
Copy Markdown
Contributor

Sure, this is fine! Was thinking it may break some packages 🙈 so let's unbreak for the time being!

@johnnychen94 johnnychen94 merged commit e75afdd into master May 12, 2022
@johnnychen94 johnnychen94 deleted the jc/opthtml branch May 12, 2022 10:11
@fonsp
Copy link
Copy Markdown
Contributor

fonsp commented May 17, 2022

Thanks @johnnychen94 and @lorenzoh for the quick response and fix!

After our call, and after thinking about it for a bit, I changed my mind, and think that #50 was in fact a cool new feature, also outside of Pollen.jl, and we should turn it on by default (i.e. reverting this PR). I will add a special case for displaying Matrix{<:Colorant} to Pluto itself, just like we did for Plots.jl + GR, so that we get the best of both worlds, without this error-prone configuration option. 🌟

@johnnychen94
Copy link
Copy Markdown
Member Author

johnnychen94 commented May 17, 2022

After our call, and after thinking about it for a bit

I was trying to switch to iPad to get a camera but then got blocked in the waiting room with neither of you noticed 😂


think that #50 was in fact a cool new feature, also outside of Pollen.jl, and we should turn it on by default (i.e. reverting this PR). I will add a special case for displaying Matrix{<:Colorant} to Pluto itself, just like we did for JuliaPluto/Pluto.jl#1090, so that we get the best of both worlds, without this error-prone configuration option. 🌟

I'll leave it to you to make the PR when Pluto is ready and then I can merge.

@fonsp
Copy link
Copy Markdown
Contributor

fonsp commented May 17, 2022

blocked in the waiting room with neither of you noticed

Oh no!! Very sorry! We didn't notice 😵‍💫

@fonsp
Copy link
Copy Markdown
Contributor

fonsp commented May 17, 2022

Also! I still think that the downscaling done by the HTML show method can be confusing, because it happens secretly, and it is not possible to control this behaviour. I had to read the ImageShow source code to understand why my dogs were being blurred.

Perhaps this should only happen when the user asks for it explicitly. E.g.

HypertextLiteral.@htl """
<p>Here is the original image:</p>
$(image)
<p>This one will be downscaled if it is too big:</p>
$(ImageShow.preview(image))
"""

(I do not think that this should be a global switch like ImageShow.enable_preview(), because this breaks some composability and introduces a hidden dependency.)

What do you think?

@fonsp
Copy link
Copy Markdown
Contributor

fonsp commented May 17, 2022

Ready! (You don't need to wait for the Pluto PR to be released, nor vice versa.)
JuliaPluto/Pluto.jl#2108
#52

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

Successfully merging this pull request may close these issues.

3 participants