Adjust heading level of included document #6695
-
DescriptionI tend to split my documents into separate Quarto files, with the aim of reusing them later on. Suppose the main Quarto document has a section called |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
You can't using the include shortcode as it basically only copy/paste the content into the main document. |
Beta Was this translation helpful? Give feedback.
-
|
You could use the I hope that helps. |
Beta Was this translation helpful? Give feedback.
-
|
Here's a Pandoc filter that does this: -- Shift header levels within a marked container div
-- Usage: ::: {.shift-headings by=1}
-- {{< include file.md >}}
-- :::
function Div(el)
if el.classes:includes("shift-headings") then
local shift = tonumber(el.attributes["by"]) or 1
return el:walk({
Header = function(h)
h.level = h.level + shift
return h
end
})
end
endUsage: ::: {.shift-headings by=1}
{{< include _foo.md >}}
::: |
Beta Was this translation helpful? Give feedback.
Here's a Pandoc filter that does this:
Usage:
::: {.shift-headings by=1} {{< include _foo.md >}} :::