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
//! The content handler that the [`graphics`](super) feature contributes to the
//! `floats` feature: `includegraphics`, which accepts exactly one image.
//!
//! A float type lists by name the **content handlers** it accepts. A content
//! handler ([`FloatContentHandler`]) is a value that accepts a float's content
//! or refuses it, contributed to the service slot
//! [`CONTENT_SLOT`](crate::stdlib::features::floats::CONTENT_SLOT)
//! (`flm.floats.content`) by the feature that owns that kind of content. This
//! feature owns images, so it contributes [`HANDLER`] (`includegraphics`,
//! [`IncludeGraphicsContent`]): it accepts a float's content where the content
//! is exactly one node of the image element [`IMAGE_ELEMENT`] (the body of a
//! `figure` holding `\includegraphics{plot.png}` beside its caption and
//! labels), and refuses it otherwise with the words `exactly one image`, which
//! complete the float's Error ("a ‘figure’ must hold exactly one image").
//!
//! The contribution is a peer contribution: in a registry without the
//! `floats` feature, no feature declares the slot, the registry build drops
//! the contribution with one Note, and the `graphics` feature builds and works
//! as it does on its own.
use NodeRef;
use crateFlm;
use crateelement_of;
use crateFloatContentHandler;
use IMAGE_ELEMENT;
/// The name of the feature's content handler, `includegraphics`: the name a
/// float type lists among its handlers to accept one image
/// ([`FloatType::handlers`](crate::stdlib::features::floats::FloatType::handlers)).
pub const HANDLER: &str = "includegraphics";
/// The content handler [`HANDLER`] (`includegraphics`): it accepts exactly one
/// image, a node of [`IMAGE_ELEMENT`], and refuses anything else: two images,
/// text, an image beside a paragraph, or no content at all. See the [module
/// documentation](self).
;