Skip to content

kdheepak/Pandoc.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc.jl

Status Documentation

Pandoc.jl is a package to make it easier to write filters for Pandoc in Julia.

Install

To install Pandoc.jl, open the Julia package manager prompt and type:

(v1.8) pkg> add Pandoc

Quick Start

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.