Display image urls as images in table cells#502
Display image urls as images in table cells#502etareduction wants to merge 7 commits intolivebook-dev:mainfrom
Conversation
|
Hey! Unfortunately, I don't think we should be doing a synchronous request before rendering the table, and I would prefer to avoid extra dependencies unless strictly necessary. Also, the user may still prefer to render those as actual URLs. If we are to support it, I think it should be explicit and opt-in. It can be an option like this: Kino.DataTable.new(..., types: %{key1: "image"})And type must match one of the supported ones. |
|
Hello. I thought about this problem for a while, and got some ideas like what you're saying but didn't want to change the API in any significant way like adding new configuration options without consulting with someone. What you've shown seems alright to me, i can try re-implementing it this way.
Also i have updated the types list doc already in this PR. |
|
Sounds good!
Oh yes, what I meant is that we would need to check the |
…e overrides via opts
|
@jonatanklosko |
|
@etareduction looks good to me! It would be good to add a test for this as well. It can be similar to this: kino/test/kino/data_table_test.exs Lines 155 to 167 in 8d23de1 We can pass the |
URL's that point to images are now detected by MIME type using HEAD request, and then displayed in the table cell.