Skip to main content

XnoteSource

Trait XnoteSource 

Source
pub trait XnoteSource: Send + Sync {
    // Required method
    fn xnotes(&self, node: &NodeRef<'_, Flm>) -> Vec<XnoteOf>;
}
Expand description

The aspect an element implements when its nodes carry xnotes: for one node, which xnote kinds it carries and which region of the node holds the content of each.

The content of an xnote is always a region of the node itself, one of its arguments or one of its bodies (a slot of the node; NodeRegion), in whichever tree the node is placed. The list of the xnote kind shows the content by lowering that region where the entry is placed (CONTENT_POINTER); nothing of it is copied. The XNOTE element returns one xnote, whose content is its argument XNOTE_ARG. An element of another feature returns the regions of its own node that hold the contents of its xnotes; the collect stage records the node where it is placed in the document.

This aspect is one of the four things that make a node an xnote; the others are the xnote kind in the service slot KINDS_SLOT (contribute_kind), the two reference points of each xnote (ref_points, returned through Referenceable), and the element’s ApartFromText aspect, which includes the regions the xnotes are made from (regions_apart_from_text) so that their words are not read as part of the text around them (for instance by the anchor a heading builds from its title). The author’s \footnote goes through the same four.

The content of an xnote must be a region of a node of the document. An xnote whose content a feature builds itself, as a synthesized value rather than as a region of a node, is not implemented: the list can point only into the document’s trees and into the synthesized values that the lowering of the list holds.

§Several xnotes on one node

A node may carry several xnotes, of one xnote kind or of several. Its element returns one XnoteOf per xnote here, and one pair of points per xnote through its Referenceable aspect, calling ref_points once per xnote. The two lists are paired by order, xnote kind by xnote kind: the node’s n-th pair of points of a kind (the n-th record of that kind that the table XNOTES holds for the node, Xnotes::records_at) is the xnote whose content is the n-th XnoteOf of that kind returned here. Every reader of a node’s xnotes follows this pairing: the collect stage records the region of each xnote’s content with it (XnoteRecord::content); the staging helpers take the position of the xnote they write among the node’s xnotes of its kind (stage_mark, stage_in_place, stage_latex); and the node that represents the node in content shown again represents every one of its xnotes (MarkOf). A node whose two lists hold different numbers of xnotes of a kind is reported (Unpaired). Each XnoteOf of a node must refer to a region of its own: the list of an xnote kind finds an entry’s xnote by the node and the region that the entry’s content pointer refers to (ContentPointer).

The element decides which labels label which xnote, through the labels it passes to each ref_points call: the labels of \footnote[\label{…}]{…} label the single xnote of its node.

Required Methods§

Source

fn xnotes(&self, node: &NodeRef<'_, Flm>) -> Vec<XnoteOf>

The xnotes that node carries, in order: for each, its xnote kind and the region of node that holds its content.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl XnoteSource for XnoteElement

One xnote of the element’s xnote kind, whose content is the argument XNOTE_ARG.