-
DescriptionHi Team Quarto, Thanks again for your fast responses over the past few days. I am working to get a filter working as a sort of pre-processor for
I am able to do 1/2 but am stuck on 3/4. Basically, I am not sure of the order of operations (affects 4) or the right pandoc type to return (needed by 3). My example repo is here, my header yaml is below, and my lua code is below. Any suggestions on how to troubleshoot this issue would be highly appreciated. zach cp YAML Header---
title: "About"
filters:
- molviewspec-live
format: live-html
---
Lua Filter FNfunction CodeBlock(el)
function apply_template(template, template_vars)
local file = io.open(quarto.utils.resolve_path("templates/" .. template), "r")
assert(file)
local content = file:read("*a")
for k, v in pairs(template_vars) do
content = string.gsub(content, "{{" .. k .. "}}", v)
end
return content
end
if el.classes and el.classes:includes("molviewspec-live") then
local content = el.text
local updatedmarkdown = apply_template("two_column.qmd", { content = content })
-- return pandoc.RawBlock("markdown", updatedmarkdown)
-- return pandoc.RawBlock("html", updatedmarkdown)
local parsed = pandoc.read(updatedmarkdown, "markdown")
return parsed.blocks
end
return el
end HTML OutputYou can see my markdown is being inlined into HTML without further processing. I don't know if thats an Order-of-operations issue or a pandoc issue (or soemthing else). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Ah, I have a guess to what's happening. Unfortunately, Pandoc doesn't support the following syntax:
Quarto implements that by taking over part of the frontend parsing. If you need to parse Markdown into Pandoc's AST with all of the syntax that Quarto supports, you'll need to use our parsing instead of
I'm not positive that's the cause, but the fact that the HTML starts breaking at around the |
Beta Was this translation helpful? Give feedback.
-
Maybe you can change your strategy and use divs as in the panelize Quarto extension. |
Beta Was this translation helpful? Give feedback.
"the code blocks seem to get parsed however the code blocks themselves are not processed"
I apologize, I think I don't understand very well what you're trying to do, so let me instead describe how Quarto works. Quarto operates in the following approximate order:
dot
andmermaid
) are handledIf your filter creates pyiodide code cells, then it needs to be executed before the pyiodide filter that detects those code cells, and the structure you generate needs to precisely match the expectation of the quartolive package.
If you allow me t…