do the same for pandoc exports

remotes/JonasIsensee/exportaswrapper
Jonas Isensee 2020-06-15 20:41:46 +02:00
parent a61ade7778
commit 90d8c8430f
2 changed files with 7 additions and 35 deletions

View File

@ -124,23 +124,9 @@ end
# Pandoc
# ------
Base.@kwdef mutable struct Pandoc2HTML <: HTMLFormat
Base.@kwdef mutable struct Pandoc2HTML <: ExportFormat
description = "HTML via intermediate Pandoc Markdown (requires Pandoc 2)"
extension = "md"
codestart = "\n"
codeend = "\n"
termstart = codestart
termend = codeend
outputstart = "\n"
outputend = "\n"
mimetypes = ["image/png", "image/svg+xml", "image/jpg", "text/html", "text/markdown", "text/plain"]
fig_ext = ".png"
out_width = nothing
out_height = nothing
fig_pos = nothing
fig_env = nothing
# specials
preserve_header = true
primaryformat = Pandoc()
template_path = nothing
stylesheet_path = nothing
highlight_theme = nothing
@ -157,4 +143,4 @@ function set_format_options!(docformat::Pandoc2HTML; template = nothing, css = n
docformat.pandoc_options = pandoc_options
end
render_figures(docformat::Pandoc2HTML, chunk) = render_figures(Pandoc(), chunk)
#render_figures(docformat::Pandoc2HTML, chunk) = render_figures(Pandoc(), chunk)

View File

@ -54,28 +54,14 @@ Base.@kwdef mutable struct Pandoc <: PandocFormat
end
register_format!("pandoc", Pandoc())
const DEFAULT_PANDOC_OPTIONS = String[]
Base.@kwdef mutable struct Pandoc2PDF <: PandocFormat
Base.@kwdef mutable struct Pandoc2PDF <: ExportFormat
description = "PDF via intermediate Pandoc Markdown"
extension = "md"
codestart = "~~~~{.julia}"
codeend = "~~~~~~~~~~~~~\n\n"
termstart = codestart
termend = codeend
outputstart = "~~~~"
outputend = "~~~~\n\n"
# Prefer png figures for markdown conversion, svg doesn't work with latex
mimetypes = ["image/png", "image/jpg", "image/svg+xml", "text/markdown", "text/plain"]
fig_ext = ".png"
out_width = nothing
out_height = nothing
fig_pos = nothing
fig_env = nothing
# specials
preserve_header = true
header_template = normpath(TEMPLATE_DIR, "pandoc2pdf_header.txt")
primaryformat = Pandoc()
pandoc_options = DEFAULT_PANDOC_OPTIONS
header_template = normpath(TEMPLATE_DIR, "pandoc2pdf_header.txt")
end
register_format!("pandoc2pdf", Pandoc2PDF())