diff options
Diffstat (limited to 'doc/lua-filters.md')
-rw-r--r-- | doc/lua-filters.md | 666 |
1 files changed, 665 insertions, 1 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index ecc63a4c4..810b9d606 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -624,6 +624,670 @@ Example of use: \end{tikzpicture} EOF + +# Lua type reference + +This section describes the types of objects available to Lua +filters. See the [pandoc module](#module-pandoc}) for functions +to create these objects. + +## Pandoc {#type-ref-pandoc} + +Pandoc document + +`blocks` +: document content ([List] of [Block]s) + +`meta` +: document meta information ([Meta] object) + + +## Meta {#type-ref-meta} + +Meta information on a document; string-indexed collection of +[MetaValue]s. + +## MetaValue {#type-ref-MetaValue} + +Document meta information items. + +### MetaBlocks {#type-ref-MetaBlocks} + +A list of blocks usable as meta value ([List] of [Block]s) + +Fields: + +`tag`, `t` +: the literal `MetaBlocks` (string) + +### MetaBool {#type-ref-MetaBool} + +Plain Lua boolean value (boolean) + +### MetaInlines {#type-ref-MetaInlines} + +List of inlines used in metadata ([List] of [Inline]s) + +Fields: + +`tag`, `t` +: the literal `MetaInlines` (string) + +### MetaList {#type-ref-iMetaList} + +A list of other [MetaValue]s. ([List]) + +Fields: + +`tag`, `t` +: the literal `MetaList` (string) + +### MetaMap {#type-ref-MetaMap} + +A string-indexed map of meta-values. (table) + +Fields: + +`tag`, `t` +: the literal `MetaMap` (string) + +*Note*: The fields will be shadowed if the map contains a field +with the same name as those listed. + +### MetaString {#type-ref-MetaString} + +Plain Lua string value (string) + + +## Block {#type-ref-Block} + +### BlockQuote {#type-ref-BlockQuote} + +A block quote element + +content: +: block content ([List] of [Block]s) + +`tag`, `t` +: the literal `BlockQuote` (string) + +### BulletList {#type-ref-BulletList} + +A bullet list + +`content` +: list of items ([List] of [Block]s) + +`tag`, `t` +: the literal `BulletList` (string) + +### CodeBlock {#type-ref-CodeBlock} + +Block of code. + +`text` +: code string (string) + +`attr` +: element attributes ([Attr]) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `CodeBlock` (string) + +### DefinitionList {#type-ref-DefinitionList} + +Definition list, containing terms and their explanation. + +`content` +: list of items + +`tag`, `t` +: the literal `DefinitionList` (string) + +### Div {#type-ref-Div} + +Generic block container with attributes + +`content` +: block content ([List] of [Block]s) + +`attr` +: element attributes ([Attr]) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Div` (string) + +### Header {#type-ref-Header} + +Creates a header element. + +`level` +: header level (integer) + +`content` +: inline content ([List] of [Inline]s) + +`attr` +: element attributes ([Attr]) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Header` (string) + + +### HorizontalRule {#type-ref-HorizontalRule} + +A horizontal rule. + +`tag`, `t` +: the literal `HorizontalRule` (string) + +### LineBlock {#type-ref-LineBlock} + +A line block, i.e. a list of lines, each separated from the next +by a newline. + +`content` +: inline content + +`tag`, `t` +: the literal `LineBlock` (string) + +### Null {#type-ref-Null} + +A null element; this element never produces any output in the +target format. + +`tag`, `t` +: the literal `Null` (string) + +### OrderedList {#type-ref-OrderedList} + +An ordered list. + +Parameters: + +`items` +: list items ([List] of [Block]s) + +`listAttributes` +: list parameters ([ListAttributes]) + +`start` +: alias for `listAttributes.start` (integer) + +`style` +: alias for `listAttributes.style` (string) + +`delimiter` +: alias for `listAttributes.delimiter` (string) + +`tag`, `t` +: the literal `OrderedList` (string) + +### Para {#type-ref-Para} + +A paragraph + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Para` (string) + +### Plain {#type-ref-Plain} + +Plain text, not a paragraph + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Plain` (string) + +### RawBlock {#type-ref-RawBlock} + +Raw content of a specified format. + +`format` +: format of content (string) + +`text` +: raw content (string) + +`tag`, `t` +: the literal `RawBlock` (string) + +### Table {#type-ref-Table} + +A table. + +`caption` +: table caption ([List] of [Inline]s) + +`aligns` +: column alignments ([List] of [Alignment]s) + +`widths` +: column widths (number) + +`headers` +: header row ([List] of [table cells]) + +`rows` +: table rows ([List] of [List]s of [table cells]) + +`tag`, `t` +: the literal `Table` (string) + +A [table cell]{#table-cell} is a list of blocks. + +*[Alignment]{#Alignment}* is a string value indicating the +horizontal alignment of a table column. `AlignLeft`, +`AlignRight`, and `AlignCenter` leads cell content tob be +left-aligned, right-aligned, and centered, respectively. The +default alignment is `AlignDefault` (often equivalent to +centered). + +[Alignment]: #type-ref-Alignment +[table cells]: #type-ref-table-cell + +## Inline {#type-ref-Inline} + +### Cite {#type-ref-Cite} +Citation + +`content` +: ([List] of [Inline]s) + +`citations` +: citation entries ([List] of [citations]) + +`tag`, `t` +: the literal `Cite` (string) + +### Code {#type-ref-Code} +Inline code + +`text` +: code string (string) + +`attr` +: attributes ([Attr]) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Code` (string) + +### Emph {#type-ref-Emph} +Emphasized text + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Emph` (string) + +### Image {#type-ref-Image} +Image: alt text (list of inlines), target + +`attr` +: attributes ([Attr]) + +`caption` +: text used to describe the image ([List] of [Inline]s) + +`src` +: path to the image file (string) + +`title` +: brief image description + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Image` (string) + +### LineBreak {#type-ref-LineBreak} +Hard line break + +`tag`, `t` +: the literal `LineBreak` (string) + +### Link {#type-ref-Link} +Hyperlink: alt text (list of inlines), target + +`attr` +: attributes ([Attr]) + +`content` +: text for this link ([List] of [Inline]s) + +`target` +: the link target (string) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Link` (string) + +### Math {#type-ref-Math} +TeX math (literal) + +`mathype` +: specifier determining whether the math content should be + shown inline (`InlineMath`) or on a separate line + (`DisplayMath`) (string) + +`text` +: math content (string) + +`tag`, `t` +: the literal `Math` (string) + +### Note {#type-ref-Note} +Footnote or endnote + +`content` +: ([List] of [Block]s) + +`tag`, `t` +: the literal `Note` (string) + +### Quoted {#type-ref-Quoted} +Quoted text + +`quotetype` +: type of quotes to be used; one of `SingleQuote` or + `DoubleQuote` (string) + +`content` +: quoted text ([List] of [Inline]s) + +`tag`, `t` +: the literal `Quoted` (string) + +### RawInline {#type-ref-RawInline} +Raw inline + +`format` +: the format of the content (string) + +`text` +: raw content (string) + +`tag`, `t` +: the literal `RawInline` (string) + +### SmallCaps {#type-ref-SmallCaps} +Small caps text + +`content` +: ([List] of [Inline]s) + +`tag`, `t` +: the literal `SmallCaps` (string) + +### SoftBreak {#type-ref-SoftBreak} +Soft line break + +`tag`, `t` +: the literal `SoftBreak` (string) + +### Space {#type-ref-Space} +Inter-word space + +`tag`, `t` +: the literal `Space` (string) + +### Span {#type-ref-Span} +Generic inline container with attributes + +`attr` +: attributes ([Attr]) + +`content` +: wrapped content ([List] of [Inline]s) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + +`tag`, `t` +: the literal `Span` (string) + +### Str {#type-ref-Str} +Text + +`text` +: content (string) + +`tag`, `t` +: the literal `Str` (string) + +### Strikeout {#type-ref-Strikeout} +Strikeout text + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Strikeout` (string) + +### Strong {#type-ref-Strong} +Strongly emphasized text + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Strong` (string) + +### Subscript {#type-ref-Subscript} +Subscripted text + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Subscript` (string) + +### Superscript {#type-ref-Superscript} +Superscripted text + +`content` +: inline content ([List] of [Inline]s) + +`tag`, `t` +: the literal `Superscript` (string) + +## Element components + +### Attr {#type-ref-Attr} + +A set of element attributes + +`identifier` +: element identifier (string) + +`classes` +: element classes ([List] of strings) + +`attributes` +: collection of key/value pairs ([Attributes]) + +### Attributes {#type-ref-Attributes} + +List of key/value pairs. Values can be accessed by using keys as +indices to the list table. + +### Citation {#type-ref-Citation} + +Single citation entry + +`id` +: citation identifier, e.g., a bibtex key (string) + +`mode` +: citation mode, one of `AuthorInText`, `SuppressAuthor`, or + `NormalCitation` (string) + +`prefix` +: citation prefix ([List] of [Inline]s) + +`suffix` +: citation suffix ([List] of [Inline]s) + +`note_num` +: note number (integer) + +`hash` +: hash (integer) + +### ListAttributes {#type-ref-ListAttributes} +List attributes + +`start` +: number of the first list item (integer) + +`style` +: style used for list numbers; possible values are `DefaultStyle`, + `Example`, `Decimal`, `LowerRoman`, `UpperRoman`, + `LowerAlpha`, and `UpperAlpha` (string) + +`delimiter` +: delimiter of list numbers; one of `DefaultDelim`, `Period`, + `OneParen`, and `TwoParens` (string) + +## Hierarchical Element {#type-ref-Element} + +Hierarchical elements can be either *Sec* (sections) or *Blk* +(blocks). *Blk* elements are treated like [Block]s. + +### Sec {#type-ref-Sec} + +Section elements used to provide hierarchical information on +document contents. + +**Objects of this type are read-only.** + +`level` +: header level (integer) + +`numbering` +: section numbering ([list] of integers) + +`attr` +: header attributes ([Attr]) + +`label` +: header content ([list] of [Inline]s) + +`contents` +: list of contents in this section ([list] of [hierarchical element]s) + +`tag`, `t` +: constant `Sec` (string) + +[hierarchical element]: #Element + +## ReaderOptions {#type-ref-ReaderOptions} + +Pandoc reader options + +`abbreviations` +: set of known abbreviations (set of strings) + +`columns` +: number of columns in terminal (integer) + +`default_image_extension` +: default extension for images (string) + +`extensions` +: string representation of the syntax extensions bit field + (string) + +`indented_code_classes` +: default classes for indented code blocks (list of strings) + +`standalone` +: whether the input was a standalone document with header + (boolean) + +`strip_comments` +: HTML comments are stripped instead of parsed as raw HTML + (boolean) + +`tab_stop` +: width (i.e. equivalent number of spaces) of tab stops + (integer) + +`track_changes` +: track changes setting for docx; one of `AcceptChanges`, + `RejectChanges`, and `AllChanges` (string) + +[Block]: #type-ref-Block +[List]: #module-pandoc.list +[MetaValue]: #type-ref-MetaValue +[Inline]: #type-ref-Inline +[Attr]: #type-ref-Attr +[Attributes]: #type-ref-Attributes +[citations]: #type-ref-Citation + # Module text UTF-8 aware text manipulation functions, implemented in Haskell. @@ -664,7 +1328,7 @@ end Lua functions for pandoc scripts. -## Pandoc Document +## Pandoc Document {#type-ref-} [`Pandoc (blocks[, meta])`]{#Pandoc} |