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
//! This module defines the diagnostic conditions that the pieces stage of a
//! backend ([`PiecesStage`](super::PiecesStage)) reports.
use DiagnosticInfo;
/// The warning that is reported when a piece listed in the setting `include` or
/// `exclude` of the `pieces` feature is not defined in any feature (id
/// `flm.pieces.unknown-piece`).
///
/// The settings `include` and `exclude` are the fields of
/// [`PiecesRenderOptions`](super::PiecesRenderOptions). They accept the names
/// of the pieces declared in the registry
/// ([`declared_pieces`](super::declared_pieces)), as in
/// `pieces.include=[flm.toc]`.
///
/// Reported by the pieces stage of each backend when it runs. The unknown name
/// is ignored, and the output is the same as without it.
/// The error that is reported when a piece cannot be rendered for a backend
/// (id `flm.pieces.lowering-failed`).
///
/// The pieces stage of a backend renders a piece in two steps. First, it
/// brings the content of the piece up to date ([value
/// catch-up](crate::guide::concepts_overview#value-catch-up)). Then, it lowers
/// the content with the lowering rules selected for the backend. Either step
/// can fail. For instance, no label may be defined in the content of a piece.
/// If a label is defined there, the first step fails.
///
/// Reported by the pieces stage of the backend when it runs, once for each
/// piece that fails. The piece is left out of the output of this backend, and
/// the rest of the document is written. The diagnostics that describe the
/// cause of the failure, if any, are reported as well.