Pandoc.jl is a package to make it easier to write filters for Pandoc in Julia.
To install Pandoc.jl, open the Julia package manager prompt and type:
(v1.8) pkg> add Pandoc
julia> using Pandoc
Converter
julia> run(Pandoc.Converter(input = raw"""
# This is a header
This is a paragraph.
""")) |> println
<h1 id="this-is-a-header">This is a header</h1>
<p>This is a paragraph.</p>
Filter
julia> doc = Pandoc.Document(raw"""
# This is a header
This is a paragraph.
""")
julia> for block in doc.blocks
if block isa Pandoc.Header
block.level += 1
end
end
julia> run(Pandoc.Converter(input = doc, to="markdown")) |> println
## This is a header
This is a paragraph.