.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Pandoc::Elements 3pm" .TH Pandoc::Elements 3pm "2017-03-31" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Pandoc::Elements \- create and process Pandoc documents .SH "SYNOPSIS" .IX Header "SYNOPSIS" The output of this script \f(CW\*(C`hello.pl\*(C'\fR .PP .Vb 2 \& use Pandoc::Elements; \& use JSON; \& \& print Document( \& { \& title => MetaInlines [ Str "Greeting" ] \& }, \& [ \& Header( 1, attributes { id => \*(Aqtop\*(Aq }, [ Str \*(AqHello\*(Aq ] ), \& Para [ Str \*(AqHello, world!\*(Aq ], \& ], \& api_version => \*(Aq1.17.0.4\*(Aq \& )\->to_json; .Ve .PP can be converted for instance to \s-1HTML\s0 via .PP .Vb 1 \& ./hello.pl | pandoc \-f json \-t html5 \-\-standalone .Ve .PP an equivalent Pandoc Markdown document would be .PP .Vb 3 \& % Greeting \& # Gru\*8 {.de} \& Hello, world! .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Pandoc::Elements provides utility functions to parse, serialize, and modify abstract syntax trees (\s-1AST\s0) of Pandoc documents. Pandoc can convert this data structure to many other document formats, such as \s-1HTML,\s0 LaTeX, \s-1ODT,\s0 and ePUB. .PP See also module Pandoc::Filter, command line script pod2pandoc, and the internal modules Pandoc::Walker and Pod::Simple::Pandoc. .SH "PANDOC VERSIONS" .IX Header "PANDOC VERSIONS" The Pandoc document model is defined in file Text.Pandoc.Definition as part of Haskell package pandoc-types . .PP Pandoc::Elements is compatible with pandoc-types 1.12.3 (released with pandoc 1.12.1) up to \fIat least\fR pandoc\-types\-1.17.0.4 (first releases with pandoc 1.18). \s-1JSON\s0 output of all pandoc releases since 1.12.1 can be parsed with function \f(CW\*(C`pandoc_json\*(C'\fR, the \*(L"Document\*(R" constructor or method \f(CW\*(C`parse\*(C'\fR of module Pandoc. The \s-1AST\s0 is always upgraded to pandoc-types 1.17 and downgraded to another api version on serialization with \f(CW\*(C`to_json\*(C'\fR. .PP To determine the api version required by a version of pandoc executable since version 1.18 execute pandoc with the \f(CW\*(C`\-\-version\*(C'\fR option and check which version of the \f(CW\*(C`pandoc\-types\*(C'\fR library pandoc was compiled with. .PP Beginning with version 1.18 pandoc will not decode a \s-1JSON AST\s0 representation unless the major and minor version numbers (Document method \f(CW\*(C`api_version\*(C'\fR) match those built into that version of pandoc. The following changes in pandoc document model have been implemented: .IP "\(bu" 4 pandoc-types 1.17, released for pandoc 1.18, introduced the LineBlock element and modified representation of the root Document element. .IP "\(bu" 4 pandoc-types 1.16, released with pandoc 1.16, introduced attributes to Link and Image elements .IP "\(bu" 4 pandoc-types 1.12.3, released with pandoc 1.12.1, modified the representation of elements to objects with field \f(CW\*(C`t\*(C'\fR and \f(CW\*(C`c\*(C'\fR. This is also the internal representation of documents used in this module. .SH "FUNCTIONS" .IX Header "FUNCTIONS" The following functions and keywords are exported by default: .IP "\(bu" 4 Constructors for all Pandoc document element (block elements such as \f(CW\*(C`Para\*(C'\fR and inline elements such as \f(CW\*(C`Emph\*(C'\fR, metadata elements and the Document). .IP "\(bu" 4 Type keywords such as \f(CW\*(C`Decimal\*(C'\fR and \f(CW\*(C`LowerAlpha\*(C'\fR to be used as types in other document elements. .IP "\(bu" 4 The following helper functions \f(CW\*(C`pandoc_json\*(C'\fR, \f(CW\*(C`pandoc_version\*(C'\fR, \&\f(CW\*(C`attributes\*(C'\fR, \f(CW\*(C`metadata\*(C'\fR, \f(CW\*(C`citation\*(C'\fR, and \f(CW\*(C`element\*(C'\fR. .ie n .SS "pandoc_json $json" .el .SS "pandoc_json \f(CW$json\fP" .IX Subsection "pandoc_json $json" Parse a \s-1JSON\s0 string, as emitted by pandoc in \s-1JSON\s0 format. This is the reverse to method \f(CW\*(C`to_json\*(C'\fR but it can read both old (before Pandoc 1.16) and new format. .ie n .SS "attributes { key => $value, ... }" .el .SS "attributes { key => \f(CW$value\fP, ... }" .IX Subsection "attributes { key => $value, ... }" Maps a hash reference or instance of Hash::MultiValue into the internal structure of Pandoc attributes. The special keys \f(CW\*(C`id\*(C'\fR (string), and \f(CW\*(C`class\*(C'\fR (string or array reference with space-separated class names) are recognized. See attribute methods for details. .SS "citation { ... }" .IX Subsection "citation { ... }" A citation as part of document element Cite must be a hash reference with fields \f(CW\*(C`citationID\*(C'\fR (string), \f(CW\*(C`citationPrefix\*(C'\fR (list of inline elements) \f(CW\*(C`citationSuffix\*(C'\fR (list of inline elements), \f(CW\*(C`citationMode\*(C'\fR (one of \f(CW\*(C`NormalCitation\*(C'\fR, \&\f(CW\*(C`AuthorInText\*(C'\fR, \f(CW\*(C`SuppressAuthor\*(C'\fR), \f(CW\*(C`citationNoteNum\*(C'\fR (integer), and \&\f(CW\*(C`citationHash\*(C'\fR (integer). The helper method \f(CW\*(C`citation\*(C'\fR can be used to construct such hash by filling in default values and using shorter field names (\f(CW\*(C`id\*(C'\fR, \f(CW\*(C`prefix\*(C'\fR, \f(CW\*(C`suffix\*(C'\fR, \f(CW\*(C`mode\*(C'\fR, \f(CW\*(C`note\*(C'\fR, and \f(CW\*(C`hash\*(C'\fR): .PP .Vb 5 \& citation { \& id => \*(Aqfoo\*(Aq, \& prefix => [ Str "see" ], \& suffix => [ Str "p.", Space, Str "42" ] \& } \& \& # in Pandoc Markdown \& \& [see @foo p. 42] .Ve .ie n .SS "pandoc_version( [ $document ] )" .el .SS "pandoc_version( [ \f(CW$document\fP ] )" .IX Subsection "pandoc_version( [ $document ] )" Return a Pandoc::Version object with expected version number of pandoc executable to be used for serializing documents with to_json. .PP If a Document element is given as argument, the minimal pandoc release version compatible with its api version is returned. .PP Without argument, package variable \f(CW$PANDOC_VERSION\fR is checked for a preferred pandoc release. By default this variable is set from an environment variable of same name. If no preferred pandoc release has been specified, the function returns version 1.18 because this is the first pandoc release compatible with most recent api version supported by this module. .PP See also method \f(CW\*(C`version\*(C'\fR of module Pandoc to get the current version of pandoc executable on your system. .ie n .SS "element( $name => $content )" .el .SS "element( \f(CW$name\fP => \f(CW$content\fP )" .IX Subsection "element( $name => $content )" Create a Pandoc document element of arbitrary name. This function is only exported on request. .SH "ELEMENTS AND METHODS" .IX Header "ELEMENTS AND METHODS" Document elements are encoded as Perl data structures equivalent to the \s-1JSON\s0 structure, emitted with pandoc output format \f(CW\*(C`json\*(C'\fR. This \s-1JSON\s0 structure is subject to minor changes between versions of pandoc. All elements are blessed objects that provide common element methods (all elements), attribute methods (elements with attributes), and additional element-specific methods. .SS "\s-1COMMON METHODS\s0" .IX Subsection "COMMON METHODS" \fIto_json\fR .IX Subsection "to_json" .PP Return the element as \s-1JSON\s0 encoded string. The following are equivalent: .PP .Vb 2 \& $element\->to_json; \& JSON\->new\->utf8\->canonical\->convert_blessed\->encode($element); .Ve .PP The serialization format can be adjusted to different pandoc versions with module and environment variable \f(CW\*(C`PANDOC_VERSION\*(C'\fR or with Document element properties \f(CW\*(C`api_version\*(C'\fR and \f(CW\*(C`pandoc_version\*(C'\fR. .PP When writing filters you can normally just rely on the api version value obtained from pandoc, since pandoc expects to receive the same \s-1JSON\s0 format as it emits. .PP \fIname\fR .IX Subsection "name" .PP Return the name of the element, e.g. \*(L"Para\*(R" for a paragraph element. .PP \fIcontent\fR .IX Subsection "content" .PP Return the element content. For most elements (Para, Emph, Str...) the content is an array reference with child elements. Other elements consist of multiple parts; for instance the Link element has attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR) a link text (\f(CW\*(C`content\*(C'\fR) and a link target (\f(CW\*(C`target\*(C'\fR) with \f(CW\*(C`url\*(C'\fR and \f(CW\*(C`title\*(C'\fR. .PP \fIis_block\fR .IX Subsection "is_block" .PP True if the element is a Block element .PP \fIis_inline\fR .IX Subsection "is_inline" .PP True if the element is an inline Inline element .PP \fIis_meta\fR .IX Subsection "is_meta" .PP True if the element is a Metadata element .PP \fIis_document\fR .IX Subsection "is_document" .PP True if the element is a Document element .PP \fIwalk(...)\fR .IX Subsection "walk(...)" .PP Walk the element tree with Pandoc::Walker .PP \fIquery(...)\fR .IX Subsection "query(...)" .PP Query the element to extract results with Pandoc::Walker .PP \fItransform(...)\fR .IX Subsection "transform(...)" .PP Transform the element tree with Pandoc::Walker .PP \fIstring\fR .IX Subsection "string" .PP Returns a concatenated string of element content, leaving out all formatting. .SS "\s-1ATTRIBUTE METHODS\s0" .IX Subsection "ATTRIBUTE METHODS" Some elements have attributes which can be an identifier, ordered class names and ordered key-value pairs. Elements with attributes provide the following methods: .PP \fIattr\fR .IX Subsection "attr" .PP Get or set the attributes in Pandoc internal structure: .PP .Vb 1 \& [ $id, [ @classes ], [ [ key => $value ], ... ] ] .Ve .PP See helper function attributes to create this structure. .PP \fIkeyvals\fR .IX Subsection "keyvals" .PP Get all attributes (id, class, and key-value pairs) as new Hash::MultiValue instance, or replace \fIall\fR key-value pairs plus id and/or class if these are included as field names. All class fields are split by whitespaces. .PP .Vb 6 \& $e\->keyvals # return new Hash::MultiValue \& $e\->keyvals( $HashMultiValue ) # update by instance of Hash::MultiValue \& $e\->keyvals( key => $value, ... ) # update by list of key\-value pairs \& $e\->keyvals( \e%hash ) # update by hash reference \& $e\->keyvals( { } ) # remove all key\-value pairs \& $e\->keyvals( id => \*(Aq\*(Aq, class => \*(Aq\*(Aq ) # remove all key\-value pairs, id, class .Ve .PP \fIid\fR .IX Subsection "id" .PP Get or set the identifier. See also Pandoc::Filter::HeaderIdentifiers for utility functions to handle Header identifiers. .PP \fIclass\fR .IX Subsection "class" .PP Get or set the list of classes, separated by whitespace. .PP \fIadd_attribute( \f(CI$name\fI => \f(CI$value\fI )\fR .IX Subsection "add_attribute( $name => $value )" .PP Append an attribute. The special attribute names \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`class\*(C'\fR set or append identifier or class, respectively. .SS "\s-1DOCUMENT ELEMENT\s0" .IX Subsection "DOCUMENT ELEMENT" \fIDocument\fR .IX Subsection "Document" .PP Root element, consisting of metadata hash (\f(CW\*(C`meta\*(C'\fR), document element array (\f(CW\*(C`content\*(C'\fR=\f(CW\*(C`blocks\*(C'\fR) and optional \f(CW\*(C`api_version\*(C'\fR. The constructor accepts either two arguments and an optional named parameter \f(CW\*(C`api_version\*(C'\fR: .PP .Vb 1 \& Document { %meta }, [ @blocks ], api_version => $version_string .Ve .PP or a hash with three fields for metadata, document content, and an optional pandoc \s-1API\s0 version: .PP .Vb 5 \& { \& meta => { %metadata }, \& blocks => [ @content ], \& pandoc\-api\-version => [ $major, $minor, $revision ] \& } .Ve .PP The latter form is used as pandoc \s-1JSON\s0 format since pandoc release 1.18. If no api version is given, it will be set 1.17 which was also introduced with pandoc release 1.18. .PP A third (\*(L"old\*(R") form is accepted for compatibility with pandoc \s-1JSON\s0 format before release 1.18 and since release 1.12.1: an array with two elements for metadata and document content respectively. .PP .Vb 1 \& [ { unMeta => { %meta } }, [ @blocks ] ] .Ve .PP The api version is set to 1.16 in this case, but older versions down to 1.12.3 used the same format. .PP Document elements provide the following special methods in addition to common element methods: .IP "\fBapi_version( [ \f(CB$api_version\fB ] )\fR" 4 .IX Item "api_version( [ $api_version ] )" Return the pandoc-types version (aka \*(L"pandoc-api-version\*(R") of this document as Pandoc::Version object or sets it to a new value. This version determines how method to_json serializes the document. .Sp See \*(L"\s-1PANDOC VERSIONS\*(R"\s0 for details. .IP "\fBpandoc_version( [ \f(CB$pandoc_version\fB ] )\fR" 4 .IX Item "pandoc_version( [ $pandoc_version ] )" Return the minimum required version of pandoc executable compatible with the api_version of this document. The following are equivalent: .Sp .Vb 2 \& $doc\->pandoc_version; \& pandoc_version( $doc ); .Ve .Sp If used as setter, sets the api version of this document to be compatible with the given pandoc version. .IP "\fBcontent\fR or \fBblocks\fR" 4 .IX Item "content or blocks" Get or set the array of block elements of the document. .IP "\fBmeta( [ \f(CB$metadata\fB ] )\fR" 4 .IX Item "meta( [ $metadata ] )" Get and/or set document metadata elements. .IP "\fBmetavalue( [ \f(CB$field\fB ] )\fR" 4 .IX Item "metavalue( [ $field ] )" Shortcut for \f(CW\*(C`meta\->value\*(C'\fR. .IP "\fBto_pandoc( [ [ \f(CB$pandoc\fB, ] \f(CB@arguments\fB ])\fR" 4 .IX Item "to_pandoc( [ [ $pandoc, ] @arguments ])" Process the document with Pandoc executable and return its output: .Sp .Vb 2 \& $doc\->to_pandoc( \-o => \*(Aqdoc.html\*(Aq ); \& my $markdown = $doc\->to_pandoc( \-t => \*(Aqmarkdown\*(Aq ); .Ve .Sp The first argument can optionally be an instance of Pandoc to use a specific executable. .IP "\fBto_...( [ \f(CB@arguments\fB ] )\fR" 4 .IX Item "to_...( [ @arguments ] )" Process the document into \f(CW\*(C`markdown\*(C'\fR (pandoc's extended Markdown), \f(CW\*(C`latex\*(C'\fR (LaTeX), \f(CW\*(C`html\*(C'\fR (\s-1HTML\s0), \f(CW\*(C`rst\*(C'\fR (reStructuredText), or \f(CW\*(C`plain\*(C'\fR (plain text). The following are equivalent: .Sp .Vb 2 \& $doc\->to_markdown( @args ); \& $doc\->to_pandoc( @args, \*(Aq\-t\*(Aq => \*(Aqmarkdown\*(Aq ); .Ve .IP "\fBoutline( [ \f(CB$depth\fB ] )\fR" 4 .IX Item "outline( [ $depth ] )" Returns an outline of the document structure based on Header elements. The outline is a hierarchical hash reference with the following fields: .RS 4 .IP "header" 4 .IX Item "header" Header element (not included at the document root) .IP "blocks" 4 .IX Item "blocks" List of block elements before the next Header element (of given depth or less if a maximum depth was given) .IP "sections" 4 .IX Item "sections" List of subsections, each having the same outline structure. .RE .RS 4 .RE .SS "\s-1BLOCK ELEMENTS\s0" .IX Subsection "BLOCK ELEMENTS" \fIBlockQuote\fR .IX Subsection "BlockQuote" .PP Block quote, consisting of a list of blocks (\f(CW\*(C`content\*(C'\fR) .PP .Vb 1 \& BlockQuote [ @blocks ] .Ve .PP \fIBulletList\fR .IX Subsection "BulletList" .PP Unnumbered list of items (\f(CW\*(C`content\*(C'\fR=\f(CW\*(C`items\*(C'\fR), each a list of blocks .PP .Vb 1 \& BulletList [ [ @blocks ] ] .Ve .PP \fICodeBlock\fR .IX Subsection "CodeBlock" .PP Code block (literal string \f(CW\*(C`content\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \&\f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR) .PP .Vb 1 \& CodeBlock $attributes, $content .Ve .PP \fIDefinitionList\fR .IX Subsection "DefinitionList" .PP Definition list, consisting of a list of pairs (\f(CW\*(C`content\*(C'\fR=\f(CW\*(C`items\*(C'\fR), each a term (\f(CW\*(C`term\*(C'\fR, a list of inlines) and one or more definitions (\f(CW\*(C`definitions\*(C'\fR, a list of blocks). .PP .Vb 1 \& DefinitionList [ @definitions ] \& \& # each item in @definitions being a pair of the form \& \& [ [ @inlines ], [ @blocks ] ] .Ve .PP \fIDiv\fR .IX Subsection "Div" .PP Generic container of blocks (\f(CW\*(C`content\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR). .PP .Vb 1 \& Div $attributes, [ @blocks ] .Ve .PP \fIHeader\fR .IX Subsection "Header" .PP Header with \f(CW\*(C`level\*(C'\fR (integer), attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`class\*(C'\fR, \&\f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR), and text (\f(CW\*(C`content\*(C'\fR, a list of inlines). .PP .Vb 1 \& Header $level, $attributes, [ @inlines ] .Ve .PP \fIHorizontalRule\fR .IX Subsection "HorizontalRule" .PP Horizontal rule .PP .Vb 1 \& HorizontalRule .Ve .PP \fILineBlock\fR .IX Subsection "LineBlock" .PP List of lines (\f(CW\*(C`content\*(C'\fR), each a list of inlines. .PP .Vb 1 \& LineBlock [ @lines ] .Ve .PP This element was added in pandoc 1.18. Before it was represented Para elements with embedded LineBreak elements. This old serialization form can be enabled by setting \f(CW$PANDOC_VERSION\fR package variable to a lower version number. .PP \fINull\fR .IX Subsection "Null" .PP Nothing .PP .Vb 1 \& Null .Ve .PP \fIOrderedList\fR .IX Subsection "OrderedList" .PP Numbered list of items (\f(CW\*(C`content\*(C'\fR=\f(CW\*(C`items\*(C'\fR), each a list of blocks), preceded by list attributes (start number, numbering style, and delimiter). .PP .Vb 1 \& OrderedList [ $start, $style, $delim ], [ [ @blocks ] ] .Ve .PP Supported styles are \f(CW\*(C`DefaultStyle\*(C'\fR, \f(CW\*(C`Example\*(C'\fR, \f(CW\*(C`Decimal\*(C'\fR, \f(CW\*(C`LowerRoman\*(C'\fR, \&\f(CW\*(C`UpperRoman\*(C'\fR, \f(CW\*(C`LowerAlpha\*(C'\fR, and \f(CW\*(C`UpperAlpha\*(C'\fR. .PP Supported delimiters are \f(CW\*(C`DefaultDelim\*(C'\fR, \f(CW\*(C`Period\*(C'\fR, \f(CW\*(C`OneParen\*(C'\fR, and \&\f(CW\*(C`TwoParens\*(C'\fR. .PP \fIPara\fR .IX Subsection "Para" .PP Paragraph, consisting of a list of Inline elements (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Para [ $elements ] .Ve .PP \fIPlain\fR .IX Subsection "Plain" .PP Plain text, not a paragraph, consisting of a list of Inline elements (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Plain [ @inlines ] .Ve .PP \fIRawBlock\fR .IX Subsection "RawBlock" .PP Raw block with \f(CW\*(C`format\*(C'\fR and \f(CW\*(C`content\*(C'\fR string. .PP .Vb 1 \& RawBlock $format, $content .Ve .PP \fITable\fR .IX Subsection "Table" .PP Table, with \f(CW\*(C`caption\*(C'\fR, column \f(CW\*(C`alignments\*(C'\fR, relative column \f(CW\*(C`widths\*(C'\fR (0 = default), column \f(CW\*(C`headers\*(C'\fR (each a list of blocks), and \&\f(CW\*(C`rows\*(C'\fR (each a list of lists of blocks). .PP .Vb 1 \& Table [ @inlines ], [ @alignments ], [ @width ], [ @headers ], [ @rows ] .Ve .PP Possible alignments are \f(CW\*(C`AlignLeft\*(C'\fR, \f(CW\*(C`AlignRight\*(C'\fR, \f(CW\*(C`AlignCenter\*(C'\fR, and \&\f(CW\*(C`AlignDefault\*(C'\fR. .PP An example: .PP .Vb 7 \& Table [Str "Example"], [AlignLeft,AlignRight], [0.0,0.0], \& [[Plain [Str "name"]] \& ,[Plain [Str "number"]]], \& [[[Plain [Str "Alice"]] \& ,[Plain [Str "42"]]] \& ,[[Plain [Str "Bob"]] \& ,[Plain [Str "23"]]]]; .Ve .SS "\s-1INLINE ELEMENTS\s0" .IX Subsection "INLINE ELEMENTS" \fICite\fR .IX Subsection "Cite" .PP Citation, a list of \f(CW\*(C`citations\*(C'\fR and a list of inlines (\f(CW\*(C`content\*(C'\fR). See helper function citation to construct citations. .PP .Vb 1 \& Cite [ @citations ], [ @inlines ] .Ve .PP \fICode\fR .IX Subsection "Code" .PP Inline code, a literal string (\f(CW\*(C`content\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \&\f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR) .PP .Vb 1 \& Code attributes { %attr }, $content .Ve .PP \fIEmph\fR .IX Subsection "Emph" .PP Emphasized text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Emph [ @inlines ] .Ve .PP \fIImage\fR .IX Subsection "Image" .PP Image with alt text (\f(CW\*(C`content\*(C'\fR, a list of inlines) and \&\f(CW\*(C`target\*(C'\fR (list of \f(CW\*(C`url\*(C'\fR and \f(CW\*(C`title\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \&\f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR). .PP .Vb 1 \& Image attributes { %attr }, [ @inlines ], [ $url, $title ] .Ve .PP Serializing the attributes is disabled in api version less then 1.16. .PP \fILineBreak\fR .IX Subsection "LineBreak" .PP Hard line break .PP .Vb 1 \& LineBreak .Ve .PP \fILink\fR .IX Subsection "Link" .PP Hyperlink with link text (\f(CW\*(C`content\*(C'\fR, a list of inlines) and \f(CW\*(C`target\*(C'\fR (list of \f(CW\*(C`url\*(C'\fR and \f(CW\*(C`title\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \&\f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR). .PP .Vb 1 \& Link attributes { %attr }, [ @inlines ], [ $url, $title ] .Ve .PP Serializing the attributes is disabled in api version less then 1.16. .PP \fIMath\fR .IX Subsection "Math" .PP TeX math, given as literal string (\f(CW\*(C`content\*(C'\fR) with \f(CW\*(C`type\*(C'\fR (one of \&\f(CW\*(C`DisplayMath\*(C'\fR and \f(CW\*(C`InlineMath\*(C'\fR). .PP .Vb 1 \& Math $type, $content .Ve .PP \fINote\fR .IX Subsection "Note" .PP Footnote or Endnote, a list of blocks (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Note [ @blocks ] .Ve .PP \fIQuoted\fR .IX Subsection "Quoted" .PP Quoted text with quote \f(CW\*(C`type\*(C'\fR (one of \f(CW\*(C`SingleQuote\*(C'\fR and \f(CW\*(C`DoubleQuote\*(C'\fR) and a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Quoted $type, [ @inlines ] .Ve .PP \fIRawInline\fR .IX Subsection "RawInline" .PP Raw inline with \f(CW\*(C`format\*(C'\fR (a string) and \f(CW\*(C`content\*(C'\fR (a string). .PP .Vb 1 \& RawInline $format, $content .Ve .PP \fISmallCaps\fR .IX Subsection "SmallCaps" .PP Small caps text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& SmallCaps [ @inlines ] .Ve .PP \fISoftBreak\fR .IX Subsection "SoftBreak" .PP Soft line break .PP .Vb 1 \& SoftBreak .Ve .PP This element was added in pandoc 1.16 as a matter of editing convenience to preserve line breaks (as opposed to paragraph breaks) from input source to output. If you are going to feed a document containing \f(CW\*(C`SoftBreak\*(C'\fR elements to Pandoc < 1.16 you will have to set the package variable or environment variable \f(CW\*(C`PANDOC_VERSION\*(C'\fR to 1.15 or below. .PP \fISpace\fR .IX Subsection "Space" .PP Inter-word space .PP .Vb 1 \& Space .Ve .PP \fISpan\fR .IX Subsection "Span" .PP Generic container of inlines (\f(CW\*(C`content\*(C'\fR) with attributes (\f(CW\*(C`attr\*(C'\fR, \f(CW\*(C`id\*(C'\fR, \f(CW\*(C`class\*(C'\fR, \f(CW\*(C`classes\*(C'\fR, \f(CW\*(C`keyvals\*(C'\fR). .PP .Vb 1 \& Span attributes { %attr }, [ @inlines ] .Ve .PP \fIStr\fR .IX Subsection "Str" .PP Plain text, a string (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Str $content .Ve .PP \fIStrikeout\fR .IX Subsection "Strikeout" .PP Strikeout text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Strikeout [ @inlines ] .Ve .PP \fIStrong\fR .IX Subsection "Strong" .PP Strongly emphasized text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Strong [ @inlines ] .Ve .PP \fISubscript\fR .IX Subsection "Subscript" .PP Subscripted text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Supscript [ @inlines ] .Ve .PP \fISuperscript\fR .IX Subsection "Superscript" .PP Superscripted text, a list of inlines (\f(CW\*(C`content\*(C'\fR). .PP .Vb 1 \& Superscript [ @inlines ] .Ve .SS "\s-1METADATA ELEMENTS\s0" .IX Subsection "METADATA ELEMENTS" See Pandoc::Metadata for documentation. .SS "\s-1TYPE KEYWORDS\s0" .IX Subsection "TYPE KEYWORDS" The following document elements are only as used as type keywords in other document elements: .IP "\(bu" 4 \&\f(CW\*(C`SingleQuote\*(C'\fR, \f(CW\*(C`DoubleQuote\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`DisplayMath\*(C'\fR, \f(CW\*(C`InlineMath\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`AuthorInText\*(C'\fR, \f(CW\*(C`SuppressAuthor\*(C'\fR, \f(CW\*(C`NormalCitation\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`AlignLeft\*(C'\fR, \f(CW\*(C`AlignRight\*(C'\fR, \f(CW\*(C`AlignCenter\*(C'\fR, \f(CW\*(C`AlignDefault\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`DefaultStyle\*(C'\fR, \f(CW\*(C`Example\*(C'\fR, \f(CW\*(C`Decimal\*(C'\fR, \f(CW\*(C`LowerRoman\*(C'\fR, \f(CW\*(C`UpperRoman\*(C'\fR, \&\f(CW\*(C`LowerAlpha\*(C'\fR, \f(CW\*(C`UpperAlpha\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`DefaultDelim\*(C'\fR, \f(CW\*(C`Period\*(C'\fR, \f(CW\*(C`OneParen\*(C'\fR, \f(CW\*(C`TwoParens\*(C'\fR .SH "SEE ALSO" .IX Header "SEE ALSO" Perl module Pandoc implements a wrapper around the pandoc executable. .PP Similar libraries in other programming languages are listed at . .SH "AUTHOR" .IX Header "AUTHOR" Jakob Vo\*8 .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Benct Philip Jonsson .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2014\- Jakob Vo\*8 .PP \&\s-1GNU\s0 General Public License, Version 2 .PP This module is heavily based on Pandoc by John MacFarlane.