Hi, I'm playing with an idea for quarto, where one could comment out portions of the input document including text and code chunks. This workaround would make use of the trick that 1) Yaml blocks can appear anywhere in a pandoc document, and 2) commented out (#) lines in Yaml are stripped by pandoc (?). I'd like to run a pre-processing step* on the input document to return essentially the same input, but getting rid off those commented out Yaml lines. Consider the following input file, `````` --- title: Comment --- ## Section This is a simple placeholder for the manuscript's main document [@knuth84]. ```{r} x <- 1 + 1 x ``` Note pi is `r pi`. --- # You can embed code like this: # # ```{r} # 1 + 1 # ``` # but beware, is `r .NotYetImplemented()` still executed? --- More text. `````` The commented out portion should be removed before quarto calls the computational engine, otherwise the code still gets executed. I've tried various flavours of markdown, such as > quarto pandoc -t noop.lua -f markdown index.qmd where noop.lua is a dummy Writer doing nothing, ``` function Writer (doc, opts) local filter = { } return pandoc.write(doc:walk(filter), 'markdown', opts) end ```` but I'm not finding the right combination of options, if there is one. Some markdown flavours seem to keep the Yaml comments (not sure why), others reformat the 3-backticks code block. Is this "identity" Writer going to be difficult to achieve? Many thanks, baptiste * Note that code is currently detected via regex in quarto, so it gets executed even inside comments (hence the need of a pre-processor to strip it entirely from the document). See https://github.com/quarto-dev/quarto-cli/discussions/3330 for more context -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9abf1645-7bd2-427c-846e-1b2e7a438760n%40googlegroups.com.