Add `render_chunk` and `render_doc` methods

Add `render_chunk` and  `render_doc` methods to `LaTeXMinted`

Suppose to correct the error describes in [issue 389](https://github.com/JunoLab/Weave.jl/issues/389)
pull/453/head
Likan Zhan 2022-03-26 10:23:44 +08:00 committed by GitHub
parent 381de22c7d
commit 02e41f3ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -173,6 +173,15 @@ Base.@kwdef mutable struct LaTeXMinted <: LaTeXFormat
escape_closer = reverse(escape_starter)
end
register_format!("texminted", LaTeXMinted())
render_chunk(docformat::LaTeXMinted, chunk::DocChunk) = join((render_inline(c) for c in chunk.content))
function render_doc(docformat::LaTeXMinted, body, doc)
return Mustache.render(
mt"{{{ :body }}}";
body = body
)
end
# Tex (directly to PDF)
# ---------------------