InlineRecords
in package
implements
NodeRule
5.5.5 has no inline media or source: OBJE and SOUR substructures point to records. Each one without a pointer becomes a new record @X<n>@ (before TRLR, in order of appearance), and the substructure points to it:
- OBJE: its substructures move to the record; the media record of 5.5.5 has the title under FILE, so TITL moves under the first FILE, and FORM.MEDI is FORM.TYPE there. A FORM beside FILE (the other 5.5.1 form of the link) moves into the first FILE;
- SOUR: the description (its value) becomes the record's TITL; TEXT moves under a new DATA of the citation, the rest stays on the citation.
HEAD.SOUR names a program, not a source, and substructures of extensions are left alone.
Table of Contents
Interfaces
- NodeRule
- A rule for one structure at a time. Rules that look at every line of a record are grouped in {@see Rule\Nodes}, which walks each record once for all of them.
Methods
- needsPrepass() : bool
- Whether the rule needs Context::prepass(): facts about the whole input before the first record.
- node() : bool
- Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
- tags() : array<int, string>|null
Methods
needsPrepass()
Whether the rule needs Context::prepass(): facts about the whole input before the first record.
public
needsPrepass() : bool
Return values
boolnode()
Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
public
node(Document $document, int $id, Context $context) : bool
Parameters
Return values
bool —false when the rule removed the structure: the rules after it and its substructures are skipped
tags()
public
tags() : array<int, string>|null
Return values
array<int, string>|null —the tags of the structures the rule converts; null for every structure