PkgPage.jl icon indicating copy to clipboard operation
PkgPage.jl copied to clipboard

Insertion of image in table

Open tlienart opened this issue 4 years ago • 8 comments

It was reported that inserting an image in a table might not work; this would need to be checked whether it's the figure environment which fails (it should though possibly more transparently than it currently does) or whether it's just that if commands are used in a table they're not going to be processed properly (likely) or whether standard markdown for an image also doesn't work (problematic)

tlienart avatar Jul 22 '20 20:07 tlienart

It'd help if we could see the Markdown code which has this issue.

zlatanvasovic avatar Jul 22 '20 21:07 zlatanvasovic

from the slack message:

Is there a way to get an image inside of a markdown table (using PkgPage, maybe different than base Franklin)?
Markdown ![Developing]("/assets/Developing.svg") just shows the alt text Developing and
\figure{path="/assets/Developing.svg", style="border-radius:3px;"}  renders as igure{path="/assets/Developing.svg", style="border-radius:3px;"}

tlienart avatar Jul 23 '20 06:07 tlienart

Did they try using HTML for the image instead?

zlatanvasovic avatar Jul 23 '20 08:07 zlatanvasovic

well that's what I suggested and that's what they ended up using http://juliaactuary.org/ // but I think here the issue is that they weren't sure how to do it so maybe we could test this ourselves first and then add an image in the table example.

tlienart avatar Jul 23 '20 10:07 tlienart

That's one beautiful page! Sure, let's find out what's the problem.

zlatanvasovic avatar Jul 23 '20 10:07 zlatanvasovic

Yeah :-) I'll add it here

tlienart avatar Jul 23 '20 11:07 tlienart

I encountered a similar issue today. I had defined a function

\newcommand{\details}[1]{~~~<details><summary>Abstract</summary> #1 </details>~~~}

tried to call it from inside the \table environment with \details{blah blah}, but it didn't work, it just displayed the plain \details{blah blah}.

Then I tried to manually inject the html inside the table, i.e. manually added ~~~<details><summary>Abstract</summary> blah blah </details>~~~, it just displayed the plain <details><summary>Abstract</summary> blah blah </details>.

Finally, I just put the plain html <details><summary>Abstract</summary> blah blah </details> inside the table and that worked

Hopefully this can help the bug hunt

lucaferranti avatar Nov 03 '21 20:11 lucaferranti

@lucaferranti the thing that's happening is that the table processing is deferred to CommonMark which does it better than Base.Markdown. And so there's some complexity in trying to capture things then sending some content to CommonMark then back to Franklin. Capturing individual cells and seeing if they contain specific commands is a bit annoying (though will be done in Franklin soon).

Thanks for the feedback though, it's definitely something that should work eventually 😄

tlienart avatar Nov 04 '21 08:11 tlienart