Skip to main content

Module rules

Module rules 

Source
Expand description

The synthesized elements of the metadata’s pieces, and their default lowering rules. Every backend uses these rules, except that the latex-recomposed backend has rules of its own for each of them (latex), and the text backend has rules of its own for the title and for one author (text).

The elements are TITLE, AUTHOR, AUTHOR_ENTRY, AUTHOR_NAME, AUTHOR_AFFILIATION, AUTHOR_EMAIL, AUTHOR_NOTE and DATE. They are synthesized: no document can write them, and the stage BuildMetadata builds them from the metadata. The rules of the three pieces stage a flm.pres.block per piece, whose role is the element’s name and whose kind token is KIND_METADATA, so that a stylesheet or a program’s lowering rule can select on them:

  • the title and the date (MetaTextRule): the block holds the text as one paragraph;
  • the authors (AuthorRule): the block holds each author, one after the other, each a unit of lines (EntryRule): the name, each affiliation, the email address and each note on a line of its own, each in a flm.pres.span whose role is the element’s name (PartRule, EmailRule). The email address is a link to mailto: followed by the address.
flm.pres.block { role: flm.metadata.author, kinds: [metadata] }
  ├ flm.pres.lines                                      the first author
  │   ├ flm.pres.line
  │   │   └ flm.pres.span { role: flm.metadata.author.name }  the name
  │   ├ flm.pres.line
  │   │   └ flm.pres.span { role: flm.metadata.author.affiliation }  an affiliation
  │   ├ flm.pres.line
  │   │   └ flm.pres.span { role: flm.metadata.author.email }
  │   │       └ flm.pres.link { href: mailto:<address>, kind: url }  the address
  │   └ flm.pres.line
  │       └ flm.pres.span { role: flm.metadata.author.note }  a note
  └ flm.pres.lines                                      the next author, …

The rules write no affiliation’s number (AffiliationPayload). How the authors are laid out beyond this (the size of each part, the authors side by side) is the business of the feature’s stylesheet (stylesheet) and LaTeX definitions (latex_rendered), or of a compose template’s.

The rules of the three pieces require the feature’s style identifier STYLE at every piece they stage: the html backend resolves it to the feature’s stylesheet, the latex-rendered backend to the feature’s definition piece (latex_rendered).

Structs§

AuthorRule
The default lowering rule of the authors, the element AUTHOR, on every backend except latex-recomposed. It stages a flm.pres.block of role flm.metadata.author and kind token metadata holding each author, lowered through its rule (EntryRule), in order.
EmailRule
The default lowering rule of an author’s email address, the element AUTHOR_EMAIL, on every backend except latex-recomposed. It stages
EntryRule
The default lowering rule of one author, the element AUTHOR_ENTRY, on every backend except latex-recomposed and text (EntryTextRule). It stages one flm.pres.lines holding one flm.pres.line per part of the author (the name, each affiliation, the email address, each note, in this order), each line holding its part lowered through the part’s rule (PartRule, EmailRule). The lines carry no indentation and the default alignment.
MetaTextRule
The default lowering rule of the title and of the date, the elements TITLE and DATE, on every backend except latex-recomposed (and, for the title, text, TitleTextRule). It stages
PartRule
The default lowering rule of an author’s name, of an affiliation and of a note, the elements AUTHOR_NAME, AUTHOR_AFFILIATION and AUTHOR_NOTE, on every backend except latex-recomposed. It stages a flm.pres.span whose role is the element’s name, holding the text lowered through the rules.

Functions§

rule_name
Returns the name of the default lowering rule of the element element, <element>.lower.default.