diff --git a/src/rendering/common.jl b/src/rendering/common.jl index 538f294..fd9767a 100644 --- a/src/rendering/common.jl +++ b/src/rendering/common.jl @@ -138,7 +138,7 @@ end should_render(chunk) = chunk.options[:echo] && chunk.options[:results] ≠ "hidden" -render_doc(docformat, body, args...) = body +render_doc(docformat, body, doc) = body # utilities # --------- diff --git a/src/rendering/rendering.jl b/src/rendering/rendering.jl index b524963..cab31a7 100644 --- a/src/rendering/rendering.jl +++ b/src/rendering/rendering.jl @@ -16,16 +16,14 @@ register_format!(_, format) = error("Format needs to be a subtype of WeaveFormat set_rendering_options!(doc; kwargs...) = set_rendering_options!(doc.format; kwargs...) -function render_doc(doc) - docformat = doc.format - +function render_doc(doc::WeaveDoc) restore_header!(doc) + docformat = doc.format lines = map(copy(doc.chunks)) do chunk format_chunk(chunk, docformat) end body = join(lines, '\n') - return render_doc(docformat, body, doc) end