Skip to main content

Module style

Module style 

Source
Expand description

The typed CSL style AST produced by parse_style.

This models the structure of a CSL 1.0.2 style; the <style> root, its <info>, <citation>, <bibliography>, and <macro> children, and the rendering elements (Element) with their common attributes. It is a faithful structural model, not a processor: there is no evaluation of a style against data here. Rendering-critical options are retained on typed option structs so a future processor can interpret them. Attributes outside the modelled set are ignored; unknown rendering elements are a parse error.

Structs§

Bibliography
The <bibliography> element: how bibliography entries are formatted.
BibliographyOptions
<bibliography> options retained but not evaluated.
Branch
One <if> / <else-if> branch of a Choose.
Choose
<choose>: conditional rendering.
Citation
The <citation> element: how cites are formatted.
CitationOptions
<citation> options retained but not evaluated.
Common
Common rendering attributes shared across most CSL elements (affixes, formatting, and delimiter). Unmodelled attributes are ignored by the parser.
Conditions
The conditions on an <if> / <else-if>.
DateElement
<date>: renders a date variable, localized or with explicit parts.
DatePart
A <date-part> child of <date>.
EtAl
The <et-al> child of <names>.
Group
<group>: a delimited, conditionally-suppressed run of elements.
Info
Style metadata (<info>). Only the commonly-needed fields are modelled.
InfoCategory
An <info><category .../> entry.
InfoContributor
An <info><author> or <info><contributor> entry.
InfoLink
An <info><link .../> entry.
InheritableNameOptions
Inheritable name options, valid on <style>, <citation>, <bibliography>, and <name>. Retained but not evaluated; a processor applies them as the cascading defaults a <name> element inherits.
Label
<label>: renders a term matching a variable.
Layout
A <layout>: an ordered list of rendering elements plus common attributes.
LocaleBlock
An in-style <locale> block retained but not interpreted.
NameElement
The <name> child of <names> (a subset of its many options).
NamePart
A <name-part> child of <name>.
Names
<names>: renders one or more name variables.
Number
<number>: renders a number variable.
SortKey
One <key> in a <sort>.
SortKeyOptions
<key> options retained but not evaluated.
Style
A parsed CSL style (the <style> root element).
StyleOptions
Global <style> rendering options retained but not evaluated.
Text
<text>: renders a variable, macro, term, or literal value.

Enums§

Element
A CSL rendering element.
Match
The match attribute on a condition set.
SortTarget
What a SortKey sorts on.
StyleClass
The class of a CSL style.
TextSource
What a Text element renders.