API

Pandoc.PandocModule
Pandoc

Pandoc wrapper to read JSON AST from pandoc

See https://hackage.haskell.org/package/pandoc-types-1.23/docs/Text-Pandoc-Definition.html

source
Pandoc.AttrType

Attr: identifier, classes, key-value pairs

  • identifier::String

  • classes::Vector{String}

  • attributes::Vector{Tuple{String, String}}

source
Pandoc.BulletListType

Bullet list (list of items, each a list of blocks)

  • content::Vector{Vector{Pandoc.Block}}
source
Pandoc.CaptionType

The caption of a table or figure, with optional short caption.

  • caption::Pandoc.ShortCaption

  • content::Vector{Pandoc.Block}

source
Pandoc.CellType

A table cell.

  • attr::Pandoc.Attr

  • alignment::Pandoc.Alignment.T

  • rowspan::Int64

  • colspan::Int64

  • content::Vector{Pandoc.Block}

source
Pandoc.CitationType

Citation

  • id::String

  • prefix::Vector{Pandoc.Inline}

  • suffix::Vector{Pandoc.Inline}

  • mode::Pandoc.CitationMode.T

  • note_num::Int64

  • hash::Int64

source
Pandoc.CiteType

Citation (list of inlines)

  • citations::Vector{Pandoc.Citation}

  • content::Vector{Pandoc.Inline}

source
Pandoc.ColSpecType

The specification for a single table column.

  • alignment::Pandoc.Alignment.T

  • colwidth::Pandoc.ColWidth

source
Pandoc.ColWidthType

The width of a table column, as a percentage of the text width.

  • width::Union{Float64, Symbol}
source
Pandoc.ConverterType

This is a Converter options struct. It supports all of pandoc's command line arguments.

You can use it like so:

julia> run(Converter(; input = "# Header level 1"))
"<h1 id="header-level-1">Header level 1</h1>
"

julia> c = Pandoc.Converter(; input = "# Header level 1")
`pandoc`

julia> c.from = "markdown";

julia> c.to = "rst";

julia> c
`pandoc -f markdown -t rst`

julia> run(c)
"Header level 1
==============
"

mutable struct Converter

  • input::Union{String, FilePathsBase.AbstractPath, Pandoc.Document, Vector{<:FilePathsBase.AbstractPath}}

  • from::Union{Nothing, String}

  • to::Union{Nothing, String}

  • output::Union{Nothing, String}

  • defaults::Union{Nothing, String}

  • file_scope::Bool

  • sandbox::Bool

  • data_dir::Union{Nothing, String}

  • template::Union{Nothing, String}

  • metadata::Vector{Tuple{String, String}}

  • metadata_file::Union{Nothing, FilePathsBase.AbstractPath}

  • standalone::Bool

  • variables::Vector{Tuple{String, String}}

  • wrap::Union{Nothing, String}

  • ascii::Bool

  • toc::Bool

  • toc_depth::Union{Nothing, Int64}

  • number_sections::Bool

  • number_offset::Union{Int64, Vector{Int64}}

  • top_level_division::Union{Nothing, String}

  • extract_media::Union{Nothing, FilePathsBase.AbstractPath}

  • resource_path::Union{Nothing, FilePathsBase.AbstractPath}

  • include_in_header::Vector{<:FilePathsBase.AbstractPath}

  • include_before_body::Vector{<:FilePathsBase.AbstractPath}

  • include_after_body::Vector{<:FilePathsBase.AbstractPath}

  • no_highlight::Bool

  • highlight_style::Union{Nothing, String, FilePathsBase.AbstractPath}

  • syntax_definition::Union{Nothing, FilePathsBase.AbstractPath}

  • dpi::Union{Nothing, Int64}

  • eol::Union{Nothing, String}

  • columns::Union{Nothing, Int64}

  • preserve_tabs::Bool

  • tab_stop::Union{Nothing, Int64}

  • pdf_engine::Union{Nothing, String}

  • pdf_engine_opt::Union{Nothing, String}

  • reference_doc::Union{Nothing, FilePathsBase.AbstractPath}

  • self_contained::Bool

  • embed_resources::Bool

  • request_header::Vector{Tuple{String, String}}

  • no_check_certificate::Bool

  • abbreviations::Union{Nothing, FilePathsBase.AbstractPath}

  • indented_code_classes::Union{Nothing, String}

  • default_image_extension::Union{Nothing, String}

  • filter::Vector{String}

  • lua_filter::Vector{<:FilePathsBase.AbstractPath}

  • shift_heading_level_by::Union{Nothing, Int64}

  • base_header_level::Union{Nothing, Int64}

  • track_changes::Union{Nothing, String}

  • strip_comments::Bool

  • reference_links::Bool

  • reference_location::Union{Nothing, String}

  • markdown_headings::Union{Nothing, String}

  • list_tables::Bool

  • listings::Bool

  • incremental::Bool

  • slide_level::Union{Nothing, Int64}

  • section_divs::Bool

  • html_q_tags::Bool

  • email_obfuscation::Union{Nothing, String}

  • id_prefix::Union{Nothing, String}

  • title_prefix::Union{Nothing, String}

  • css::Union{Nothing, String}

  • epub_subdirectory::Union{Nothing, FilePathsBase.AbstractPath}

  • epub_cover_image::Union{Nothing, FilePathsBase.AbstractPath}

  • epub_title_page::Union{Nothing, Bool}

  • epub_metadata::Union{Nothing, FilePathsBase.AbstractPath}

  • epub_embed_font::Union{Nothing, FilePathsBase.AbstractPath}

  • split_level::Union{Nothing, Int64}

  • chunk_template::Union{Nothing, FilePathsBase.AbstractPath}

  • epub_chapter_level::Union{Nothing, Int64}

  • ipynb_output::Union{Nothing, String}

  • citeproc::Bool

  • bibliography::Union{Nothing, FilePathsBase.AbstractPath}

  • csl::Union{Nothing, FilePathsBase.AbstractPath}

  • citation_abbreviations::Union{Nothing, String}

  • natbib::Bool

  • biblatex::Bool

  • mathml::Bool

  • webtex::Union{Nothing, Bool, String}

  • mathjax::Union{Nothing, Bool, String}

  • katex::Union{Nothing, Bool, String}

  • gladtex::Bool

  • trace::Bool

  • dump_args::Bool

  • ignore_args::Bool

  • verbose::Bool

  • quiet::Bool

  • fail_if_warnings::Bool

  • log::Union{Nothing, String}

  • bash_completion::Bool

  • list_input_formats::Bool

  • list_output_formats::Bool

  • list_extensions::Union{Nothing, Bool, String}

  • list_highlight_languages::Bool

  • list_highlight_styles::Bool

  • print_default_template::Union{Nothing, FilePathsBase.AbstractPath}

  • print_default_data_file::Union{Nothing, FilePathsBase.AbstractPath}

  • print_highlight_style::Union{Nothing, String, FilePathsBase.AbstractPath}

