mirror of https://github.com/mpastell/Weave.jl
preserve header when weaving to Hugo markdown
parent
58bc741b7f
commit
f86f5a7bd0
|
@ -98,9 +98,11 @@ function render_doc(formatted, doc, format::JMarkdown2tex)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: is there any other format where we want to restore headers ?
|
||||||
|
const HEADER_PRESERVE_DOCTYPES = ("github", "hugo")
|
||||||
|
|
||||||
function restore_header!(doc)
|
function restore_header!(doc)
|
||||||
# TODO: is there any other format where we want to restore headers ?
|
doc.doctype in HEADER_PRESERVE_DOCTYPES || return # don't restore
|
||||||
doc.doctype ≠ "github" && return
|
|
||||||
|
|
||||||
# only strips Weave headers
|
# only strips Weave headers
|
||||||
delete!(doc.header, WEAVE_OPTION_NAME)
|
delete!(doc.header, WEAVE_OPTION_NAME)
|
||||||
|
|
Loading…
Reference in New Issue