Including HTML blocks for ipynb format #2076
Unanswered
linogaliana
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Did you try to include your HTML code in an HTML code block?
|
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
Context
I am trying to generate some content in
ipynb
output to generate some callout boxes in Jupyter Notebook (a provisory version before #1167 solves the issue). In Jupyter, you can visualise boxes usingdiv
withalert
class. For instance, the following code:yields :
My questions goes beyond the issue of creating callout boxes (since #1167 that is in Future milestone is supposed to solve that) but is more related to the presence of html blocks when
qmd
->ipynb
.Question 1
In my
.qmd
if I put the below text:when using
quarto render index.qmd --to ipynb
, the blocks<div class="alert alert-danger" role="alert">
and</div>
are not included in myindex.ipynb
. Thus, I just end up with an unformatted markdown cell with the text I wanted in the box.Is the disappearance of
<div ...>
and</div>
an expected behavior ?Question 2
I then tried to change
div
byp
just to see what happens. It yields the same red box in atest.ipynb
draft in a local Jupyter session. However, if I put the text in.qmd
file:this will generate three different blocks in my
ipynb
:<p class="alert alert-danger" role="alert">
in a raw cell</p>
in a raw cellIf everything were in the same cell, the formatting would have worked.
I see that each time
quarto
encounters a<p>
and</p>
, it creates a separated raw cell (instead of a markdown cell). Once again, is it an expected behavior ?Other approach tried
I tried to use the Rmd's custom block functionality:
hoping to end-up with that block in my
ipynb
:As in question 1,
<div ...>
and</div>
are not present.This pandoc's fenced div block is not implemented in
quarto
(foripynb
output at least) ?Beta Was this translation helpful? Give feedback.
All reactions