source
Pandoc.DefinitionListType

Definition list. Each list item is a pair consisting of a term (a list of inlines) and one or more definitions (each a list of blocks)

  • content::Vector{Pair{Vector{Pandoc.Inline}, Vector{Vector{Pandoc.Block}}}}
source
Pandoc.DivType

Generic block container with attributes

  • attr::Pandoc.Attr

  • content::Vector{Pandoc.Block}

source
Pandoc.DocumentType

Document

  • data::Dict{Symbol, Any}

  • pandoc_api_version::VersionNumber

  • meta::Pandoc.MetaValue

  • blocks::Vector{Pandoc.Block}

source
Pandoc.EmphType

Emphasized text (list of inlines)

  • content::Vector{Pandoc.Inline}
source
Pandoc.FigureType

Figure

  • attr::Pandoc.Attr

  • caption::Pandoc.Caption

  • content::Vector{Pandoc.Block}

source
Pandoc.HeaderType

Header - level (integer) and text (inlines)

  • level::Int64

  • attr::Pandoc.Attr

  • content::Vector{Pandoc.Inline}

source
Pandoc.ImageType

Image: alt text (list of inlines), target

  • attr::Pandoc.Attr

  • content::Vector{Pandoc.Inline}

  • target::Pandoc.Target

source
Pandoc.LinkType

Hyperlink: alt text (list of inlines), target

  • attr::Pandoc.Attr

  • content::Vector{Pandoc.Inline}

  • target::Pandoc.Target

source
Pandoc.ListAttributesType

List attributes.

The first element of the triple is the start number of the list.

  • number::Int64

  • style::Pandoc.ListNumberStyle.T

  • delim::Pandoc.ListNumberDelim.T

source
Pandoc.MathType

TeX math (literal)

  • math_type::Pandoc.MathType.T

  • content::String

source
Pandoc.OrderedListType

Ordered list (attributes and a list of items, each a list of blocks)

  • attr::Pandoc.ListAttributes

  • content::Vector{Vector{Pandoc.Block}}

source
Pandoc.QuotedType

Quoted text (list of inlines)

  • quote_type::Pandoc.QuoteType.T

  • content::Vector{Pandoc.Inline}

source
Pandoc.RowHeadColumnsType

The number of columns taken up by the row head of each row of a 'TableBody'. The row body takes up the remaining columns.

source
Pandoc.ShortCaptionType

A short caption, for use in, for instance, lists of figures.

  • content::Union{Nothing, Vector{Pandoc.Inline}}
source
Pandoc.SpanType

Generic inline container with attributes

  • attr::Pandoc.Attr

  • content::Vector{Pandoc.Inline}

source
Pandoc.StrongType

Strongly emphasized text (list of inlines)

  • content::Vector{Pandoc.Inline}
source
Pandoc.TableType

Table, with attributes, caption, optional short caption, column alignments and widths (required), table head, table bodies, and table foot

  • attr::Pandoc.Attr

  • caption::Pandoc.Caption

  • colspec::Vector{Pandoc.ColSpec}

  • head::Pandoc.TableHead

  • bodies::Vector{Pandoc.TableBody}

  • foot::Pandoc.TableFoot

source
Pandoc.TableBodyType

A body of a table, with an intermediate head, intermediate body, and the specified number of row header columns in the intermediate body.

  • attr::Pandoc.Attr

  • rowheadcolumns::Int64

  • head::Vector{Pandoc.Row}

  • content::Vector{Pandoc.Row}

source
Base.runMethod
run(c::Pandoc.Converter) -> String

Execute command generated by Converter.

Example

julia> run(Pandoc.Converter(input = "# header level 1", from="markdown", to="html"))
"<h1 id="header-level-1">header level 1</h1>
"
source
Pandoc.metadataFunction
metadata(data::Union{String, AbstractPath})
julia> Pandoc.metadata(p"my-unicode-cheat-sheet/index.qmd")
Dict{Symbol, Any} with 7 entries:
  :categories => ["neovim", "python", "julia", "rust"]
  :keywords   => "python, julia, vim, rust, unicode"
  :title      => "My Unicode cheat sheet"
  :summary    => "References for various things associated with unicode in Vim, P…
  :date       => "2020-09-19T02:29:49-06:00"
source