1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
//! An xnote in content shown again: the element [`MARK_OF`] of the node that
//! represents the xnote in the copy, its payload [`MarkOf`], and its general
//! lowering rule [`MarkOfRule`].
//!
//! Content of the document that holds an xnote is shown a second time, away
//! from where it is written, when a reference prints a heading's title, an
//! unnumbered float's caption or a defined term, or a list item's tag. The
//! xnote there is not a second xnote: its number, its labels and its place in
//! its kind's list are the ones it has where it was written. So when such
//! content is copied to be shown again, the xnote's element returns, through
//! its [`InCopy`] aspect, which the copy consults, a new node that represents
//! the xnote: a node of the element [`MARK_OF`], with no children,
//! carrying a [`MarkOf`] payload that identifies the node carrying the
//! xnote. Nothing of the xnote itself is copied: no labels, no content. A
//! node carrying several xnotes becomes one node of the copy that represents
//! all of them, written as their marks side by side, in the node's order.
//! Another feature's element that carries xnotes returns the same node,
//! through [`copied_as`]. A copy made for content that a [synthesized
//! value](crate::guide::concepts_overview#synthesized-values) holds as its
//! own ([`ValueContent::Own`]: the use site of a user definition copied to be
//! expanded in place, content copied only to be read) holds the xnote as
//! written.
//!
//! The general rule writes that node as the xnote's mark: the superscript mark
//! text in the kind's mark style, inside a link to the xnote that carries the
//! accessible name (`Footnote 1`), as the xnote's own mark is written where
//! the xnote is written ([`stage_mark`](super::stage_mark)), with one
//! difference: it carries **no anchor**. The mark's anchor is the one where
//! the xnote is written, which the xnote's entry in its list links back to,
//! and a page holds each anchor once. The mark of an in-place xnote kind is
//! written in the same way, as a link to the xnote where it was written.
//! Content shown again is usually inside a link of its own (a reference is a
//! link to its target), so the mark's link is then inside another link; a
//! backend writes that as it writes any link inside a link (the HTML page
//! writes the inner one as its text). Nothing is added to any list, and
//! nothing is reported: the xnote reports its problems where it was written.
//!
//! On the recomposed LaTeX the node writes nothing
//! ([`MarkOfLatexRule`](super::latex::MarkOfLatexRule)), because no rule of
//! the standard features lowers content shown again on that backend.
use ;
use NodeRef;
use SerialValue;
use crate;
use crateValueContent;
use crateFlmSynthesizedSpec;
use crate;
use crate;
use crateElementSpec;
use cratepres;
use crateCOUNTERS;
use craterefs;
use XnoteKind;
use ;
use ;
use ;
/// The payload of a node of the element [`MARK_OF`]: the xnotes that the
/// node represents in content shown again, which are every xnote of the given
/// xnote kinds that the original node (the node the copy was made from)
/// carries.
///
/// The payload identifies the xnotes by their kinds and by the source span of
/// their node (the source and the range where it was written), which the copy
/// keeps for every node it copies: the rule finds the xnotes' records among
/// the kinds' records written at that span
/// ([`Xnotes::records_written_at`](super::Xnotes::records_written_at)). A node
/// of a copy has no address among the document's, so the span is what
/// identifies the original node.
/// What the element of `node`, a node carrying xnotes of the xnote kinds
/// `kinds`, returns from its [`InCopy`] aspect, for a copy made for
/// `purpose`: in content copied to be shown again ([`ValueContent::Shown`]),
/// one node of the element [`MARK_OF`] that represents every xnote of those
/// kinds the node carries ([`MarkOf`]), written as their marks; in a copy of
/// content that a synthesized value holds as its own ([`ValueContent::Own`]),
/// the node copied as written.
///
/// The element of `\footnote` passes its one xnote kind; another feature's
/// element carrying xnotes passes the kinds of its xnotes, each once, so that
/// its xnotes are shown in a copy as those of `\footnote` are. The element
/// [`MARK_OF`] belongs to the `xnotes` feature: in a registry without that
/// feature, no rule writes the node. Its element specification is a single
/// one, shared by every registry, because an element's [`InCopy`] aspect has
/// no access to a registry to take it from; the specification holds nothing a
/// registry configures, and would have to become each registry's own if it
/// came to depend on a configuration.
/// In content copied to be shown again, an xnote becomes one node of the
/// element [`MARK_OF`] that identifies it ([`MarkOf`]), written as its mark;
/// in a copy of content that a synthesized value holds as its own
/// ([`ValueContent::Own`]), it is copied as written ([`copied_as`]).
/// The specification of the nodes that represent xnotes in content shown
/// again, and its element, the one that the feature registers as
/// [`MARK_OF`]: inline content, keeping the whitespace around it as the copy
/// holds it. It is the same for every registry, since it holds nothing a
/// registry configures.
pub
/// The general rule of the element [`MARK_OF`], [`MARK_OF_RULE`], marked
/// default on every backend; the recomposed LaTeX uses a rule of its own that
/// writes nothing.
pub
/// The general lowering rule of the element [`MARK_OF`], [`MARK_OF_RULE`]:
/// the marks of the xnotes that the node represents ([`MarkOf`]).
///
/// Each mark is one `flm.pres.span { style: Superscript, role:
/// flm.xnotes.xnote.mark }` holding the mark text
/// ([`stage_mark_text`](super::stage_mark_text)) inside a `flm.pres.link` to
/// the xnote, as the xnote's own mark is written where the xnote is written
/// ([`stage_mark`](super::stage_mark)) but with no anchor, regardless of the
/// kind's placement: the mark's anchor is the one where the xnote is written.
///
/// The rule finds the xnotes among their kinds' records by the span where
/// their node was written: every record of those kinds written there, each
/// written as its mark, side by side, in the order of the node's points (the
/// order in which the node's element returns its xnotes). Where the table of
/// xnotes holds none, the rule writes nothing and reports
/// `flm.run.missing-entry`, as the xnote's own rule does. It reports nothing
/// else: the problems of an xnote (an empty content, a refused optional
/// argument) are reported where it was written.
;