Open andrewpbray opened 3 weeks ago
When our lua filter encounters the layout div, in the AST the code cell looks like:
Div {.cell cr-id="big-code" layout-ncol="2"} Blocks:
That is, it separates the code into different CodeBlocks based on the lines that produce output, then interleaves those CodeBlocks with output (3 images and a CodeBlock to print the dataframe).
At the end of our lua filter, the whole DivAbove is wrapped into two more Divs:
Div {.sticky-col} Blocks:
That looks about right! The fact that in the flat html format the CodeBlock is not separated and interleaved into the output suggests the filter for layout-ncol
runs after our filter does to rearrange those blocks. That rearrangement must be breaking out Div wrapper structure.
Next steps: write a separate lua filter that runs late to see if we can catch the AST post-layout filter.
@jimjam-slam Oy, this was a deep cut:
https://github.com/quarto-dev/quarto-cli/discussions/10174
I think the issue is that we're looking for cr-id's which no longer are parents to the CodeBlock, so it gets treated as a separate thing.
Dang, nice work on the diagnosis!
In
format: html
, the following document will first show the echoed code, then a two column layout with a total of three plots and a data frame. Informat: closeread-html
, the echoed code shows up after the two column layout.