Skip to content

How do I generate two column format with python? #12684

Answered by gordonwoodhull
stefaniecg asked this question in Q&A
Discussion options

You must be logged in to vote

Quarto's Jupyter engine will output each display(Markdown(...)) in its own fenced div block.

To debug this, you can see what happens with keep-md:true and look at the .html.md output.

So if you want to build fenced divs programmatically, the easiest (and perhaps only) way is to put it all in one Markdown string,

This works:

```{python}
from IPython.display import display, Markdown
display(Markdown("""
## I need to be able to generate it like this
::: {layout-ncol=2}
column1

column2
:::
"""))
```

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@stefaniecg
Comment options

@cderv
Comment options

Answer selected by stefaniecg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants